The VAT Summary and the Invoice Trailer

Now that you have customized the individual elements in the invoice, one last customizing task remains: to produce the VAT summary and invoice trailer. The VAT summary and invoice trailer calculations include calculating the totals for the invoice for each of the different VAT rates and grouping the totals by VAT rate. To produce the VAT summary calculations for the invoice, you will use an extended rule to define operations with the Sterling Gentran:Server® proprietary programming language.

There are two sections for extended rules: a declarations section and a statements section. The declarations section is used to declare the names and types of any variables you will use. The statements section is where you define the operations that you want the rule to execute. Within the statements section, you can leave blank lines to visually separate portions of an extended rule. (Blank lines are used more often in complex extended rules, rather than in simple one- or two-line extended rules.) Leaving a blank line does not affect the execution of extended rules.

As you define the operations for the VAT summary calculations, you will enter many lines of rules in the Loop Level Extended Rules dialog. This section describes each of the individual operations that you will define, and explains what you should enter in order to execute each operation.

Note: As an alternative to entered the extended rule yourself, you may copy the extended rule from the example form provided with the tutorial data in the C:\GENSRVNT\TUTORIALS subfolder.

You will define the VAT summary and invoice trailer calculations on the INVOIC group so that the calculations are run when the screen entry translation object users in Sterling Gentran:Server either calculates or saves the file. After Sterling Gentran:Server stores the data in the fields, the system will run the calculations and store them in the appropriate VAT summary and invoice trailer fields. The extended rule will be used with the On Store function so the system will perform the calculations last, after the group is stored.