|
Updates an analytical detail for one accounting detail and analytical type. |
|
|
void UpdateAnaDetail ( SHORT sAccIndex, SHORT sAnaIndex, enum eAnaEntType eAnaEntType, DOUBLE dAmountDocC, DOUBLE dQuantity, DOUBLE dPercentage, DOUBLE dValue1, BSTR bsAnaAccount, BSTR bsAnaKind, BSTR bsRemark, BSTR bsText1 ) |
|
|
Parameters | sAccIndex | [in] The index of the detail line where the analytical detail line belongs to, starting from 0. | sAnaIndex | [in] The index of the analytical detail line, starting from 0. | eAnaEntType | [in] A value of the 'eAnaEntType' enumeration. | dAmountDocC | [in] The amount (in document currency ) of the analytical detail. | dQuantity | [in] The quantity of the analytical detail. | dPercentage | [in] The percentage that has to be distributed for the analytical detail. | dValue1 | [in] The free value of the analytical detail. | bsAnaAccount | [in] The analytical account of the analytical detail. | bsAnaKind | [in] The analytical kind of the analytical detail. | bsRemark | [in] The remark of the analytical detail. | bsText1 | [in] The free text of the analytical detail. | | Remarks |
| If a value is provided for the parameter dAmountDocC and no value is provided for the parameter dPercentage the percentages is automatically calculated by the SDK. |
| If the parameter sIndex is an invalid index (refers to a not existing analytical detail) an exception is thrown. You can use GetAnaDetail to check whether an index is valid, in which case it returns true. |
|
|
See Also |
|
|
|
Samples |
|
|
C++ |
|
// Update the analytical centre code of all analytical details of all details of the current document from 'CETN' to 'CENT'
VARIANT vAmountDocC, vQuantity, vPercentage, vValue1, vAnaAccount, vAnaKind, vRemark, vText1;
short sNumDetails;
bool bWrite = false;
pSndry->PrepareDocument (paUpdate);
sNumDetails = pSndry->GetNumDetails ();
for (short sDetail = 0; sDetail < sNumDetails; sDetail++)
{
short sNumAnaDets = pSndry->GetNumAnaDetails (sDetail, aetCent);
for (short sAnaDet = 0; sAnaDet < sNumAnaDets; sAnaDet++)
{
if (pSndry->GetAnaDetail (sDetail, sAnaDet, aetCent, &vAmountDocC, &vQuantity, &vPercentage, &vValue1, &vAnaAccount, &vAnaKind, &vRemark, &vText1) && CString (vAnaAccount.bstrVal) == "CETN")
{
pSndry->UpdateAnaDetail (sDetail, sAnaDet, aetCent, vAmountDocC.dblVal, vQuantity.dblVal, vPercentage.dblVal, vValue1.dblVal, "CENT", vAnaKind.bstrVal, vRemark.bstrVal, vText1.bstrVal);
bWrite = true;
}
}
}
if (bWrite)
pSndry->WriteDocument (rmFullReport);
else
pSndry->CancelDocument ();
|
|
|
C# |
|
// Update the analytical centre code of all analytical details of all details of the current document from 'CETN' to 'CENT'
object oAmountDocC, oQuantity, oPercentage, oValue1, oAnaAccount, oAnaKind, oRemark, oText1;
short sNumDetails;
bool bWrite = false;
oSndry.PrepareDocument (ePrepareAction.paUpdate);
sNumDetails = oSndry.GetNumDetails ();
for (short sDetail = 0; sDetail < sNumDetails; sDetail++)
{
short sNumAnaDets = oSndry.GetNumAnaDetails (sDetail, eAnaEntType.aetCent);
for (short sAnaDet = 0; sAnaDet < sNumAnaDets; sAnaDet++)
{
if (oSndry.GetAnaDetail (sDetail, sAnaDet, eAnaEntType.aetCent, out oAmountDocC, out oQuantity, out oPercentage, out oValue1, out oAnaAccount, out oAnaKind, out oRemark, out oText1) && oAnaAccount.ToString () == "CETN")
{
oSndry.UpdateAnaDetail (sDetail, sAnaDet, eAnaEntType.aetCent, (double)oAmountDocC, (double)oQuantity, (double)oPercentage, (double)oValue1, "CENT", oAnaKind.ToString (), oRemark.ToString (), oText1.ToString ());
bWrite = true;
}
}
}
if (bWrite)
oSndry.WriteDocument (eReportMode.rmFullReport);
else
oSndry.CancelDocument ();
|
|
|
VBS |
|
' Update the analytical centre code of all analytical details of all details of the current document from 'CETN' to 'CENT'
Dim oAmountDocC, oQuantity, oPercentage, oValue1, oAnaAccount, oAnaKind, oRemark, oText1
Dim sNumDetails, sDetail
Dim bWrite
Call oSndry.PrepareDocument(paUpdate)
sNumDetails = oSndry.GetNumDetails()
bWrite = False
For sDetail = 0 To sNumDetails - 1
Dim sNumAnaDets, sAnaDet
sNumAnaDets = oSndry.GetNumAnaDetails(sDetail, aetCent)
For sAnaDet = 0 To sNumAnaDets - 1
If oSndry.GetAnaDetail(sDetail, sAnaDet, aetCent, oAmountDocC, oQuantity, oPercentage, oValue1, oAnaAccount, oAnaKind, oRemark, oText1) And oAnaAccount = "CETN" Then
Call oSndry.UpdateAnaDetail(sDetail, sAnaDet, aetCent, oAmountDocC, oQuantity, oPercentage, oValue1, "CENT", oAnaKind, oRemark, oText1)
bWrite = True
End If
Next
Next
If bWrite Then
Call oSndry.WriteDocument(rmFullReport)
Else
Call oSndry.CancelDocument()
End If
|
|
|
VB.NET |
|
' Update the analytical centre code of all analytical details of all details of the current document from 'CETN' to 'CENT'
Dim oAmountDocC, oQuantity, oPercentage, oValue1, oAnaAccount, oAnaKind, oRemark, oText1 As Object
Dim sNumDetails As Short
Dim bWrite As Boolean
oSndry.PrepareDocument(ePrepareAction.paUpdate)
sNumDetails = oSndry.GetNumDetails()
bWrite = False
For sDetail As Short = 0 To sNumDetails - 1
Dim sNumAnaDets As Short
sNumAnaDets = oSndry.GetNumAnaDetails(sDetail, eAnaEntType.aetCent)
For sAnaDet As Short = 0 To sNumAnaDets - 1
If oSndry.GetAnaDetail(sDetail, sAnaDet, eAnaEntType.aetCent, oAmountDocC, oQuantity, oPercentage, oValue1, oAnaAccount, oAnaKind, oRemark, oText1) And oAnaAccount = "CETN" Then
oSndry.UpdateAnaDetail(sDetail, sAnaDet, eAnaEntType.aetCent, oAmountDocC, oQuantity, oPercentage, oValue1, "CENT", oAnaKind, oRemark, oText1)
bWrite = True
End If
Next
Next
If bWrite Then
oSndry.WriteDocument(eReportMode.rmFullReport)
Else
oSndry.CancelDocument()
End If
|
|