Finan::DeleteAnaDetail (Interface: Finan)
 
Deletes an analytical detail of one accounting detail and analytical type.
 
void DeleteAnaDetail (
    SHORT sAccIndex,
    SHORT sAnaIndex,
    enum eAnaEntType eAnaEntType
)
 
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.
 
Remarks
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
CreateFinan
Handling accounting documents using the SDK
PrepareDocument
GetManualIndex
GetNumAnaDetails
WriteDocument
CancelDocument
 
Samples
 
C++
 
// Remove all the analytical centre details of the first manual detail of the current document
short sManualIndex;
bool bWrite = false;

pFinan->PrepareDocument (paUpdate);

sManualIndex = pFinan->GetManualIndex ();

if (sManualIndex != -1)
{
    short sNumAnaDets = pFinan->GetNumAnaDetails (sManualIndex, aetCent);
    
    if (sNumAnaDets != 0)
    {
        for (short sAnaDet = sNumAnaDets - 1; sAnaDet >= 0; sAnaDet--)
        {
            pFinan->DeleteAnaDetail (sManualIndex, sAnaDet, aetCent);
        }
        
        bWrite = true;
    }
}
    
if (bWrite)
    pFinan->WriteDocument (rmFullReport);
else    
    pFinan->CancelDocument ();

C#
 
// Remove all the analytical centre details of the first manual detail of the current document
short sManualIndex;
bool bWrite = false;

oFinan.PrepareDocument (ePrepareAction.paUpdate);

sManualIndex = oFinan.GetManualIndex ();

if (sManualIndex != -1)
{
    short sNumAnaDets = oFinan.GetNumAnaDetails (sManualIndex, eAnaEntType.aetCent);
    
    if (sNumAnaDets != 0)
    {
        for (short sAnaDet = (short)(sNumAnaDets - 1); sAnaDet >= 0; sAnaDet--)
        {
            oFinan.DeleteAnaDetail (sManualIndex, sAnaDet, eAnaEntType.aetCent);
        }
        
        bWrite = true;
    }
}

if (bWrite)
    oFinan.WriteDocument (eReportMode.rmFullReport);
else    
    oFinan.CancelDocument ();

VBS
 
' Remove all the analytical centre details of the first manual detail of the current document
Dim sManualIndex
Dim bWrite

Call oFinan.PrepareDocument(paUpdate)

sManualIndex = oFinan.GetManualIndex()
bWrite = False

If sManualIndex <> -1 Then
    Dim sNumAnaDets, sAnaDet
    
    sNumAnaDets = oFinan.GetNumAnaDetails(sManualIndex, aetCent)
    
    If sNumAnaDets <> 0 Then
        For sAnaDet = sNumAnaDets - 1 To 0 Step -1
            Call oFinan.DeleteAnaDetail(sManualIndex, sAnaDet, aetCent)
        Next
        
        bWrite = True
    End If
End If

If bWrite Then
    Call oFinan.WriteDocument(rmFullReport)
Else
    Call oFinan.CancelDocument()
End If

VB.NET
 
' Remove all the analytical centre details of the first manual detail of the current document
Dim sManualIndex As Short
Dim bWrite As Boolean

oFinan.PrepareDocument(ePrepareAction.paUpdate)

sManualIndex = oFinan.GetManualIndex()
bWrite = True

If sManualIndex <> -1 Then
    Dim sNumAnaDets As Short
    
    sNumAnaDets = oFinan.GetNumAnaDetails(sManualIndex, eAnaEntType.aetCent)
    
    If sNumAnaDets <> 0 Then
        For sAnaDet As Short = sNumAnaDets - 1 To 0 Step -1
            oFinan.DeleteAnaDetail(sManualIndex, sAnaDet, eAnaEntType.aetCent)
        Next
    End If
End If

If bWrite Then
    oFinan.WriteDocument(eReportMode.rmFullReport)
Else
    oFinan.CancelDocument()
End If