|
Updates an extended accounting detail in the document. |
|
|
void UpdateDetail2 ( SHORT sIndex, DOUBLE dAmountDocC, DOUBLE dQuantity, DOUBLE dValue1, BSTR bsAccount, BSTR bsRemark, BSTR bsText1, DOUBLE dAmountDetC, BSTR bsDetC, LONG lTickSysNum, VARIANT_BOOL bInterCompany, BSTR bsCutOffAccount, DATE dteCutOffStart, DATE dteCutOffEnd ) |
|
|
Parameters | sIndex | [in] The index of the detail, starting from 0. | dAmountDocC | [in] The amount (in document currency) of the detail. | dQuantity | [in] The quantity of the detail. | dValue1 | [in] The free value of the detail. | bsAccount | [in] The account number of the detail. | bsRemark | [in] The remark of the detail. | bsText1 | [in] The free text of the detail. | dAmountDetC | [in] The amount (in detail currency) of the detail. | bsDetC | [in] The currency of the detail. | lTickSysNum | [in] The system number of the detail that is ticked by this line, 0 if nothing is ticked. | bInterCompany | [in] The inter-company flag of the detail. | bsCutOffAccount | [in] The cut off account number of the detail. | dteCutOffStart | [in] The cut off start date of the detail. | dteCutOffEnd | [in] The cut off end date of the detail. | | Remarks |
| If the parameter sIndex is an invalid index (refers to a not existing detail) an exception is thrown. You can use GetDetail to check whether an index is valid, in which case it returns true. |
| If an analytical entry proposal exists for the provided account (parameter bsAccount), the detail is automatically distributed according to this proposal. |
|
|
See Also |
|
|
|
Samples |
|
|
C++ |
|
// Update the remark of the first manual detail of the current document to 'Updated via SDK'
short sManualIndex;
bool bWrite = false;
pSndry->PrepareDocument (paUpdate);
sManualIndex = pSndry->GetManualIndex ();
if (sManualIndex != -1)
{
VARIANT vAmountDocC, vQuantity, vValue1, vAccount, vRemark, vText1, vAmountDetC, vDetC, vTickSysNum, vEntrySysNum, vInterCompany, vCutOffAccount, vCutOffStart, vCutOffEnd;
if (pSndry->GetDetail2 (sManualIndex, &vAmountDocC, &vQuantity, &vValue1, &vAccount, &vRemark, &vText1, &vAmountDetC, &vDetC, &vTickSysNum, &vEntrySysNum, &vInterCompany, &vCutOffAccount, &vCutOffStart, &vCutOffEnd))
{
pSndry->UpdateDetail2 (sManualIndex, vAmountDocC.dblVal, vQuantity.dblVal, vValue1.dblVal, vAccount.bstrVal, "Updated via SDK", vText1.bstrVal, vAmountDetC.dblVal, vDetC.bstrVal, vTickSysNum.lVal, vInterCompany.boolVal, vCutOffAccount.bstrVal, vCutOffStart.date, vCutOffEnd.date);
bWrite = true;
}
}
if (bWrite)
pSndry->WriteDocument (rmFullReport);
else
pSndry->CancelDocument ();
|
|
|
C# |
|
// Update the remark of the first manual detail of the current document to 'Updated via SDK'
short sManualIndex;
bool bWrite = false;
oSndry.PrepareDocument (ePrepareAction.paUpdate);
sManualIndex = oSndry.GetManualIndex ();
if (sManualIndex != -1)
{
object oAmountDocC, oQuantity, oValue1, oAccount, oRemark, oText1, oAmountDetC, oDetC, oTickSysNum, oEntrySysNum, oInterCompany, oCutOffAccount, oCutOffStart, oCutOffEnd;
if (oSndry.GetDetail2 (sManualIndex, out oAmountDocC, out oQuantity, out oValue1, out oAccount, out oRemark, out oText1, out oAmountDetC, out oDetC, out oTickSysNum, out oEntrySysNum, out oInterCompany, out oCutOffAccount, out oCutOffStart, out oCutOffEnd))
{
oSndry.UpdateDetail2 (sManualIndex, (double)oAmountDocC, (double)oQuantity, (double)oValue1, oAccount.ToString (), "Updated via SDK", oText1.ToString (), (double)oAmountDetC, oDetC.ToString (), (int)oTickSysNum, (bool)oInterCompany, oCutOffAccount.ToString (), (DateTime)oCutOffStart, (DateTime)oCutOffEnd);
bWrite = true;
}
}
if (bWrite)
oSndry.WriteDocument (eReportMode.rmFullReport);
else
oSndry.CancelDocument ();
|
|
|
VBS |
|
' Update the remark of the first manual detail of the current document to 'Updated via SDK'
Dim sManualIndex
Dim bWrite
bWrite = False
Call oSndry.PrepareDocument(paUpdate)
sManualIndex = oSndry.GetManualIndex()
If sManualIndex <> -1 Then
Dim oAmountDocC, oQuantity, oValue1, oAccount, oRemark, oText1, oAmountDetC, oDetC, oTickSysNum, oEntrySysNum, oInterCompany, oCutOffAccount, oCutOffStart, oCutOffEnd
If oSndry.GetDetail2(sManualIndex, oAmountDocC, oQuantity, oValue1, oAccount, oRemark, oText1, oAmountDetC, oDetC, oTickSysNum, oEntrySysNum, oInterCompany, oCutOffAccount, oCutOffStart, oCutOffEnd) Then
Call oSndry.UpdateDetail2(sManualIndex, oAmountDocC, oQuantity, oValue1, oAccount, "Updated via SDK", oText1, oAmountDetC, oDetC, oTickSysNum, oInterCompany, oCutOffAccount, oCutOffStart, oCutOffEnd)
bWrite = True
End If
End If
If bWrite Then
Call oSndry.WriteDocument(rmFullReport)
Else
Call oSndry.CancelDocument()
End If
|
|
|
VB.NET |
|
' Update the remark of the first manual detail of the current document to 'Updated via SDK'
Dim sManualIndex As Short
Dim bWrite As Boolean
oSndry.PrepareDocument(ePrepareAction.paUpdate)
sManualIndex = oSndry.GetManualIndex()
bWrite = False
If sManualIndex <> -1 Then
Dim oAmountDocC, oQuantity, oValue1, oAccount, oRemark, oText1, oAmountDetC, oDetC, oTickSysNum, oEntrySysNum, oInterCompany, oCutOffAccount, oCutOffStart, oCutOffEnd As Object
If oSndry.GetDetail2(sManualIndex, oAmountDocC, oQuantity, oValue1, oAccount, oRemark, oText1, oAmountDetC, oDetC, oTickSysNum, oEntrySysNum, oInterCompany, oCutOffAccount, oCutOffStart, oCutOffEnd) Then
oSndry.UpdateDetail2(sManualIndex, oAmountDocC, oQuantity, oValue1, oAccount, "Updated via SDK", oText1, oAmountDetC, oDetC, oTickSysNum, oInterCompany, oCutOffAccount, oCutOffStart, oCutOffEnd)
bWrite = True
End If
End If
If bWrite Then
oSndry.WriteDocument(eReportMode.rmFullReport)
Else
oSndry.CancelDocument()
End If
|
|