Formulae used

There are a number of formulae used in the sample specification forms which were installed with your PereSoft Cashbook.

Following is a list of the most common formulae used in the forms and explanation of how and where they are used.

You can also edit the formulae in Crystal Reports where explanations are given for each formula used.

AmountInWords

You will use this formula in your on-line auto cheque and cheque and advices specifications.

It is used to print the amount of the check in words and will fill one or two lines.

StringVar Str := UpperCase (ToWords (Abs ({Batch Header. Total Amount}), {Batch Header. Batch No Decimals}));

NumberVar X := Length (Str);

X := 250 - X;

If X < 1 then X = 1;

If PageNumber = 1 then Str + “ “ + Replicate String (“ “,X) + “.”

else

“**************************VOID**********************”

+

ReplicateString (“ “, 150) + “.”;

AmountInNumbers

You will use this formula to print the cheque amount as an absolute value in numbers in your cheque, advice and cheque and advice specifications.

You can either use the Batch Currency Symbol or the Bank Currency Symbol, but you must use the corresponding number of decimal places.

If PageNumber = 1 then

{@Batch Currency Symbol} + ToText (ToNumber (Abs ({Batch Header. Total Amount}), {Batch Header. Btch No Decimals}) else “********VOID*******”

Cheque Number Init

In this formula, you create a variable which is initialized with the value contained in the “Next Document Number” formula.

You will use this formula to get the next cheque number when printing continuous cheques.

The ‘Next Document Number’ formula is passed by the Cashbook.

Note that this formula is placed in the header and hidden.

If you are printing on-line cheques, do not increment this formula.

 

BeforeReadingRecords;

NumberVar ChequeNo := {@Next Document Number} -1;

Cheque Number

This formula takes the ChequeNo variable created in ‘Cheque Number Init’ and increments it by one, printing the actual cheque number to be used when printing continuous cheques.

Note this formula is not necessary when printing on-line cheques

WhilePrintingRecords;

NumberVar ChequeNo := ChequeNo + 1

Cheque Number Advice

In this formula, you use the ChequeNo variable created in ‘Cheque Number Init’ to print the cheque number in your advices if you are printing in continuous format.

NumberVar ChequeNo - ( PageNumber -1);

Total Tax

This formula will print the total tax amount on your Advices or on Receipts.

The amount is printed as an absolute value with your desired number of decimals.

To prevent the total from being printed on the wrong page, the ‘Number Detail Lines’ formula, which is passed from Cashbook is used to calculate the last page number and then to print the total on the last page only.

NumberVar NoPages := Round (Abs ({Batch Header. Number of Details}) / {@Number Detail Lines} ) , 0 );

if Remainder ({Batch Header. Number of Details},{@Number Detail Lines}) < 5 then NoPages := NoPages + 1;

if {Batch Control. Batch ID} = “999999” then ToText (ToNumber Sum {Batch Detail. Tax Amount},{Batch Detail. Entry Number})), {Batch Header, Btch No Decimals} else if NoPages = PageNumber then

ToText (ToNumber (Sum ({Batch Detail. Tax Amount}, {Batch Detail. Entry Number})), {Batch Header. Btch No Decimals})

else “ “:

Total Amount

You will use this formula to print the total amount on your receipts and advices.

The amount is printed as an absolute value and to prevent the totals from being printed on the wrong page, the ‘Number Detail Lines’ formula is used to calculate the last page number and then to print the total amount.

NumberVar NoPages := Round (Abs ( {Batch Header. Number of Details} / {@Number Detail Lines}), 0);

if Remainder ({Batch Header. Number of Details}, {@Number Detail Lines}) < 5

then NoPages := NoPages +1;

if {Batch Control. Batch ID} = “999999” then

ToText (ToNumber (Sum ({Batch Detail. Tax Amount}, {Batch Detail. Entry Number})), {Batch Header. Btch No Decimals})

else if NoPages = PageNumber then

ToText (ToNumber (Sum ({Batch Detail. Detail Amount}, {Batch Detail. Entry Number}))

else “ “;

Batch Currency Symbol

This field is passed from Cashbook and will print the currency symbol for the batch.

e.g. $

Bank Currency Symbol

This field is passed from the Cashbook and will print the currency symbol for the bank.

e.g. R