|
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;
pSndry->PrepareDocument (paUpdate);
sManualIndex = pSndry->GetManualIndex ();
if (sManualIndex != -1 && pSndry->NeedAnaDistrib (sManualIndex, aetCent))
{
VARIANT vAmountDocC;
if (pSndry->GetDetail (sManualIndex, &vAmountDocC, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
{
pSndry->InsertAnaDetail (sManualIndex, -1, aetCent, 0.2*vAmountDocC.dblVal, 0.0, 20.0, 0.0, "CENT", "KIND", "Inserted via SDK", "");
bWrite = true;
}
}
if (bWrite)
pSndry->WriteDocument (rmFullReport);
else
pSndry->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;
oSndry.PrepareDocument (ePrepareAction.paUpdate);
sManualIndex = oSndry.GetManualIndex ();
if (sManualIndex != -1 && oSndry.NeedAnaDistrib (sManualIndex, eAnaEntType.aetCent))
{
object oAmountDocC, oDummy;
if (oSndry.GetDetail (sManualIndex, out oAmountDocC, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy))
{
oSndry.InsertAnaDetail (sManualIndex, -1, eAnaEntType.aetCent, 0.2*((double)oAmountDocC), 0.0, 20.0, 0.0, "CENT", "KIND", "Inserted via SDK", "");
bWrite = true;
}
}
if (bWrite)
oSndry.WriteDocument (eReportMode.rmFullReport);
else
oSndry.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 oSndry.PrepareDocument(paUpdate)
sManualIndex = oSndry.GetManualIndex()
bWrite = False
If sManualIndex <> -1 And oSndry.NeedAnaDistrib(sManualIndex, aetCent) Then
Dim oAmountDocC, oDummy
If oSndry.GetDetail(sManualIndex, oAmountDocC, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy) Then
Call oSndry.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 oSndry.WriteDocument(rmFullReport)
Else
Call oSndry.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
oSndry.PrepareDocument(ePrepareAction.paUpdate)
sManualIndex = oSndry.GetManualIndex()
bWrite = False
If sManualIndex <> -1 And oSndry.NeedAnaDistrib(sManualIndex, eAnaEntType.aetCent) Then
Dim oAmountDocC, oDummy As Object
If oSndry.GetDetail(sManualIndex, oAmountDocC, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy) Then
oSndry.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
oSndry.WriteDocument(eReportMode.rmFullReport)
Else
oSndry.CancelDocument()
End If
|
|