Language:


Tax Reports - The Tax Reports Setting

Use this setting to define the tax calculation formulae that will be used in your custom reports. Each record in this setting contains a complete report definition.

To enter a new Tax Report definition or to edit an existing one, first open the 'Settings' list by clicking the [Settings] button in the Master Control panel or using the Ctrl-S/⌘-S keyboard shortcut. Double-click 'Tax Reports' in the list. The 'Tax Reports: Browse' window is displayed, showing all Tax Report definitions previously entered. Double-click a record in the list to edit it, or add a new record by clicking the [New] button in the Button Bar. When the record is complete, save it by clicking the [Save] button in the Button Bar or by clicking the close box and choosing to save changes. To close it without saving changes, click the close box.

Code
The unique code identifying this Tax Report record (i.e. this set of report definitions).

Name
Enter a name for the Tax Report record to be shown in the 'Tax Records: Browse' window and the 'Paste Special' list: it should therefore be descriptive enough to make the selection of the correct Tax Report record easy for all users.

Delimiter
Specify the character that you will use to separate the parameters in the formula commands. It is recommended that you use the semi colon (;). This has been used in the illustration above and in the examples below. Do not use the colon (:) because this is used to separate the first and last Accounts in a range.

If you leave this field empty, you should use the comma to separate the parameters in the formula commands. But this may produce unexpected (and incorrect) results if you are using the comma as the Thousands, Decimal or Date Separator in the Company Date and Numeric Formats setting in the System module (or, if you are using them, in the Client Date and Numeric Formats setting in the User Settings module or on the 'Date and Numbers' card of the user's Person record). If you are using the comma as the Thousands, Decimal or Date Separator, make sure you enter a different character here as the Delimiter, and that you use that character to separate the parameters in the formula commands.
Enter the report definitions (formulae) in the grid. Do not include any spaces in the formulae.

Flip A

Code
A unique Code identifying each row.

You should use this Code to refer to the row in other formulae (i.e. in other rows), when it must be preceded by the # character. #SALES and #TAXPERC in row 3 of the illustration are examples, referring to rows 1 and 2 respectively. The Code referred to must already have been defined. Therefore, in the example illustration, the TAXSUM row must appear below the SALES and TAXPERC rows. If you place the TAXSUM row above the SALES and TAXPERC rows, the result of the TAXSUM row will be 0.00. # is alt-3 on the UK Macintosh keyboard.

Formula
The formula used to calculate the value of this row.

Comment
The name of this row of the report, to be shown in the Tax Calculations report. You can choose to omit rows without a Comment from this report.
Flip B
Format
You can specify a format to be used when the result of the formula is printed. You must specifying separate formatting rules for positive numbers, zero and negative numbers, in that order, separated by semi-colons (;). For example:
#,###.##;0.00;(#,###.##)
# ###$;0$;-# ###$
####;zero;(-####)

If you do not specify a format, the decimal and thousands separators will be taken from the Date and Numeric Format setting, and the following format will be used:

#,###.##;0.00;-#,###.##

If you specify a Format, you then have a choice whether to use it when you print the Tax Calculations report. If you want to use it, use the Use Format option when you print the report. However, the Format will always be used in the Tax Report document.

Several commands are available for use in the Formula field. They are not case sensitive. Use the Delimiter character to separate the parameters in each command.
TO(Account Code;Date 1;Date 2;Type)
This command returns the net change between Date 1 and Date 2 for the specified Account.

Use the Type parameter as follows:
C
returns the net change resulting from credit postings to the specified Account

D
returns the net change resulting from debit postings to the specified Account

A
returns the overall net change (Debit - Credit)

Some examples of the use of this command are as follows:
TO(100;01/01/2007;31/12/2007;C)
Returns the sum of the credit postings to Account 100 for the year 2007.

TO(100:1999;01/01/2007;31/12/2007;A)
Returns the sum of the net changes in Accounts 100 to 1999 for the year 2007. The Account range is determined using an alpha sort, rather than a numeric one. Thus Account 1000001 will be included in the example range, while Account 200 will not.

-TO(100:1999;01/01/2007;31/12/2007;A)
As the previous example, but the sign of the final figure is changed. This is useful when displaying figures for sales, which are stored as negative figures in HansaWorld Enterprise. Prefixing the TO command with a minus sign will cause sales to be displayed as positive figures in the report.

OTO(Object Code;Account Code;Date 1;Date 2;Type)
This command is similar to TO, but in calculating the net change during the period for the specified Account, only postings with the specified Object Code are taken into account.

The reference to the Object Code is case sensitive. For example:
OTO(A;100;01/01/2007;31/12/2007;C)
Returns the sum of the credit postings with Object A to Account 100 for the year 2007. Credit postings with Object A will not be included.

VTO(VAT Code;Account Code;Date 1;Date 2;Type)
This command is similar to TO, but in calculating the net change during the period for the specified Account, only postings with the specified VAT Code are taken into account.

The reference to the VAT Code is case sensitive.

TO2(Account Code 1;Account Code 2;Date 1;Date 2)
This command returns the net change between two Accounts (i.e. between two corresponding Accounts) between Date 1 and Date 2. For example:
TO2(750;100;01/01/2007;31/12/2007)
Returns the sum of the postings during the year 2007 where Account 750 is the debit Account and 100 is the corresponding credit Account.

TO2(750;100:1999;01/01/2007;31/12/2007)
Returns the sum of the postings during the year 2007 where Account 750 is the debit Account and any Account between 100 and 1999 is the corresponding credit Account.

OTO2(Object Code;Account Code 1;Account Code 2;Date 1;Date 2)
This command is similar to TO2, but in calculating the net change between the corresponding Accounts, only double-sided postings where the specified Object Code is used on both sides are taken into account.

The reference to the Object Code is case sensitive.

BAL(Account Code;Date;Type)
This command returns the balance for the specified Account on the specified Date. It therefore differs from the TO command in that balances brought forward from previous periods are taken into account.

The command can return the sum of the balances of a range of Accounts in the same manner as the TO command: please refer to the description of the TO command above for examples.

OBAL(Object Code;Account Code;Date;Type)
This command is similar to BAL, but in calculating the balance for the specified Account on the specified date, only postings with the specified Object Code are taken into account.

VBAL(VAT Code;Account Code;Date;Type)
This command is similar to BAL, but in calculating the balance for the specified Account on the specified date, only postings with the specified VAT Code are taken into account.

ABS(expression)
This command returns the absolute (positive) value of the expression. The expression can be a hard-coded number or a formula using one of the Tax Report commands. For example:
ABS(-1)
Returns 1

ABS(1)
Returns 1

ABS(TO(100:1999;01/01/2007;31/12/2007;A))
Returns the sum of the net changes in the income Accounts 100 to 1999 for the year 2007, expressed as a positive figure. Balances for income Accounts are stored as negative figures in HansaWorld Enterprise.

SIGN(expression)
This command returns the following:
1
if the value of the expression is positive

-1
if the value of the expression is negative

0
the value of the expression is zero

The expression can be a hard-coded number or a formula using one of the Tax Report commands. For example:
SIGN(TO(100:1999;01/01/2007;31/12/2007;A))
Returns -1 since the balances of income Accounts are negative

SIGN(ABS(TO(100:1999;01/01/2007;31/12/2007;A)))
Returns 1, since the ABS command expresses the balances of income Accounts as positive figures

ROUND(expression;number of decimal places)
This command returns the value of the expression rounded to the specified number of decimal places. The expression can be a hard-coded number or a formula using one of the Tax Report commands. For example:
ROUND(1234.24;0)
Returns 1234

ROUND(1234.24;1)
Returns 1234.2

ROUND(1234.24;-2)
Returns 1200

ROUND(TO(100:1999;01/01/2007;31/12/2007;A);2)
Returns the sum of the net changes in the income Accounts 100 to 1999 for the year 2007, rounded to two decimal places.

IF(expression;return 1;return 2)
This command returns the following:
return 1
if the value of the expression is positive or zero

return 2
if the value of the expression is negative

The expression, return 1 and return 2 can all be hard-coded numbers or formulae using one of the Tax Report commands. For example:
IF(BAL(100;31/12/2007;A);1;-1)
Returns 1 if BAL(100;31/12/2007;A) is positive or -1 if it is negative

NOT(expression)
Returns 1 if the value of the expression is 0 or 1 otherwise.

APDUE(Number of days;Date 1)
This command returns the total in the Purchase Ledger that is overdue for payment by the specified number of days on Date 1. For example, APDUE(20;31/12/2007) will return the total that became due 20 days or more before 31/12/2007.

ARDUE(Number of days;Date 1)
This command is the Sales Ledger equivalent of APDUE above.

Dates
If you need to include a date in a formula, you can hard-code it as in the examples above, or, preferably, you can use one of the following variables:
#D1
The first date of the report period, as entered in the report or document specification window.

#D2
The last date of the report period, as entered in the report or document specification window.

#D3, #D4
The Previous Dates, as entered in the report or document specification window. You could use these two dates, for example, to define a period whose figures are to be compared with the main report period (#D1 and #D2).

It is recommended that you use these variables, to ensure that you can use your formulae at any time without modification.

For example, to print the closing balance for Account 100 for the report period 1/1/2007:31/12/2007, you could hard-code the date in the formula as follows:
BAL(100;31/12/2007;A)

Alternatively, you could take the date from the report period, as follows:
BAL(100;#D2;A)