|
Updates an Intrastat detail in the document. |
|
|
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 |
|
|
|
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;
pSales->PrepareDocument (paUpdate);
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) && (eRegion)vRegion.bVal == reWallonia)
{
pSales->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)
pSales->WriteDocument (rmFullReport);
else
pSales->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;
oSales.PrepareDocument (ePrepareAction.paUpdate);
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) && (eRegion)((byte)oRegion) == eRegion.reWallonia)
{
oSales.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)
oSales.WriteDocument (eReportMode.rmFullReport);
else
oSales.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 oSales.PrepareDocument(paUpdate)
sNumItrDets = oSales.GetNumItrDetails()
bWrite = False
For sItrDet = 0 To sNumItrDets - 1
If oSales.GetItrDetail(sItrDet, oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, oRegion, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin) And oRegion = reWallonia Then
Call oSales.UpdateItrDetail(sItrDet, oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, reFlanders, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin)
bWrite = True
End If
Next
If bWrite Then
Call oSales.WriteDocument(rmFullReport)
Else
Call oSales.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
oSales.PrepareDocument(ePrepareAction.paUpdate)
sNumItrDets = oSales.GetNumItrDetails()
bWrite = False
For sItrDet As Short = 0 To sNumItrDets - 1
If oSales.GetItrDetail(sItrDet, oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, oRegion, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin) And oRegion = eRegion.reWallonia Then
oSales.UpdateItrDetail(sItrDet, oAmountDocC, oMass, oSupplUnits, oStatProc, oNatTrans, eRegion.reFlanders, oTransport, oDelivCond, oCommodityCode, oCountry, oCountryOrigin)
bWrite = True
End If
Next
If bWrite Then
oSales.WriteDocument(eReportMode.rmFullReport)
Else
oSales.CancelDocument()
End If
|
|