SInvce::InsertDetailSel2 (Interface: SInvce)
 
Inserts a new extended detail in the invoice (with selectively given values).
 
void InsertDetailSel2 (
    SHORT sIndex,
    VARIANT vQuantity,
    VARIANT vPriceDocC,
    VARIANT vPurchaseValueDocC,
    VARIANT vExciseDocC,
    VARIANT vEmptiesDocC,
    VARIANT vDiscount1,
    VARIANT vDiscount2,
    VARIANT vValue1,
    VARIANT vArtNum,
    VARIANT vArtDsc,
    VARIANT vFollowUp,
    VARIANT vRemark,
    VARIANT vText1,
    VARIANT vAnaCentre,
    VARIANT vAnaUnit,
    VARIANT vDate1,
    VARIANT vDate2,
    VARIANT vVatCode,
    VARIANT vIcCode,
    VARIANT vPrintLine,
    VARIANT vCutOffStart,
    VARIANT vCutOffEnd
)
 
Parameters
sIndex
[in] The index of the detail, starting from 0.
vQuantity
[in] A VARIANT stating the quantity of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
Article number is empty Existing article number
VT_EMPTY Use the programmatorical default (= 0.0) Use an automatically calculated value based on the article data
DOUBLE (VT_R8) Use the given value Use the given value
vPriceDocC
[in] A VARIANT stating the unit price (in document currency) of the article that is mentioned in the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
Article number is empty Existing article number
VT_EMPTY Use the programmatorical default (= 0.0) Use an automatically calculated value based on the article data
DOUBLE (VT_R8) Use the given value Use the given value
vPurchaseValueDocC
[in] A VARIANT stating the purchase value (in document currency) of the article that is mentioned in the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
Article number is empty Existing article number
VT_EMPTY Use the programmatorical default (= 0.0) Use an automatically calculated value based on the article data
DOUBLE (VT_R8) Use the given value Use the given value
vExciseDocC
[in] A VARIANT stating the excise amount (in document currency) of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
Article number is empty Existing article number
VT_EMPTY Use the programmatorical default (= 0.0) Use an automatically calculated value based on the article data
DOUBLE (VT_R8) Use the given value Use the given value
vEmptiesDocC
[in] A VARIANT stating the empties amount (in document currency) of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
Article number is empty Existing article number
VT_EMPTY Use the programmatorical default (= 0.0) Use an automatically calculated value based on the article data
DOUBLE (VT_R8) Use the given value Use the given value
vDiscount1
[in] A VARIANT stating the first discount rate of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
Article number is empty Existing article number
VT_EMPTY Use the programmatorical default (= 0.0) Use an automatically calculated value based on the article data
DOUBLE (VT_R8) Use the given value Use the given value
vDiscount2
[in] A VARIANT stating the second discount rate of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Use the programmatorical default (= 0.0)
DOUBLE (VT_R8) Use the given value
vValue1
[in] A VARIANT stating the free value of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
Article number is empty Existing article number
VT_EMPTY Use the programmatorical default (= 0.0) Use an applicable free value from the article card
DOUBLE (VT_R8) Use the given value Use the given value
vArtNum
[in] A VARIANT stating the article number of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Use the programmatorical default (= "")
BSTR (VT_BSTR) Use the given value
vArtDsc
[in] A VARIANT stating the article description of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
Article number is empty Existing article number
VT_EMPTY Use the programmatorical default (= "") Use the description from the article card
BSTR (VT_BSTR) Use the given value Use the given value
vFollowUp
[in] A VARIANT stating the follow-up code of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Use the programmatorical default (= "")
BSTR (VT_BSTR) Use the given value
vRemark
[in] A VARIANT stating the remark of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Use the programmatorical default (= "")
BSTR (VT_BSTR) Use the given value
vText1
[in] A VARIANT stating the free text of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
Article number is empty Existing article number
VT_EMPTY Use the programmatorical default (= "") Use an applicable free text from the article card
BSTR (VT_BSTR) Use the given value Use the given value
vAnaCentre
[in] A VARIANT stating the analytical centre of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Use the programmatorical default (= "")
BSTR (VT_BSTR) Use the given value
vAnaUnit
[in] A VARIANT stating the analytical unit of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Use the programmatorical default (= "")
BSTR (VT_BSTR) Use the given value
vDate1
[in] A VARIANT stating the first free date of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Use the programmatorical default (= blank)
DATE (VT_DATE) Use the given value
vDate2
[in] A VARIANT stating the second free date of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Use the programmatorical default (= blank)
DATE (VT_DATE) Use the given value
vVatCode
[in] A VARIANT stating the VAT code of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
Article number is empty Existing article number
VT_EMPTY Use the programmatorical default (= vcMin) Use an automatically calculated value based on the article data
Numerical value (variant type VT_UI1, VT_INT, VT_I2 or VT_I4) Use the given value Use the given value
vIcCode
[in] A VARIANT stating the IC code of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
Article number is empty Existing article number
VT_EMPTY Use the programmatorical default (= icMin) Use the IC code from the article card
Numerical value (variant type VT_UI1, VT_INT, VT_I2 or VT_I4) Use the given value Use the given value
vPrintLine
[in] A VARIANT indicating if the detail can be printed. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Use the programmatorical default (= true)
VARIANT_BOOL (VT_BOOL) Use the given value
vCutOffStart
[in] A VARIANT stating the cut off start date of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Use the programmatorical default (= blank)
DATE (VT_DATE) Use the given value
vCutOffEnd
[in] A VARIANT stating the cut off end date of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Use the programmatorical default (= blank)
DATE (VT_DATE) Use the given value
 
