|
Inserts a new analytical detail for one accounting detail and analytical type. |
|
|
void InsertAnaDetail ( 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. |
| The parameter sAnaIndex can have the value -1 (sAccIndex must be a valid index!). In this case the new analytical detail is inserted after the existing analytical details. |
| If sIndex refers to an existing index, the new analytical detail is inserted at this index and all following analytical details are moved to the next index. |
|
|
See Also |
|
|
|
Samples |
|
|
C++ |
|
// Insert an analytical centre detail (after the other analytical details) for the first manual detail of the current document
short sManualIndex;
bool bWrite = false;
pPurch->PrepareDocument (paUpdate);
sManualIndex = pPurch->GetManualIndex ();
if (sManualIndex != -1 && pPurch->NeedAnaDistrib (sManualIndex, aetCent))
{
VARIANT vAmountDocC;
if (pPurch->GetDetail (sManualIndex, &vAmountDocC, NULL, NULL, NULL, NULL, NULL))
{
pPurch->InsertAnaDetail (sManualIndex, -1, aetCent, 0.2*vAmountDocC.dblVal, 0.0, 20.0, 0.0, "CENT", "KIND", "Inserted via SDK", "");
bWrite = true;
}
}
if (bWrite)
pPurch->WriteDocument (rmFullReport);
else
pPurch->CancelDocument ();
|
|
|
C# |
|
// Insert an analytical centre detail (after the other analytical details) for the first manual detail of the current document
short sManualIndex;
bool bWrite = false;
oPurch.PrepareDocument (ePrepareAction.paUpdate);
sManualIndex = oPurch.GetManualIndex ();
if (sManualIndex != -1 && oPurch.NeedAnaDistrib (sManualIndex, eAnaEntType.aetCent))
{
object oAmountDocC, oDummy;
if (oPurch.GetDetail (sManualIndex, out oAmountDocC, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy))
{
oPurch.InsertAnaDetail (sManualIndex, -1, eAnaEntType.aetCent, 0.2*((double)oAmountDocC), 0.0, 20.0, 0.0, "CENT", "KIND", "Inserted via SDK", "");
bWrite = true;
}
}
if (bWrite)
oPurch.WriteDocument (eReportMode.rmFullReport);
else
oPurch.CancelDocument ();
|
|
|
VBS |
|
' Insert an analytical centre detail (after the other analytical details) for the first manual detail of the current document
Dim sManualIndex
Dim bWrite
Call oPurch.PrepareDocument(paUpdate)
sManualIndex = oPurch.GetManualIndex()
bWrite = False
If sManualIndex <> -1 And oPurch.NeedAnaDistrib(sManualIndex, aetCent) Then
Dim oAmountDocC, oDummy
If oPurch.GetDetail(sManualIndex, oAmountDocC, oDummy, oDummy, oDummy, oDummy, oDummy) Then
Call oPurch.InsertAnaDetail(sManualIndex, -1, aetCent, oAmountDocC / 5, 0.0, 20.0, 0.0, "CENT", "KIND", "Inserted via SDK", "")
bWrite = True
End If
End If
If bWrite Then
Call oPurch.WriteDocument(rmFullReport)
Else
Call oPurch.CancelDocument()
End If
|
|
|
VB.NET |
|
' Insert an analytical centre detail (after the other analytical details) for the first manual detail of the current document
Dim sManualIndex As Short
Dim bWrite As Boolean
oPurch.PrepareDocument(ePrepareAction.paUpdate)
sManualIndex = oPurch.GetManualIndex()
bWrite = False
If sManualIndex <> -1 And oPurch.NeedAnaDistrib(sManualIndex, eAnaEntType.aetCent) Then
Dim oAmountDocC, oDummy As Object
If oPurch.GetDetail(sManualIndex, oAmountDocC, oDummy, oDummy, oDummy, oDummy, oDummy) Then
oPurch.InsertAnaDetail(sManualIndex, -1, eAnaEntType.aetCent, oAmountDocC / 5, 0.0, 20.0, 0.0, "CENT", "KIND", "Inserted via SDK", "")
bWrite = True
End If
End If
If bWrite Then
oPurch.WriteDocument(eReportMode.rmFullReport)
Else
oPurch.CancelDocument()
End If
|
|