Balan::GetBalanceField (Interface: Balan)
 
Gets the balance of account numbers sharing a value in an account field and for a period.
 
DOUBLE GetBalanceField (
    enum eAccntFld eFieldID,
    BSTR bsValue,
    SHORT sBeginMonth,
    SHORT sEndMonth,
    VARIANT* pdblQuantity
)
 
Parameters
eFieldID
[in] Identifier of a general account field, e.g. accfNumber (C++) or eAccntFld.accfNumber (C# / VB.NET), on which the restrictions given in the parameter bsValue have to be applied.
 
Remark: In VBS, this field identifier enumerations cannot be used! You should use GetFieldID to get a valid field identifier.
bsValue
[in] The restriction that the given general account field, of which you want to know the monthly balance, has to meet.
sBeginMonth
[in] The month from when you want to know the balance.
sEndMonth
[in] The month to when you want to know the balance.
pdblQuantity
[out] Returns a VARIANT, subtype DOUBLE containing the quantity that corresponds to the balance.
 
Return value
A DOUBLE containing the balance for the account numbers, of which the given field meets the restrictions defined in the given value, for a given period.
 
Remarks
The parameter bsValue can be a restriction on a string field ("CAPITAL") but also the string representation of restrictions on fields of several other data types i.e. date ("17/09/2009"), time ("15:12:33") and number ("60").
If the parameter bsValue is applied on a string field, the wildcard '*' can be used to take only those fields into account that begin with the characters before the wildcard.
If the parameter bsValue is applied on the field eAccntFld.accfNumber, wildcards '?' and '*' can be used, see GetBalance for more info.
The restriction is tested case sensitive if the parameter bsValue is applied on a string field, otherwise the string representation is converted to the correct data type before testing the restriction.
The month parameters (sBeginMonth and sEndMonth) can have a value from 1 to 25 (a financial year can cover 2 complete calendar years) and if 0 is given for the begin month (the value for the end month is ignored in that case), the balance of the complete financial year is returned.
If you supply an end month that is smaller than the begin month, no exception will be thrown and 0.0 will be returned.
 
See Also
CreateBalan
GetBalance
GetBalanceEx
 
Samples
 
C++
 
VARIANT vQuantity;
double lfBalance;

// Retrieve the balance for the general account with number '4110' for the complete financial year
lfBalance = pBalan->GetBalanceField (accfNumber, "4110", 1, 12, &vQuantity);

// Retrieve the balance for the general accounts with number 1204, 1214, 1224,... for the first month
lfBalance = pBalan->GetBalanceField (accfNumber, "12?4", 1, 1, &vQuantity);

// Retrieve the balance for all general accounts with 10% rejected expenses for the complete financial year
lfBalance = pBalan->GetBalanceField (accfRejected, "10", 0, 0, &vQuantity);

// Retrieve the balance for all general accounts of which the English description starts with 'CAPITAL' for the first quarter
lfBalance = pBalan->GetBalanceField (accfDescrEng, "CAPITAL*", 1, 3, &vQuantity);

// Retrieve the balance for all general accounts that have to be revaluated for the first month
lfBalance = pBalan->GetBalanceField (accfRevaluate, "1", 1, 1, &vQuantity);
lfBalance = pBalan->GetBalanceField (accfRevaluate, "true", 1, 1, &vQuantity);

C#
 
object oQuantity;
double lfBalance;

// Retrieve the balance for the general account with number '4110' for the complete financial year
lfBalance = oBalan.GetBalanceField (eAccntFld.accfNumber, "4110", 1, 12, out oQuantity);

// Retrieve the balance for the general accounts with number 1204, 1214, 1224,... for the first month
lfBalance = oBalan.GetBalanceField (eAccntFld.accfNumber, "12?4", 1, 1, out oQuantity);

// Retrieve the balance for all general accounts with 10% rejected expenses for the complete financial year
lfBalance = oBalan.GetBalanceField (eAccntFld.accfRejected, "10", 0, 0, out oQuantity);

// Retrieve the balance for all general accounts of which the English description starts with 'CAPITAL' for the first quarter
lfBalance = oBalan.GetBalanceField (eAccntFld.accfDescrEng, "CAPITAL*", 1, 3, out oQuantity);

// Retrieve the balance for all general accounts that have to be revaluated for the first month
lfBalance = oBalan.GetBalanceField (eAccntFld.accfRevaluate, "1", 1, 1, out oQuantity);
lfBalance = oBalan.GetBalanceField (eAccntFld.accfRevaluate, "true", 1, 1, out oQuantity);

VBS
 
Dim oQuantity
Dim lfBalance

' Retrieve the balance for the general account with number '4110' for the complete financial year
lfBalance = oBalan.GetBalanceField(oAccnt.GetFieldID("Number"), "4110", 1, 12, oQuantity)

' Retrieve the balance for the general accounts with number 1204, 1214, 1224,... for the first month
lfBalance = oBalan.GetBalanceField(oAccnt.GetFieldID("Number"), "12?4", 1, 1, oQuantity)

' Retrieve the balance for all general accounts with 10% rejected expenses for the complete financial year
lfBalance = oBalan.GetBalanceField(oAccnt.GetFieldID("Rejected"), "10", 0, 0, oQuantity)

' Retrieve the balance for all general accounts of which the English description starts with 'CAPITAL' for the first quarter
lfBalance = oBalan.GetBalanceField(oAccnt.GetFieldID("DescrEng"), "CAPITAL*", 1, 3, oQuantity)

' Retrieve the balance for all general accounts that have to be revaluated for the first month
lfBalance = oBalan.GetBalanceField(oAccnt.GetFieldID("Revaluate"), "1", 1, 1, oQuantity)
lfBalance = oBalan.GetBalanceField(oAccnt.GetFieldID("Revaluate"), "true", 1, 1, oQuantity)

VB.NET
 
Dim oQuantity As Object
Dim lfBalance As Double

' Retrieve the balance for the general account with number '4110' for the complete financial year
lfBalance = oBalan.GetBalanceField(eAccntFld.accfNumber, "4110", 1, 12, oQuantity)

' Retrieve the balance for the general accounts with number 1204, 1214, 1224,... for the first month
lfBalance = oBalan.GetBalanceField(eAccntFld.accfNumber, "12?4", 1, 1, oQuantity)

' Retrieve the balance for all general accounts with 10% rejected expenses for the complete financial year
lfBalance = oBalan.GetBalanceField(eAccntFld.accfRejected, "10", 0, 0, oQuantity)

' Retrieve the balance for all general accounts of which the English description starts with 'CAPITAL' for the first quarter
lfBalance = oBalan.GetBalanceField(eAccntFld.accfDescrEng, "CAPITAL*", 1, 3, oQuantity)

' Retrieve the balance for all general accounts that have to be revaluated for the first month
lfBalance = oBalan.GetBalanceField(eAccntFld.accfRevaluate, "1", 1, 1, oQuantity)
lfBalance = oBalan.GetBalanceField(eAccntFld.accfRevaluate, "true", 1, 1, oQuantity)