brainX

Templates

Package: BASIC

1. General

Info

The Templates module is used to create and manage PDF and Email templates.

  • PDF templates are used when generating PDF files.
  • Email templates can be used when composing emails.

The following template types can be created and managed in the Templates module:

  • PDF Templates → PDF template tied to a specific module. Placeholders from the main module and linked modules can be used.
  • Header Templates → Header template in which only general placeholders can be used. These templates can be loaded when creating PDF templates.
  • Footer Templates → Footer template in which only general placeholders can be used. These templates can be loaded when creating PDF templates.
  • Email Templates → Email template with optional module binding. These templates can be loaded when composing new emails. Module binding allows the use of extensive placeholders.
Note

There are no configuration options for the Templates module in Module Management.

Example – PDF Template for Invoices

A company creates a PDF template for the Invoices module with a company logo, header and footer templates, and a Swiss QR Bill for Swiss customers. The template is set as the default template and is automatically pre-selected during PDF export.

Example – Email Template for Deals

A sales employee regularly sends standardized offer emails. They create an email template with module binding to Deals so that when the template is loaded, placeholders such as customer name and offer amount are automatically filled in.

2. List View

The list view in the Templates module has the usual functionalities of a list view. For more detailed information, see the section Structure/Layout – List View.

2.1. Actions

In the list view, general actions are available depending on the module. An overview and description of all general actions can be found in the section Actions (List View).

The following module-specific actions are also available:

ActionPrerequisiteFunctionality
Manage FontsnoneOpens the Font Management popup, where fonts for PDF templates and PDF export can be stored and managed — see Manage Fonts.
Add Header TemplatenoneOpens the creation view for a new header template. Header templates can be loaded during PDF export and support only general placeholders — see Add Header Template.
Add Footer TemplatenoneOpens the creation view for a new footer template. Footer templates can be loaded during PDF export and support only general placeholders — see Add Footer Template.
Import TemplatenoneEnables the import of a template previously exported from another brainX system — see Import Template.

2.1.1. Manage Fonts

To be able to use any fonts when creating templates and for the PDF export of records, a font management feature is integrated into the Templates module.
This makes it very easy to add new fonts for PDF export. The fonts managed here only apply to PDF templates in the Templates module and do not affect the rest of the brainX system.

After clicking the Manage Fonts action, the "Font Management" popup opens.

listenansicht_aktion_schriftarten_verwalten_popup.pngFont Management popup

The popup has the following functionalities:

2.1.1.1. Search Font

Input field for searching among already installed fonts.

2.1.1.2. Add Font

After clicking the "Add Font" button, the "Add Font" popup opens.

listenansicht_aktion_schriftarten_verwalten_popup_schriftart_hinzufuegen.pngAdd Font popup

In the popup, the font name must be entered and the font file(s) uploaded. By clicking the "Add" button, the user confirms that they hold the rights to the font. To ensure support in both the browser and during export, the font must be uploaded as both a .ttf and a .woff file.

2.1.1.3. Font List View

The list view provides all relevant information about the available fonts.

listenansicht_aktion_schriftarten_verwalten_popup.pngFont Management popup

Fonts can be sorted via the left column of the list using Drag & Drop. This sorting determines the order of font selection in the PDF template editor.

To preview a font, the font name in the list is displayed formatted in that font.

Which variants of a font have been uploaded is visible in the column of the same name. When uploading a font, the system automatically tries to detect the variants based on the file name. If this fails, a corresponding label can be set afterwards via editing.
It is recommended to upload a font file for each variant that will be used in the export. If a font is not available in the desired variant, the export attempts to simulate it — which usually does not produce the desired result.

The "Variants" column shows the total number of files uploaded for a font.

2.1.2. Add Header Template

Info

A header is an area at the top of a page that can contain information such as the document title, date, author or page number. The header appears on every page of the document, making it look more organized and professional.

Header templates can be loaded during PDF export. Only general placeholders can be used in header templates.

The creation of a header template is described in detail in the section Header Templates.

Info

A footer is the area at the bottom of each page, analogous to the header. All information placed in this area also appears uniformly on all pages of the document.

Footer templates can be loaded during PDF export. Only general placeholders can be used in footer templates.

The creation of a footer template is described in detail in the section Footer Templates.

2.1.4. Import Template

If a template is to be transferred from another brainX system, it can be imported via the "Import Template" action.

See also the section Export Template.

3. Detail View

3.1. Fields

The following tables describe required fields and fields with non-obvious functions. All other fields are self-explanatory.

Note

Templates can be assigned to a tenant. The optional "Tenant" field is available in the "System Data" block. If no tenant is set, the template is displayed system-wide. If a tenant is set, the template is only displayed when the user is in this tenant or a superordinate tenant.

