MYOB Greentree

HideShow

  • Contents
  • Index
  • Search
 
Display results with all search words

 

gtGLActBal


This function call, in its simplest form, retrieves GL Account period balances, but can provide summarised balances using tree branch information or account searches.

Company

The company code, or codes, that the period end balances are to be retrieved from. Wildcards can be used instead to return accumulated values from all companies as long as they have the same calendars and base currencies, for example, *, or a string of company codes can be entered — for example, 01, 03.

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.

TreeBranch

The tree branch name. This is left empty (null) if an account is being referenced.

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, then 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, but the 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. Using this feature the opening balance for the account can be retrieved by specifying the FromYear parameter and setting the FromPeriod to 0.

TransType

This 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

If this is left unspecified, the default is A.

ForeignCurrency

If True, returns the balance in the account's foreign currency. If this is left unspecified the default is false, which means the accounts local currency balance is retrieved.

CreditAccount

If True, indicates the account is normally a credit account (for example, revenue accounts) and returns credit balances as a positive number.

Search

If it contains anything then this may be a string denoting filtering options — for example:

= MAS.AK.SLS.* or > MAS.AK.SLS.1010,< MAS.AK.SLS.2000

The comma works as a logical and (OR's are not supported). Neither > nor < work with wildcards (*).

Note: When using the search function, you must put a space after the equal sign, regardless of whether using a wildcarded or a valid segment.

Returns

  • The general ledger account balance for the specified period/s
  • Error - if an error is encountered

Examples

= gtGLActBal(01, 02,MAS.AK.SLS.1010,,2003,April)

= gtGLActBal(*,MAS.AK.SLS.5020,,2003,0,2003,August)

= gtGLActBal(01,Profit and Loss,Advertising,2003,August,2003,August,,,,*.AK.FTY.*)

Errors Returned

  • Must have a Company identifier
  • Invalid Company identifier
  • Must have an Account or Tree identifier
  • Account does not exist
  • Tree does not exist
  • Tree Branch does not exist
  • 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
  • Invalid TransType code only A, D, C or Q is allowed
  • Invalid Search String