Venice
Sales::GetItrDetail
 
Gets an Intrastat detail from the document.
 
VARIANT_BOOL GetItrDetail (
    SHORT sIndex,
    VARIANT* pvAmountDocC,
    VARIANT* pvMass,
    VARIANT* pvSupplUnits,
    VARIANT* pvStatProc,
    VARIANT* pvNatTrans,
    VARIANT* pvRegion,
    VARIANT* pvTransport,
    VARIANT* pvDelivCond,
    VARIANT* pvCommodityCode,
    VARIANT* pvCountry,
    VARIANT* pvCountryOrigin
)
 
Parameters
sIndex
[in] The index of the Intrastat detail, starting from 0.
pvAmountDocC
[out] Returns a VARIANT, subtype DOUBLE, containing the amount (in document currency) of the Intrastat detail.
pvMass
[out] Returns a VARIANT, subtype DOUBLE, containing the mass of the Intrastat detail.
pvSupplUnits
[out] Returns a VARIANT, subtype DOUBLE, containing the supplementary units of the Intrastat detail.
pvStatProc
[out] Returns a VARIANT, subtype BYTE (unsigned char), containing the statistical procedure (eStatProc-enumeration value) of the Intrastat detail.
pvNatTrans
[out] Returns a VARIANT, subtype BYTE (unsigned char), containing the transaction code (eNatTrans-enumeration value) of the Intrastat detail.
pvRegion
[out] Returns a VARIANT, subtype BYTE (unsigned char), containing the region code (eRegion-enumeration value) of the Intrastat detail.
pvTransport
[out] Returns a VARIANT, subtype BYTE (unsigned char), containing the transport code (eTransport-enumeration value) of the Intrastat detail.
pvDelivCond
[out] Returns a VARIANT, subtype BYTE (unsigned char), containing the delivery condition (eDelivCond-enumeration value) of the Intrastat detail.
pvCommodityCode
[out] Returns a VARIANT, subtype BSTR, containing the unformatted commodity code of the Intrastat detail.
pvCountry
[out] Returns a VARIANT, subtype BSTR, containing the country code of the partner of the Intrastat detail.
pvCountryOrigin
[out] Returns a VARIANT, subtype BSTR, containing the country code of origin of the Intrastat detail.
 
Return value
True if the Intrastat detail with the given index exists, otherwise false.
 
See Also
CreateSales
Handling accounting documents using the SDK
PrepareDocument
GetNumItrDetails
CancelDocument
 
Samples
 
C++
 
// Retrieve all Intrastat detail data of the current document
VARIANT vAmountDocC, vMass, vSupplUnits, vStatProc, vNatTrans, vRegion, vTransport, vDelivCond, vCommodityCode, vCountry, vCountryOrigin;
short    sNumItrDets;
eRegion eCurRegion;

pSales->PrepareDocument (paView);

sNumItrDets = pSales->GetNumItrDetails ();

for (short sItrDet = 0; sItrDet < sNumItrDets; sItrDet++)
{
    if (pSales->GetItrDetail (sItrDet, &vAmountDocC, &vMass, &vSupplUnits, &vStatProc, &vNatTrans, &vRegion, &vTransport, &vDelivCond, &vCommodityCode, &vCountry, &vCountryOrigin))
    {
        eCurRegion = (eRegion)vRegion.bVal;
        
        // Process other data
    }
}

pSales->CancelDocument ();

C#
 
// Retrieve all Intrastat detail data of the current document
object oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, oRegion, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin;
short sNumItrDets;
eRegion eCurRegion;

oSales.PrepareDocument (ePrepareAction.paView);

sNumItrDets = oSales.GetNumItrDetails ();

for (short sItrDet = 0; sItrDet < sNumItrDets; sItrDet++)
{
    if (oSales.GetItrDetail (sItrDet, out oAmountDocC, out oMass, out oSupplUnits, out oStatProc, out oNatTrans, out oRegion, out oTransport, out oDelivCond, out oCommodityCode, out oCountry, out oCountryOrigin))
    {
        eCurRegion = (eRegion)((byte)oRegion);
        
        // Process other data
    }
}

oSales.CancelDocument ();

VBS
 
' Retrieve all Intrastat detail data of the current document
Dim oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, oRegion, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin
Dim sItrDet, sNumItrDets

Call oSales.PrepareDocument(paView)

sNumItrDets = oSales.GetNumItrDetails()

For sItrDet = 0 To sNumItrDets -1
    If oSales.GetItrDetail(sItrDet, oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, oRegion, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin) Then
        ' Process data
    End If    
Next

Call oSales.CancelDocument()

VB.NET
 
' Retrieve all Intrastat detail data of the current document
Dim oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, oRegion, oTransport, oDelivCond, oCommodityCode, oCountry As Object, oCountryOrigin As Object
Dim sNumItrDets As Short

oSales.PrepareDocument(ePrepareAction.paView)

sNumItrDets = oSales.GetNumItrDetails()

For sItrDet As Short = 0 To sNumItrDets - 1
    If oSales.GetItrDetail(sItrDet, oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, oRegion, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin) Then
        ' Process data
    End If    
Next

oSales.CancelDocument()