SDeliv::InsertDetailSel (Interface: SDeliv)
 
Inserts a new detail in the sales delivery (with selectively given values).
 
void InsertDetailSel (
    SHORT sIndex,
    VARIANT vQuantity,
    VARIANT vPriceDocC,
    VARIANT vPurchaseValueDocC,
    VARIANT vExciseDocC,
    VARIANT vEmptiesDocC,
    VARIANT vDiscount1,
    VARIANT vDiscount2,
    VARIANT vValue1,
    VARIANT vArtNum,
    VARIANT vArtDsc,
    VARIANT vParcelCode,
    VARIANT vFollowUp,
    VARIANT vRemark,
    VARIANT vText1,
    VARIANT vAnaCentre,
    VARIANT vAnaUnit,
    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
vParcelCode
[in] A VARIANT stating the parcel 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
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
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
CreateSDeliv
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 and the remark are given and all other data is to be calculated by the SDK.
VARIANT vEmpty;
vEmpty.vt = VT_EMPTY;

pSDeliv->PrepareDocument (paInsert);

// Fill the necessary header data

pSDeliv->InsertDetailSel (-1, 1.0, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, "ART_001", vEmpty, vEmpty, vEmpty, "Inserted via SDK", vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty);

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

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

// Fill the necessary header data

oSDeliv.InsertDetailSel (-1, 1.0, null, null, null, null, null, null, null, "ART_001", null, null, null, "Inserted via SDK", null, null, null, null, null, null, null, null);

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

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

' Fill the necessary header data

Call oSDeliv.InsertDetailSel(-1, 1.0, Empty, Empty, Empty, Empty, Empty, Empty, Empty, "ART_001", Empty, Empty, Empty, "Inserted via SDK", Empty, Empty, Empty, Empty, Empty, Empty, Empty, Empty)

Call oSDeliv.WriteDocument(rmFullReport, True, True)

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

' Fill the necessary header data

oSDeliv.InsertDetailSel(-1, 1.0, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "ART_001", Nothing, Nothing, Nothing, "Inserted via SDK", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)

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