Amounts printed in Cashbook can be formatted as per the currency and separated into debit and credit columns.
|
Amount Fields |
You will notice that all currency amounts (dollar values) are expressed as formulae. The reason for this is so that the correct decimal places are printed in the field. If you only ever require your amount fields to print in the default windows format, you do not need to use these formulae. The formulae all have the same format, which as follows: ToText (ToNumber ({field name}),{number of decimals field}) The ToText function prints the amount with the decimal places The ToNumber function removes the Currency Symbol (i.e. R, $) from the amount. The {field name} is the amount field which you are printing. The {number of decimals field} is the number of decimals which you would like to print. This field can be taken from the DecimalsHome parameter or you can use the Bank number of decimals, Miscellaneous number of decimals, Batch number of decimals or Source number of decimals fields. |
|
Debit and Credit Amount Fields.
|
In fields where either a debit or credit amount is printed, we set a condition so that the amount will only print in one column |
|
Debit Example |
CurrencyVar X:= {Amount field}; If X > 0 then ToText (ToNumber (X), {number of decimals field}) else If X = 0 then ToText (ToNumber (0), {number of decimals field}) else “ “ The first line specifies that the currency variable is an amount field (which will be chosen from the file which you are using.) Creating this variable simplifies the formula writing process. The formula then says that if the amount field (X) is greater than zero (a debit) then print the amount with the number of decimals which you require, else if the amount field (X) is equal to zero, then print 0 with the number of decimals required, else if the amount field meets neither of these criteria, then print a blank (“ “). So in effect we are printing all amounts which either have a zero or debit value in this field. |
|
Credit Example |
CurrencyVar X:= {Amount field}; If X < 0 then ToText (ToNumber (Abs (X)), {number of decimals field}) else “ “ In line one, Currency Variable (X) is created to be the amount field from the file which you are using for your report. The formula then sets the condition, that if the amount field (X) is less than zero, the amount must print as an absolute value. (As we are using a debit and credit field, there is no need to print a negative symbol in the field.) Else if this criteria is not met, the formula must print a blank (“ “). |
|
Running Totals |
The formulae are created on the detail line to keep a running total of the amount fields as they are printed. Often these fields are hidden in the detail section, and only the final total is printed. |