Sales::GetAnaDetail (Interface: Sales)
 
Gets an analytical detail of one accounting detail and analytical type.
 
VARIANT_BOOL GetAnaDetail (
    SHORT sAccIndex,
    SHORT sAnaIndex,
    enum eAnaEntType eAnaEntType,
    VARIANT* pvAmountDocC,
    VARIANT* pvQuantity,
    VARIANT* pvPercentage,
    VARIANT* pvValue1,
    VARIANT* pvAnaAccount,
    VARIANT* pvAnaKind,
    VARIANT* pvRemark,
    VARIANT* pvText1
)
 
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.
pvAmountDocC
[out] Returns a VARIANT, subtype DOUBLE, containing the amount (in document currency ) of the analytical detail.
pvQuantity
[out] Returns a VARIANT, subtype DOUBLE, containing the quantity of the analytical detail.
pvPercentage
[out] Returns a VARIANT, subtype DOUBLE, containing the percentage that is distributed for the analytical detail.
pvValue1
[out] Returns a VARIANT, subtype DOUBLE, containing the free value of the analytical detail.
pvAnaAccount
[out] Returns a VARIANT, subtype BSTR, containing the analytical account of the analytical detail.
pvAnaKind
[out] Returns a VARIANT, subtype BSTR, containing the analytical kind of the analytical detail.
pvRemark
[out] Returns a VARIANT, subtype BSTR, containing the remark of the analytical detail.
pvText1
[out] Returns a VARIANT, subtype BSTR, containing the free text of the analytical detail.
 
Return value
True if the analytical detail with the given index exists, otherwise false.
 
See Also
CreateSales
Handling accounting documents using the SDK
PrepareDocument
GetNumDetails
GetNumAnaDetails
CancelDocument
 
Samples
 
C++
 
// Retrieve all analytical centre detail data of all details of the current document
VARIANT vAmountDocC, vQuantity, vPercentage, vValue1, vAnaAccount, vAnaKind, vRemark, vText1;
short sNumDetails, sNumAnaDets;

pSales->PrepareDocument (paView);

sNumDetails = pSales->GetNumDetails ();

for (short sDetail = 0; sDetail < sNumDetails; sDetail++)
{
    sNumAnaDets = pSales->GetNumAnaDetails (sDetail, aetCent);
    
    for (short sAnaDet = 0; sAnaDet < sNumAnaDets; sAnaDet++)
    {
        if (pSales->GetAnaDetail (sDetail, sAnaDet, aetCent, &vAmountDocC, &vQuantity, &vPercentage, &vValue1, &vAnaAccount, &vAnaKind, &vRemark, &vText1))
        {
            // Process data
        }
    }
}

pSales->CancelDocument ();

C#
 
// Retrieve all analytical centre detail data of all details of the current document
object oAmountDocC, oQuantity, oPercentage, oValue1, oAnaAccount, oAnaKind, oRemark, oText1;
short sNumDetails, sNumAnaDets;

oSales.PrepareDocument (ePrepareAction.paView);

sNumDetails = oSales.GetNumDetails ();

for (short sDetail = 0; sDetail < sNumDetails; sDetail++)
{
    sNumAnaDets = oSales.GetNumAnaDetails (sDetail, eAnaEntType.aetCent);
    
    for (short sAnaDet = 0; sAnaDet < sNumAnaDets; sAnaDet++)
    {
        if (oSales.GetAnaDetail (sDetail, sAnaDet, eAnaEntType.aetCent, out oAmountDocC, out oQuantity, out oPercentage, out oValue1, out oAnaAccount, out oAnaKind, out oRemark, out oText1))
        {
            // Process data
        }
    }
}

oSales.CancelDocument ();

VBS
 
' Retrieve all analytical centre detail data of all details of the current document
Dim oAmountDocC, oQuantity, oPercentage, oValue1, oAnaAccount, oAnaKind, oRemark, oText1
Dim sDetail, sAnaDet, sNumDetails, sNumAnaDets

Call oSales.PrepareDocument(paView)

sNumDetails = oSales.GetNumDetails()

For sDetail = 0 To sNumDetails - 1
    sNumAnaDets = oSales.GetNumAnaDetails(sDetail, aetCent)
    
    For sAnaDet = 0 To sNumAnaDets - 1
        If oSales.GetAnaDetail(sDetail, sAnaDet, aetCent, oAmountDocC, oQuantity, oPercentage, oValue1, oAnaAccount, oAnaKind, oRemark, oText1) Then
            ' Process data
        End If
    Next
Next

Call oSales.CancelDocument()

VB.NET
 
' Retrieve all analytical centre detail data of all details of the current document
Dim oAmountDocC, oQuantity, oPercentage, oValue1, oAnaAccount, oAnaKind, oRemark, oText1 As Object
Dim sNumDetails, sNumAnaDets As Short

oSales.PrepareDocument(ePrepareAction.paView)

sNumDetails = oSales.GetNumDetails()

For sDetail As Short = 0 To sNumDetails - 1
    sNumAnaDets = oSales.GetNumAnaDetails(sDetail, eAnaEntType.aetCent)
    
    For sAnaDet As Short = 0 To sNumAnaDets - 1
        If oSales.GetAnaDetail(sDetail, sAnaDet, eAnaEntType.aetCent, oAmountDocC, oQuantity, oPercentage, oValue1, oAnaAccount, oAnaKind, oRemark, oText1) Then
            ' Process data            
        End If
    Next
Next

oSales.CancelDocument()