Note

Depending on the type of template (PDF template, header/footer template or email template), the fields in the "Template Information" block differ.

Template Information Block – All Templates

FieldDescription
Template Name *Name of the template
Template Module *Main module the template refers to
ActiveMarks the template as active or inactive. Inactive templates cannot be selected during PDF export.
Language
  • Deutsch
  • English
  • Francais
  • Italian
  • Spanish

*Required field

Template Information Block – PDF Templates, Header & Footer Templates

The "Template Information" block has additional fields for PDF templates, header and footer templates.

FieldDescription
Default Template for This ModuleSets the template as the default template for the selected module.
Default Export FolderFolder to which the generated PDF file is exported – see Manage Directories.
Consider Page Breaks in Line Item GroupsToggle on (active) → Page breaks inserted in the template are taken into account when generating the PDF. Toggle off (inactive) → Page breaks inserted in the template are not taken into account when generating the PDF.
QR InvoiceToggle on (active) → A QR payment slip is appended to the generated PDF file when the invoice recipient has a Swiss address. For more information, see the section Swiss QR Bill.
QR Invoice DescriptionToggle on (active) → The description is added as additional information in the QR payment slip. Prerequisite: The "Description" field in the "Additional Information" block is filled in the source record. For more information, see the section Swiss QR Bill.

Document Settings Block

Note

The "Document Settings" block is only displayed in the detail view, not in the creation view!

All document settings are configured in the template layout.

FieldDescription
FormatFormat of the generated PDF file (A3, A4, A5, A6, Letter, Legal).
OrientationOrientation of the PDF file when generated (portrait or landscape).
Top MarginTop page margin
Bottom MarginBottom page margin
Left MarginLeft page margin
Right MarginRight page margin
HeaderHeader spacing
FooterFooter spacing

*Required field

Template Block

In the "Template" block, a preview of the template including all placeholders is displayed in the detail view.

3.2. Actions

After clicking the "Actions" button, the following actions are available:

ActionPrerequisiteFunctionality
Export TemplatenoneExports the template for transfer to another brainX system.
CopynoneCreates a copy of the current template. Name, module, language and description must be saved before further adjustments can be made.
Generate PreviewnoneGenerates a PDF preview of the template based on a selectable record from the main module.
DeletenoneDeletes the template and moves it to the Recycle Bin.

vorlagen_detailansicht_button_aktionen_flyout_menue.pngActions flyout menu

3.2.1. Export Template

If a template is to be transferred to another brainX system, it can be exported from the detail view and then imported into the target system via List View → Actions → Import Template.

3.2.2. Copy

To simplify the creation of multiple templates with a similar layout, templates can be copied. As when creating a new template, name, module, language and description must first be saved before further settings can be adjusted.

The module can only be changed after the record has been created. When changing the module, a confirmation prompt appears. If confirmed, all module-specific placeholders are removed from the layout and the layout and module are saved immediately. This action cannot be undone!

3.2.3. Generate Preview

The "Generate Preview" action provides the option to display the PDF file in a preview before export, to check the layout and content in advance.

After clicking the action, a popup opens in which a record from the module defined as the main module can be selected. After clicking the record title, the PDF preview is generated and displayed in a new browser tab.

3.2.4. Delete

After clicking the "Delete" action, a confirmation prompt is displayed. If confirmed, the template is deleted from the Templates module and moved to the Recycle Bin module.

4. Swiss QR Bill

When generating PDF files for the Invoices module, there is a special feature for invoice recipients based in Switzerland.

All domestic and foreign companies that work with Swiss companies must be able to receive (creditors) or send (debtors) a QR code.

Info Swiss QR Bill

A QR invoice is an invoice with a payment section and receipt that replaces the previous orange and red payment slips in Switzerland. The payment section contains the Swiss QR Code, which includes all relevant information required for both invoicing and payment.

On October 1, 2022, the red and orange payment slips were abolished and fully replaced by the QR invoice. Since then, all invoices must contain a QR code that can be scanned with a smartphone, PC camera or a special scanner by the recipient to process the payment. This simplifies payment, offers additional security and reduces transfer errors.

qr_zahlungsschein.png

The prerequisite for generating a PDF file that contains a QR code is entering the bank details of your own company. These must be entered in Global Settings – Basic Setup – Company Information – Client in the "Bank Details" block.

In addition to the standard fields Bank Name, Sort Code, Account No., IBAN and BIC, the fields SCOR, QR IBAN and BESR ID must be filled in under Company Information.

