Venice
AnCnt::GetBalanceEx
 
Gets the balance of this Analytical Centre Account (extended).
 
DOUBLE GetBalanceEx (
    BSTR bsAccount,
    BSTR bsCentre,
    BSTR bsKind,
    DATE dStartDate,
    DATE dEndDate
)
 
Parameters
bsAccount
[in] The general account of which you want to know the balance.
bsCentre
[in] The analytical centre of which you want to know the balance.
bsKind
[in] The analytical kind of which you want to know the balance.
dStartDate
[in] The start date of the period for which you want to know the balance.
dEndDate
[in] The end date of the period for which you want to know the balance.
 
Return value
A DOUBLE containing the balance of the given analytical centre.
 
Remarks
If bsAccount is left blank, then the balance for all general accounts is returned.
If bsCentre is left blank, then the balance for all analytical centres is returned.
If bsKind is left blank, then the balance for all analytical kinds is returned.
In this case, the wildcard '*' can be used in the parameter bsCentre to take only those analytical centres into account that begin with the characters before the wildcard.
If dStartDate and dEndDate are left blank, then the balance for the complete financial year is returned.
If the given dates are not included in the financial year, a balance of 0 is returned.
The amount that is not distributed analytically is excluded from the returned balance.
 
See Also
CreateAnCnt
AnCnt.GetBalance
AnAcc.GetBalance
 
Samples
 
C++
 
COleDateTime odtStartDate, odtEndDate;
double lfBalance;

// Get the balance of the analytical centre with code = 'CENT' limited to general account '600', all analytical kinds and the month of January
odtStartDate.SetDate (2024, 1, 1);
odtEndDate.SetDate (2024, 1, 31);
lfBalance = pAnCnt->GetBalanceEx ("600", "CENT", "", odtStartDate, odtEndDate);

// Get the balance of the analytical centre with code = 'CENT' limited to all general accounts, analytical kind 'KIND' and the complete financial year
lfBalance = pAnCnt->GetBalanceEx ("", "CENT", "KIND", COleDateTime (0, 0, 0, 0, 0, 0).m_dt, COleDateTime (0, 0, 0, 0, 0, 0).m_dt);

// Get the balance of all analytical centres, limited to all general accounts, analytical kind 'KIND' en the first quarter of the financial year
odtStartDate.SetDate (2024, 1, 1);
odtEndDate.SetDate (2024, 3, 31);
lfBalance = pAnCnt->GetBalanceEx ("", "", "KIND", odtStartDate, odtEndDate);

// Get the balance of all analytical centres, limited to all general accounts, all analytical kinds and the complete financial year
lfBalance = pAnCnt->GetBalanceEx ("", "", "", COleDateTime (0, 0, 0, 0, 0, 0).m_dt, COleDateTime (0, 0, 0, 0, 0, 0).m_dt);

C#
 
DateTime dtStartDate, dtEndDate;
double lfBalance;

// Get the balance of the analytical centre with code = 'CENT' limited to general account '600', all analytical kinds and the month of January
dtStartDate = new DateTime (2024, 1, 1);
dtEndDate = new DateTime (2024, 1, 31);
lfBalance = oAnCnt.GetBalanceEx ("600", "CENT", "", dtStartDate, dtEndDate);

// Get the balance of the analytical centre with code = 'CENT' limited to all general accounts, analytical kind 'KIND' and the complete financial year
lfBalance = oAnCnt.GetBalanceEx ("", "CENT", "KIND", new DateTime (), new DateTime ());

// Get the balance of all analytical centres, limited to all general accounts, analytical kind 'KIND' en the first quarter of the financial year
dtStartDate = new DateTime (2024, 1, 1);
dtEndDate = new DateTime (2024, 3, 31);
lfBalance = oAnCnt.GetBalanceEx ("", "", "KIND", dtStartDate, dtEndDate);

// Get the balance of all analytical centres, limited to all general accounts, all analytical kinds and the complete financial year
lfBalance = oAnCnt.GetBalanceEx ("", "", "", new DateTime (), new DateTime ());

VBS
 
Dim lfBalance
Dim dtStartDate, dtEndDate

' Get the balance of all analytical centres, limited to all general accounts, all analytical kinds and the complete financial year
lfBalance = oAnCnt.GetBalanceEx("", "", "", dtStartDate, dtEndDate)

' Get the balance of the analytical centre with code = 'CENT' limited to all general accounts, analytical kind 'KIND' and the complete financial year
lfBalance = oAnCnt.GetBalanceEx("", "CENT", "KIND", dtStartDate, dtEndDate)

' Get the balance of the analytical centre with code = 'CENT' limited to general account '600', all analytical kinds and the month of January
dtStartDate = #1/1/2024#
dtEndDate = #1/31/2024#
lfBalance = oAnCnt.GetBalanceEx("600", "CENT", "", dtStartDate, dtEndDate)

' Get the balance of all analytical centres, limited to all general accounts, analytical kind 'KIND' en the first quarter of the financial year
dtStartDate = #1/1/2024#
dtEndDate = #3/31/2024#
lfBalance = oAnCnt.GetBalanceEx("", "", "KIND", dtStartDate, dtEndDate)

VB.NET
 
Dim lfBalance As Double
Dim dtStartDate, dtEndDate As Date

' Get the balance of all analytical centres, limited to all general accounts, all analytical kinds and the complete financial year
lfBalance = oAnCnt.GetBalanceEx("", "", "", dtStartDate, dtEndDate)

' Get the balance of the analytical centre with code = 'CENT' limited to all general accounts, analytical kind 'KIND' and the complete financial year
lfBalance = oAnCnt.GetBalanceEx("", "CENT", "KIND", dtStartDate, dtEndDate)

' Get the balance of the analytical centre with code = 'CENT' limited to general account '600', all analytical kinds and the month of January
dtStartDate = #1/1/2024#
dtEndDate = #1/31/2024#
lfBalance = oAnCnt.GetBalanceEx("600", "CENT", "", dtStartDate, dtEndDate)

' Get the balance of all analytical centres, limited to all general accounts, analytical kind 'KIND' en the first quarter of the financial year
dtStartDate = #1/1/2024#
dtEndDate = #3/31/2024#
lfBalance = oAnCnt.GetBalanceEx("", "", "KIND", dtStartDate, dtEndDate)