Venice
Sales::InsertItrDetail
 
Inserts a new Intrastat detail in the document.
 
void InsertItrDetail (
    SHORT sIndex,
    DOUBLE dAmountDocC,
    DOUBLE dMass,
    DOUBLE dSupplUnits,
    enum eStatProc eStatProc,
    enum eNatTrans eNatTrans,
    enum eRegion eRegion,
    enum eTransport eTransport,
    enum eDelivCond eDelivCond,
    BSTR bsCommodityCode,
    BSTR bsCountry,
    BSTR bsCountryOrigin
)
 
Parameters
sIndex
[in] The index of the Intrastat detail, starting from 0.
dAmountDocC
[in] The amount (in document currency) of the Intrastat detail.
dMass
[in] The mass of the Intrastat detail.
dSupplUnits
[in] The supplementary units of the Intrastat detail.
eStatProc
[in] A value of the 'eStatProc' enumeration.
eNatTrans
[in] A value of the 'eNatTrans' enumeration.
eRegion
[in] A value of the 'eRegion' enumeration.
eTransport
[in] A value of the 'eTransport' enumeration.
eDelivCond
[in] A value of the 'eDelivCond' enumeration.
bsCommodityCode
[in] The unformatted commodity code of the Intrastat detail.
bsCountry
[in] The country code of the partner of the Intrastat detail.
bsCountryOrigin
[in] The country code of origin of the Intrastat detail.
 
Remarks
The parameter sIndex can have the value -1. In this case the new Intrastat detail is inserted after the existing Intrastat details.
If sIndex refers to an existing index, the new Intrastat detail is inserted at this index and all following Intrastat details are moved to the next index.
Any calls to InsertItrDetails are ignored if there is no IC relation.
 
See Also
CreateSales
Handling accounting documents using the SDK
PrepareDocument
IsIcRelation
GetNumItrDetails
WriteDocument
CancelDocument
 
Samples
 
C++
 
// Insert an Intrastat detail for the complete amount of the current document if Intrastat details are not yet available
pSales->PrepareDocument (paUpdate);

if (pSales->IsIcRelation () && !pSales->GetNumItrDetails ())
{
    pSales->InsertItrDetail (0, pSales->pTotalDocC.dblVal, 1.0, 1.0, spDispatch, ntrFree_Free, reFlanders, trAir, dcFCA, "85203219", "FR", "US");

    pSales->WriteDocument (rmFullReport);
}
else
    pSales->CancelDocument ();

C#
 
// Insert an Intrastat detail for the complete amount of the current document if Intrastat details are not yet available
oSales.PrepareDocument (ePrepareAction.paUpdate);

if (oSales.IsIcRelation () && oSales.GetNumItrDetails () == 0)
{
    oSales.InsertItrDetail (0, (double)oSales.pTotalDocC, 1.0, 1.0, eStatProc.spDispatch, eNatTrans.ntrFree_Free, eRegion.reFlanders, eTransport.trAir, eDelivCond.dcFCA, "85203219", "FR", "US");

    oSales.WriteDocument (eReportMode.rmFullReport);
}
else
    oSales.CancelDocument ();

VBS
 
' Insert an Intrastat detail for the complete amount of the current document if Intrastat details are not yet available
Call oSales.PrepareDocument(paUpdate)

If oSales.IsIcRelation() And oSales.GetNumItrDetails() = 0 Then
    Call oSales.InsertItrDetail(0, oSales.pTotalDocC, 1.0, 1.0, spDispatch, ntrFree_Free, reFlanders, trAir, dcFCA, "85203219", "FR", "US")

    Call oSales.WriteDocument(rmFullReport)
Else
    Call oSales.CancelDocument()
End If

VB.NET
 
' Insert an Intrastat detail for the complete amount of the current document if Intrastat details are not yet available
oSales.PrepareDocument(ePrepareAction.paUpdate)

If oSales.IsIcRelation() And oSales.GetNumItrDetails() = 0 Then
    oSales.InsertItrDetail(0, oSales.pTotalDocC, 1.0, 1.0, eStatProc.spDispatch, eNatTrans.ntrFree_Free, eRegion.reFlanders, eTransport.trAir, eDelivCond.dcFCA, "85203219", "FR", "US")

    oSales.WriteDocument(eReportMode.rmFullReport)
Else
    oSales.CancelDocument()
End If