SCOR (Creditor Reference per ISO 11649):
This is a 25-character alphanumeric reference starting with RF, followed by 2 check digits calculated in the same way as IBAN check digits.

SCOR is required when your company's registered address is not in Switzerland. The IBAN is also mandatory for the Swiss QR Bill.

QR IBAN:
The QR IBAN is a variant of the account number (IBAN). It replaces the ESR participant number as a process identifier and is required for the invoice type "QR Reference". It is also the identification feature of the process that ensures the structured reference is always included when paying a QR invoice.

Only required when the company is based in Switzerland.

BESR ID:
BESR stands for "BankEinzahlungsSchein mit Referenznummer" (bank payment slip with reference number). The BESR ID consists of a 6-digit individual number specifically assigned to an account, forming the leading digits of the reference number.

Only required when the company is based in Switzerland and the account is NOT held at "Post Finance".

Note

A QR invoice is only generated if the invoice currency is Euro or Swiss Franc! For all other currencies, the PDF generation fails.

In this case, the following error message is displayed: "PDF generation failed: The currency of the record is neither Euro nor Swiss Franc."

5. Visibility of Records and Field Values During Export

Templates can generally be used by multiple users.

Field values of the placeholders used in templates are only displayed during export if the executing user also has permission to view the corresponding fields and modules!

Info

Roles: Roles can be used to control the visibility of records within a module.

Warning

If a referenced record is not visible to the user performing the export, the placeholders from that record are replaced with an empty value!

Info

Profiles: Profiles can be used to control the visibility of individual fields of a record.

Warning

If a field is not visible to the user performing the export, the placeholder for that field is replaced with an empty value.

6. Practical Examples

1 – Creating a PDF Template for Invoices with Header and Footer

A company wants to generate professional invoice PDFs with a company logo, a consistent header and a footer with contact details and bank information. In the Templates module, a header template and a footer template are first created with general placeholders. A PDF template for the Invoices module is then created and both templates are embedded in it.

The Default Template for This Module toggle is activated so that the template is automatically pre-selected during PDF export. For customers with a Swiss address, the QR Invoice toggle is also enabled — when generating the PDF, a Swiss QR Bill payment slip is automatically appended. The Generate Preview action is used to check the template against a real invoice record before it is used in production.

2 – Email Template for Deals with Module-Bound Placeholders

A sales employee regularly sends standardized offer emails in which customer name, offer amount and closing date should be filled in individually. In the Templates module, a new email template with module binding to Deals is created.

Placeholders for the relevant fields of the Deals module are inserted into the template — e.g., customer name, offer amount and closing date. When composing a new email from a deal, the template can be selected via Load Template — all placeholders are automatically filled with the values of the respective deal record. This saves the employee time and ensures consistent communication.

3 – Exporting a Template from One brainX System and Importing It Into Another

A company operates two brainX instances — a test instance and a production instance. An elaborately designed invoice template is to be transferred from the test instance to the production instance after successful testing.

In the test instance, the template is saved as an export file from the detail view via the Export Template action. In the production instance, the exported file is imported in the Templates module via the list view action Import Template. The template is then fully available with all settings and layout in the production instance.

7. Frequently Asked Questions

What is the difference between a PDF template, a header template and an email template?

A PDF template is tied to a specific module and allows the use of extensive module-specific placeholders. Header and footer templates can be embedded in PDF templates but only support general placeholders. An email template can optionally be bound to a module — with module binding, extensive placeholders are available; without binding, only general ones.

How can I set a template as the default template?

In the fields of a PDF template, there is the Default Template for This Module toggle. When activated, this template is automatically pre-selected during PDF export for the respective module. One template per module can be defined as the default.

What happens if a placeholder references a record that the exporting user is not allowed to see?

If a referenced record or a field is not visible to the exporting user due to role or profile restrictions, the corresponding placeholder in the PDF is replaced with an empty value. The permissions of the executing user determine which field values appear in the export.

When is a Swiss QR Bill appended to the PDF file?

The QR payment slip is automatically appended when the QR Invoice toggle is enabled in the PDF template, the invoice recipient has a Swiss address and the invoice currency is Euro or Swiss Franc. It also requires that the bank details of the company are correctly stored in Global Settings – Company Information.

Can I use custom fonts for PDF templates?

Yes. Via the list view action Manage Fonts, custom fonts in .ttf and .woff format can be uploaded and used for PDF templates and PDF export. The stored fonts only apply to the template system and do not affect the rest of the brainX system.

Can I transfer a template between two brainX instances?

Yes. Via the Export Template action in the detail view, the template is saved as an export file. In the target instance, it can be imported via the list view action Import Template — including all layout settings and placeholders.