Remarks
The parameter sIndex can have the value -1. In this case the new detail is inserted after the existing details.
If sIndex refers to an existing index, the new detail is inserted at this index and all following details are moved to the next index.
Some header data (e.g. the customer number, the VAT rates,...) are needed in order to automatically calculate certain values (e.g. the unit price). If you insert the first detail of the document, these header data are initialized and used for all further calls of this method.
If you change header data after the insert of the first detail line, these header data will not be taken into account for automatic calculation.
How to pass a VARIANT of type VT_EMPTY?
C++
Define a VARIANT and set the type to VT_EMPTY (vEmpty.vt = VT_EMPTY).
Pass this VARIANT.
C#
Pass 'null'.
VBS
Pass 'Empty'.
VB.NET
Pass 'Nothing'.
 
See Also
CreateSInvce
Handling invoicing documents using the SDK
PrepareDocument
WriteDocument
CancelDocument
 
Samples
 
C++
 
// Insert the first detail line of a new document. Only the article number, the quantity, the remark and the cut off dates are given and all other data is to be calculated by the SDK.
VARIANT vEmpty, vCutOffStart, vCutOffEnd;

vEmpty.vt = VT_EMPTY;
vCutOffStart.vt = VT_DATE;
vCutOffStart.date = COleDateTime (2021, 1, 1, 0, 0, 0).m_dt;
vCutOffEnd.vt = VT_DATE;
vCutOffEnd.date = COleDateTime (2021, 12, 1, 0, 0, 0).m_dt;

pSInvce->PrepareDocument (paInsert);

// Fill the necessary header data

pSInvce->InsertDetailSel2 (-1, 1.0, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, "Insurance", vEmpty, vEmpty, "Inserted via SDK", vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vCutOffStart, vCutOffEnd);

pSInvce->WriteDocument (rmFullReport, VARIANT_TRUE, VARIANT_TRUE);

C#
 
// Insert the first detail line of a new document. Only the article number, the quantity, the remark and the cut off dates are given and all other data is to be calculated by the SDK.
oSInvce.PrepareDocument (ePrepareAction.paInsert);

// Fill the necessary header data

oSInvce.InsertDetailSel2 (-1, 1.0, null, null, null, null, null, null, null, "Insurance", null, null, "Inserted via SDK", null, null, null, null, null, null, null, null, new DateTime (2021, 1, 1), new DateTime (2021, 12, 1));

oSInvce.WriteDocument (eReportMode.rmFullReport, true, true);

VBS
 
' Insert the first detail line of a new document. Only the article number, the quantity, the remark and the cut off dates are given and all other data is to be calculated by the SDK.
Call oSInvce.PrepareDocument(paInsert)

' Fill the necessary header data

Call oSInvce.InsertDetailSel2(-1, 1.0, Empty, Empty, Empty, Empty, Empty, Empty, Empty, "Insurance", Empty, Empty, "Inserted via SDK", Empty, Empty, Empty, Empty, Empty, Empty, Empty, Empty, #1/1/2021#, #12/1/2021#)

Call oSInvce.WriteDocument(rmFullReport, True, True)

VB.NET
 
' Insert the first detail line of a new document. Only the article number, the quantity, the remark and the cut off dates are given and all other data is to be calculated by the SDK.
oSInvce.PrepareDocument(ePrepareAction.paInsert)

' Fill the necessary header data

oSInvce.InsertDetailSel2(-1, 1.0, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "Insurance", Nothing, Nothing, "Inserted via SDK", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, #1/1/2021#, #12/1/2021#)

oSInvce.WriteDocument(eReportMode.rmFullReport, True, True)