Data for an invoice or a tariff may have a very complex structure. In order to facilitate such cases, data within the template is split into different groups, called "template components," so that it can be managed separately.
Look at the sample invoice in the picture below:
We can clearly identify a few independent groups of data here:
- Invoice header – this is only present one time in the file, and contains global information.
- Invoice line(s) – groups of data which repeat multiple times in the file, each time with different values.
- Invoice footer – this is only present one time in the file, and contains global information.
Here is another example, this time for a rate download template:
Here we see a single group, Rate data. This is a data group that repeats within the file multiple times though with different values.
Thus there are five possible template components:
Header
A header contains data fields with global data for the object. On an invoice, this would be the invoice number or the name of the company issuing the invoice.
Page Header
This template component is available only for printable forms in which data is split across several pages. Data fields defined in this component are placed at the top of each printed page.
Similar to the Header, this component contains global data for an invoice. Data fields are split between the Header and Fields simply for convenience, with the Header containing the main parameters, while auxiliary parameters are included in Fields. For instance, Fields invoice templates contain such data as the period from date, the period to date, and the due date.
Columns (repeating groups)
This is the most important component, since it describes the variable portion of the data. For example, rate entries all have the same structure and format (phone prefix in the first column, country name in the second, price in the third, etc.). However, there are many such rows in the file, and each row is an independent object. Thus, you define how one single row of data is to be formatted and this is then applied to all rows in the file.
Footer
Contains additional data about the object; for example, invoice totals.
Page Footer
Available only for printable forms; data fields to be placed at the end of each printed page.
Groups
See the Template groups section.