Venice
SInvce::UpdateItrDetail
 
Updates an Intrastat detail in the invoice.
 
void UpdateItrDetail (
    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
If the parameter sIndex is an invalid index (refers to a not existing Intrastat detail) an exception is thrown. You can use GetItrDetail to check whether an index is valid, in which case it returns true.
 
See Also
CreateSInvce
Handling invoicing documents using the SDK
PrepareDocument
GetNumItrDetails
GetItrDetail
WriteDocument
CancelDocument
 
Samples
 
C++
 
// Update the region of all Intrastat details of the current document from reWallonia to reFlanders
VARIANT vAmountDocC, vMass, vSupplUnits, vStatProc, vNatTrans, vRegion, vTransport, vDelivCond, vCommodityCode, vCountry, vCountryOrigin;
short sNumItrDets;
bool bWrite = false;

pSInvce->PrepareDocument (paUpdate);

sNumItrDets = pSInvce->GetNumItrDetails ();

for (short sItrDet = 0; sItrDet < sNumItrDets; sItrDet++)
{
    if (pSInvce->GetItrDetail (sItrDet, &vAmountDocC, &vMass, &vSupplUnits, &vStatProc, &vNatTrans, &vRegion, &vTransport, &vDelivCond, &vCommodityCode, &vCountry, &vCountryOrigin) && (eRegion)vRegion.bVal == reWallonia)
    {
        pSInvce->UpdateItrDetail (sItrDet, vAmountDocC.dblVal, vMass.dblVal, vSupplUnits.dblVal, (eStatProc)vStatProc.bVal, (eNatTrans)vNatTrans.bVal, reFlanders, (eTransport)vTransport.bVal, (eDelivCond)vDelivCond.bVal, vCommodityCode.bstrVal, vCountry.bstrVal, vCountryOrigin.bstrVal);
        bWrite = true;
    }
}

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

C#
 
// Update the region of all Intrastat details of the current document from reWallonia to reFlanders
object oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, oRegion, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin;
short sNumItrDets;
bool bWrite = false;

oSInvce.PrepareDocument (ePrepareAction.paUpdate);

sNumItrDets = oSInvce.GetNumItrDetails ();

for (short sItrDet = 0; sItrDet < sNumItrDets; sItrDet++)
{
    if (oSInvce.GetItrDetail (sItrDet, out oAmountDocC, out oMass, out oSupplUnits, out oStatProc, out oNatTrans, out oRegion, out oTransport, out oDelivCond, out oCommodityCode, out oCountry, out oCountryOrigin) && (eRegion)((byte)oRegion) == eRegion.reWallonia)
    {
        oSInvce.UpdateItrDetail (sItrDet, (double)oAmountDocC, (double)oMass, (double)oSupplUnits, (eStatProc)((byte)oStatProc), (eNatTrans)((byte)oNatTrans), eRegion.reFlanders, (eTransport)((byte)oTransport), (eDelivCond)((byte)oDelivCond), oCommodityCode.ToString (), oCountry.ToString (), oCountryOrigin.ToString ());
        bWrite = true;
    }
}

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

VBS
 
' Update the region of all Intrastat details of the current document from reWallonia to reFlanders
Dim oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, oRegion, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin
Dim sItrDet, sNumItrDets
Dim bWrite

Call oSInvce.PrepareDocument(paUpdate)

sNumItrDets = oSInvce.GetNumItrDetails()
bWrite = False

For sItrDet = 0 To sNumItrDets - 1
    If oSInvce.GetItrDetail(sItrDet, oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, oRegion, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin) And oRegion = reWallonia Then
        Call oSInvce.UpdateItrDetail(sItrDet, oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, reFlanders, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin)
        bWrite = True
    End If
Next

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

VB.NET
 
' Update the region of all Intrastat details of the current document from reWallonia to reFlanders
Dim oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, oRegion, oTransport, oDelivCond, oCommodityCode, oCountry As Object, oCountryOrigin As Object
Dim sNumItrDets As Short
Dim bWrite As Boolean

oSInvce.PrepareDocument(ePrepareAction.paUpdate)

sNumItrDets = oSInvce.GetNumItrDetails()
bWrite = False

For sItrDet As Short = 0 To sNumItrDets - 1
    If oSInvce.GetItrDetail(sItrDet, oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, oRegion, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin) And oRegion = eRegion.reWallonia Then
        oSInvce.UpdateItrDetail(sItrDet, oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, eRegion.reFlanders, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin)
        bWrite = True
    End If
Next
    
If bWrite Then
    oSInvce.WriteDocument(eReportMode.rmFullReport, False, False)
Else
    oSInvce.CancelDocument()
End If