Venice
SInvce::InsertItrDetail
 
Inserts a new Intrastat detail in the invoice.
 
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
CreateSInvce
Handling invoicing 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
pSInvce->PrepareDocument (paUpdate);

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

    pSInvce->WriteDocument (rmFullReport, VARIANT_FALSE, VARIANT_FALSE);
}
else
    pSInvce->CancelDocument ();

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

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

    oSInvce.WriteDocument (eReportMode.rmFullReport, false, false);
}
else
    oSInvce.CancelDocument ();

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

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

    Call oSInvce.WriteDocument(rmFullReport, False, False)
Else
    Call oSInvce.CancelDocument()
End If

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

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

    oSInvce.WriteDocument(eReportMode.rmFullReport, False, False)
Else
    oSInvce.CancelDocument()
End If