Configuring Invoice Templates Manager¶
Extension setting¶
The extension has one setting. You find it on the extension's settings page: Extensions, then edit InvoiceTemplates.
| Setting | Type | Default | What it does |
|---|---|---|---|
| Default invoice template | Select, optional | Empty | The template used for all invoice PDFs. The list shows every active template, sorted by name. |
The list is empty until the database table exists and holds at least one active template.
Which template is used¶
Each time Paymenter generates an invoice PDF, the extension picks a template in this order:
- The template chosen in Default invoice template, if it is active.
- Otherwise the template with Default Template switched on, if it is active.
- Otherwise no template. Paymenter generates the PDF with its own layout.
So the setting wins over the Default Template flag. An inactive template is never used, even if it is selected or flagged as default.
Template fields¶
Templates are managed under Invoice Templates > Templates. The create and edit forms have these fields.
| Field | Type | Default | What it does |
|---|---|---|---|
| Template Name | Text, required, up to 255 characters | Empty | The name shown in the list and in the Default invoice template setting. |
| Description | Text, up to 255 characters | Empty | A note for admins. The list shows the first 50 characters. |
| Template Content (HTML) | Text area, required | Empty | The full HTML document of the invoice, with placeholders. See the placeholder reference. |
| Upload HTML file (optional) | File upload | Empty | Accepts files of type text/html or text/plain. When you save, the file's content replaces Template Content (HTML) and the uploaded file is deleted. |
| Active | Toggle | On | Only active templates can be used for PDFs and appear in the Default invoice template setting. |
| Default Template | Toggle | Off | Flags this template as the default. When you save a template with this switched on, the flag is removed from all other templates. |
Permissions¶
The extension adds four permissions. Assign them when you edit a role in Paymenter. Roles with all permissions have them automatically.
| Permission | Label | Allows |
|---|---|---|
admin.invoicetemplates.templates.view |
View invoice templates | Seeing the Templates list and opening templates |
admin.invoicetemplates.templates.create |
Create invoice templates | Creating templates |
admin.invoicetemplates.templates.update |
Update invoice templates | Editing templates |
admin.invoicetemplates.templates.delete |
Delete invoice templates | Deleting one or several templates |
Changing the Default invoice template setting is done on Paymenter's extension settings page and follows Paymenter's own extension permissions, not the four above.
Fixed behaviour¶
These values are set in the code and cannot be changed in the admin area:
- Paper size is A4, portrait.
- Dates are printed as
YYYY-MM-DD. - The logo is scaled down to fit 360 x 104 pixels before it is embedded, and displayed at up to 180 x 52 pixels.