gtGLTCodeActBal
Tcode functions allow transactional analysis and quick retrieval of General Ledger Multi-Dimensional information based on any combination of transaction analysis codes used. This function returns the amount for an account and transaction tree branch code combination.
Company
The company code that the account belongs to. Companies with the same currency can be combined by separating them by a comma and space. for example, '01, 09. This adds company 01 and 09's budget actual values together.
AccOrTree
The account number or name of the tree that the period information is to be searched for. The account number may include wildcards — for example, *.*.*.1010 will accumulate everything for all accounts with a 4th segment of 1010.
TCodes
The transaction tree branch code, or series of codes separated by a comma, the information is to be retrieved for. These may be entered into the formula or referenced to cells. If the transaction tree branch codes are listed over several cells, these my be referenced by the cells, concatenated by the & symbol, separated by comma enclosed in quotes.
For example, if the transaction tree branches are held in cells C4, C5, C6 the TCodes parameter to reference all these cells would be: C4&,&C5&,&C6. Note: You cannot report on more than one branch within a single tree. You can report on multiple branches across different trees. A valid MDA combination must exist for the selected tree range.
FromYear
The Year the information is to be found from.
FromPeriod
The period information is accumulated found from. If this parameter is set to 0 then the account's financial year opening balance is included in the result.
ToYear
If not defined, the ToYear defaults to the same as the FromYear. If defined, period information is accumulated between the FromYear and the ToYear.
ToPeriod
If not defined, and ToYear is also not defined, the ToPeriod defaults to the same as the FromPeriod. If not defined and ToYear is defined, the ToPeriod defaults to the same as FromPeriod less one period. If defined, period information is accumulated between the FromPeriod to the ToPeriod. If this parameter is set to 0 then the result returned includes only the account's opening balance for the financial year.
This parameter defaults to 0 if the FromPeriod is 0 and this parameter is omitted from the call. So an easy way of getting just the opening balance for the account is to make the call with only the financial ToYear parameter defined, and the FromPeriod set to 0.
TransType
This is a code that determines what information is returned. Valid codes are:
- A - all financial information is totalled and returned
- D- all debits are totalled and returned
- C- all credits are totalled and returned
- Q- all unit or quantity information is totalled and returned
- AD- all debits are totalled and returned (in Foreign Currency)
- AC- all credits are totalled and returned (in Foreign Currency)
- ADC- all financial information is totalled and returned (in Foreign Currency)
If this is left unspecified, the default is A.
CreditAccount
If True, indicates the account is normally a credit account (for example, revenue accounts) and returns credit balances as a positive number.
TreeBranch
If a TCode is entered, you can restrict the report to a single tree branch code by entering the tree branch here.
Returns
- The general ledger account Tcode balance for the specified period/s
- Error - if an error is encountered
Example
= gtGLTcodeActBal(01,MAS.AK.SLS.1010,AKL,,2002,01)
Errors Returned
- Must have a Company identifier
- Invalid Company identifier
- Must have an Account identifier
- Account does not exist
- TCodes are required
- Must have a FromYear
- FromYear does not exist
- Must have a FromPeriod
- FromPeriod does not exist
- ToYear does not exist
- ToPeriod does not exist
- ToYear is before FromYear
- ToPeriod is before FromPeriod
- TransType can only be A,D,C,Q
- CreditAccount must be True, False or omitted (defaults False)
- Invalid Search String