SettingsOrganisation

Template editor writing guide

A practical guide to customising your document templates in Phasio

You don't need to be a developer to customise your templates. This guide covers inserting data, showing or hiding fields, and building custom tables for parts and expenses.

The fastest way to get a custom template is to use an agent to help write the HTML

Try asking

  • Create an invoice with logo on the left and company details on the right.
  • Build a parts table showing thumbnail, name, dimensions, and quantity.
  • Add a PO number row that only shows when a PO number is set.
  • Build a Group Traveller with a routing matrix showing which workflow steps each part goes through.

Start from the default

Every template comes pre-filled with a working layout. Open the Source tab to edit the HTML directly, or use the Visual tab for click-to-edit formatting.

Custom Document, Group Traveller, and Order Traveller templates start with a fully annotated starter template — it includes a page header, footer, logo, and a parts table with comments explaining each section. Edit it to match your layout and branding.

Invoice templates start with a short starter layout: a heading, your company name, the invoice date and order number, the customer and addresses, a parts table, expenses and the total.

⚠️ Do not remove xmlns:th="http://www.thymeleaf.org" from the <html> tag — it enables all variable and conditional features. Standard HTML5 is supported; no strict XHTML syntax required.


Insert a variable

Click Variables in the toolbar to browse and insert any variable — it is placed at your cursor automatically with the correct syntax. The picker shows a short description for each variable.

To type a variable directly in the Source tab:

[(${VARIABLE_NAME})]

Example:

<p>Order: [(${ORDER_NUMBER})]</p>
<p>Customer: [(${CUSTOMER_NAME})]</p>
<p>Total: [(${FINAL_PRICE})]</p>

Variable reference

Your company

VariableWhat it inserts
LOGO_IMGYour company logo — pre-rendered <img> tag on standard templates; raw base64 on custom templates (see Using the logo)
OPERATOR_NAMEYour company name
OPERATOR_EMAILYour company email
OPERATOR_PHONEYour company phone
OPERATOR_LOCATIONYour company location
PAYMENT_INFORMATIONBank / payment details
OPERATOR_NOTESNotes added to the order

Order

VariableWhat it inserts
ORDER_NUMBEROrder number
QUOTE_NUMBERQuote number associated with the order
ORDER_DATEDate the order was placed
ESTIMATE_DATEDate the quote was sent
CONFIRMATION_DATEDate the customer confirmed
PAYMENT_DATEDate payment was received
TARGET_DELIVERY_DATEEstimated delivery date
TARGET_LEAD_TIMESame value as TARGET_DELIVERY_DATE. Works on Order Invoice, Order Estimate, Order Confirmation, Traveller Sheet, and Custom Document. The variable menu lists it only on Order Invoice and Custom Document. Not available on Invoice
PURCHASE_ORDER_NUMBERCustomer's PO number
ORDER_OWNEREmail address of the person who placed the order
ORDER_OWNER_NAMEFull name of the person who placed the order (blank if not available)
SHIPPING_METHODShipping method selected for the order
INCOTERMICC 2020 Incoterm code of the order's shipping, if one is set (e.g. DAP). Available on Order Invoice, Order Estimate, Order Confirmation, Traveller Sheet, Consignment Label, Custom Document, and Invoice. On Order Traveller, use order.incoterm inside ORDERS
CUSTOM_REFERENCECustom reference number set on the order

Customer

VariableWhat it inserts
CUSTOMER_NAMECustomer organisation name
TAX_CODECustomer's tax code, taken from their billing address (previously GST_NUMBER, which still works)
CUSTOMER_IDCustomer contact name
PAYMENT_TERMSPayment terms assigned to the customer (account customers only — e.g. Net 30)
CUSTOMERRaw customer object — access individual fields (see below)
BILLING_ADDRESSPre-formatted billing address block
BILLING_ADDRESS_DATARaw billing address — access individual fields (see below)
SHIPPING_ADDRESSPre-formatted shipping address block
SHIPPING_ADDRESS_DATARaw shipping address — access individual fields (see below)

CUSTOMER fields: CUSTOMER.organisationName, CUSTOMER.firstName, CUSTOMER.lastName, CUSTOMER.email, CUSTOMER.phone, CUSTOMER.metadata (key-value map of custom organisation metadata fields)

BILLING_ADDRESS_DATA / SHIPPING_ADDRESS_DATA fields: street1, street2, city, state, country, zip, name, company, email, phone

<!-- Use the pre-formatted block for a quick address block -->
<td th:utext="${BILLING_ADDRESS}"></td>

<!-- Or access individual fields for a custom layout -->
<td>
  <div th:text="${BILLING_ADDRESS_DATA.name}"></div>
  <div th:text="${BILLING_ADDRESS_DATA.street1}"></div>
  <div th:text="${BILLING_ADDRESS_DATA.city + ', ' + BILLING_ADDRESS_DATA.country}"></div>
</td>

<!-- Access a custom metadata field by key (use th:if to guard against missing keys) -->
<div th:if="${CUSTOMER.metadata != null and CUSTOMER.metadata.containsKey('account_number')}">
  Account #: [(${CUSTOMER.metadata['account_number']})]
</div>

Pricing

VariableWhat it inserts
SUB_TOTALParts total before extras
SHIPPING_FEEShipping charge
DISCOUNTDiscount amount
DISCOUNT_PERCENTAGEDiscount percentage
TAXESPre-rendered tax rows — wrap in a <table> (see below)
PRICE_BEFORE_TAXTotal before tax
FINAL_PRICETotal amount due
TOP_UP_PRICETop-up to reach minimum order
LINE_ITEM_NAMESPricing line item names (pre-rendered HTML)
LINE_ITEM_PRICESPricing line item amounts (pre-rendered HTML)
CURRENCYOrder currency code (e.g. USD)
CURRENCY_SYMBOLOrder currency symbol (e.g. $)

Accounting integration

These variables are available when an accounting integration (Bexio, Xero, LexOffice, Weclapp, Zoho, etc.) is connected and a reference has been synced for the order. They are blank when no integration is active or the order has not yet been pushed to the accounting system.

VariableWhat it inserts
ACCOUNTING_INVOICE_NUMBERInvoice reference number from the accounting system
ACCOUNTING_ESTIMATE_NUMBEREstimate reference number from the accounting system
ACCOUNTING_CONFIRMATION_NUMBERConfirmation reference number from the accounting system

Available on: Order Invoice, Order Estimate, Order Confirmation, Traveller Sheet, Custom Document, and per-order inside ORDERS on Order Traveller templates.

Use th:if to show the reference only when it exists:

<p th:if="${ACCOUNTING_INVOICE_NUMBER}">
  Invoice ref: [(${ACCOUNTING_INVOICE_NUMBER})]
</p>

On an Order Traveller, access the reference per order:

<span th:if="${order.accountingInvoiceNumber != null}"
      th:text="${order.accountingInvoiceNumber}"></span>

Parts and expenses

VariableWhat it inserts
PARTS_TABLEBuilt-in parts table (ready to drop in) — includes a Unit Price column
PARTSParts list — iterate to build your own table (see below). Each part has: name, technology, material, quantity, volume, surfaceArea (also available as area — same value), length, width, height, thumbnailImg, color, postProcessings, infill (nullable), precision (nullable), unitPrice (nullable), currency (nullable), customerArticleReference (nullable — customer's article reference for the part), metadata (the part specification's metadata, see below)
EXPENSES_TABLEBuilt-in expenses table (ready to drop in)
EXPENSESExpenses list — iterate to build your own table (see below)

Consignment Label

Consignment Label templates can now use the Order, Customer, and Your company variables above for order-identification data: CUSTOMER, CUSTOMER_ID, BILLING_ADDRESS/BILLING_ADDRESS_DATA, SHIPPING_ADDRESS/SHIPPING_ADDRESS_DATA, TAX_CODE, CUSTOM_REFERENCE, and OPERATOR_NAME/OPERATOR_LOCATION/OPERATOR_EMAIL/OPERATOR_PHONE — alongside its existing ORDER_NUMBER, QUOTE_NUMBER, ORDER_OWNER, ORDER_OWNER_NAME, ORDER_DATE, SHIPPING_METHOD, INCOTERM, and LOGO_IMG.

Consignment Label has no Pricing or Accounting integration variables and no EXPENSES/EXPENSES_TABLE/TAXES — a shipping label has no reason to show a price breakdown. Its PARTS list also carries identification fields only (name, quantity, technology, material, length, width, height, color, thumbnailImg, postProcessings, infill, precision, customerArticleReference) — no unitPrice, volume, area/surfaceArea, shrinkWrapVolume, or minimumWallThickness.

Invoice

Invoice templates use their own variable set. Several values are structured objects instead of pre-rendered text.

VariableWhat it inserts
INVOICE_DATEDate the invoice PDF was generated
ORDER_NUMBER, QUOTE_NUMBER, PURCHASE_ORDER_NUMBER, CUSTOM_REFERENCE, SHIPPING_METHOD, INCOTERM, PAYMENT_TERMS, OPERATOR_NOTESSame as on the order documents above
ORDER_DATE, PAYMENT_DATE, TARGET_DELIVERY_DATEDates in yyyy-MM-dd format, blank when not set
LOGO_IMGYour company logo as a raw base64 string. Use th:src (see Using the logo)
PAYMENT_INFORMATIONList of payment details, each with name and value
ORDER_OWNERObject for the person who placed the order: ORDER_OWNER.name and ORDER_OWNER.email (each nullable)
CUSTOMERCustomer object, for example CUSTOMER.organisationName
OPERATORYour company: OPERATOR.name, OPERATOR.location, OPERATOR.email, OPERATOR.phone
ACCOUNTINGReferences from the connected accounting system: ACCOUNTING.invoiceNumber, ACCOUNTING.estimateNumber, ACCOUNTING.confirmationNumber (each nullable)
BILLING_ADDRESS / SHIPPING_ADDRESSRaw address objects, for example BILLING_ADDRESS.street1 and BILLING_ADDRESS.city. They are not pre-formatted blocks on Invoice templates
PARTSParts list, for example part.name, part.quantity and part.processingPrice
EXPENSESExpenses list, for example expense.name and expense.price
PRICINGPrice breakdown: currency, subTotal, priceBeforeTax, shippingFee, totalTax, totalTaxPercentage, topUpPrice (nullable), finalPrice, discount (nullable, with discount.percentage and discount.netAmount), taxes, lineItems
<p th:text="${OPERATOR != null ? OPERATOR.name : ''}"></p>
<p th:if="${BILLING_ADDRESS != null}" th:text="${BILLING_ADDRESS.street1 + ', ' + BILLING_ADDRESS.city}"></p>
<p th:if="${PRICING != null}" th:text="${PRICING.currency + ' ' + PRICING.finalPrice}"></p>

Production (Group Traveller only)

VariableWhat it inserts
COMPANY_LOGO / LOGO_IMGCompany logo — raw base64 string, either name works (see Using the logo)
GROUP_NAMEProduction group name
GROUP_DATEDate the group was created
MACHINEMachine used
MATERIALMaterial used
MATERIAL_BATCHBatch identifier
DUE_DATEGroup due date
EXPORT_DATEDate the document was generated
LINE_ITEMSParts list — iterate to list parts in the group. Each item has: partName, customerName, quantity, thumbnailImg, purchaseOrderNumber, orderNumber, technology (nullable), unitPrice (nullable), currency (nullable), material (nullable), color (nullable), postProcessings, infill (nullable), precision (nullable), volume (nullable), area (nullable, also available as surfaceArea — same value), height (nullable), width (nullable), length (nullable), shrinkWrapVolume (nullable), minimumWallThickness (nullable), instructions (list of { text, operationName } — internal production instructions, see Print production instructions)
ALL_WORKFLOW_STEPSList of all workflow step names
LINE_ITEMS_WITH_MAPSParts paired with workflow step data — use to build routing tables. Each entry exposes .lineItem (full part object, including .technology), .stepMap, .unitPrice (nullable shortcut), .currency (nullable shortcut), .technology (nullable shortcut), plus the same physical-attribute shortcuts as LINE_ITEMS above (.material, .color, .postProcessings, .infill, .precision, .volume, .area/.surfaceArea, .height, .width, .length, .shrinkWrapVolume, .minimumWallThickness), and .instructions (also available as .lineItem.instructions)

Orders (Order Traveller only)

VariableWhat it inserts
COMPANY_LOGO / LOGO_IMGCompany logo — raw base64 string, either name works (see Using the logo)
EXPORT_DATEDate the document was generated
GROUP_NAMEProduction group name (e.g. BUILD-2025-001) — set when the traveller is downloaded from a production step; blank when downloaded directly from an order
ORDERSList of orders — iterate over each order with its parts and totals. Each order has: orderNumber, orderDate, customerName, taxCode, billingAddress, shippingAddress, shippingMethod (nullable), purchaseOrderNumber, finalPrice (nullable), formattedFinalPrice (nullable — pre-formatted, currency-symbol-prefixed price string), currency, ownerName (nullable), billingAddressData (nullable — raw address object alongside the formatted billingAddress string), shippingAddressData (nullable — raw address object alongside the formatted shippingAddress string), accountingInvoiceNumber (nullable), accountingEstimateNumber (nullable), accountingConfirmationNumber (nullable), allWorkflowSteps, lineItemsWithMaps. Each entry in lineItemsWithMaps exposes .lineItem (full part object, including .technology and unitPrice/currency fields), .stepMap, .unitPrice (shortcut), .currency (shortcut), plus the same physical-attribute shortcuts as Group Traveller's LINE_ITEMS_WITH_MAPS above and .instructions (also available as .lineItem.instructions)

LOGO_IMG behaves differently depending on the template type:

Standard templates (Order Invoice, Order Estimate, Order Confirmation, Traveller Sheet, Consignment Label) — LOGO_IMG is a pre-rendered <img> tag from the server. Output it directly:

<!-- In a table cell -->
<td th:utext="${LOGO_IMG}"></td>

<!-- Inline -->
[(${LOGO_IMG})]

Custom templates (Custom Document, Group Traveller, Order Traveller) — LOGO_IMG and COMPANY_LOGO are raw base64 strings. Use th:src with a pipe expression:

<img th:if="${LOGO_IMG != null and !#strings.isEmpty(LOGO_IMG)}"
     th:src="|data:image/png;base64,${LOGO_IMG}|"
     style="max-height: 40px; width: auto;"
     alt="" />

⚠️ Don't build the src by concatenating strings with + (e.g. ${'data:image/png;base64,' + LOGO_IMG}). Large base64 images can exceed Thymeleaf's expression length limit and fail to render. Always use the pipe (|...|) syntax shown above.


Show a field only when it has a value

Use th:if to hide a block when the variable is empty. This is useful for optional fields like PO number or notes.

<p th:if="${PURCHASE_ORDER_NUMBER}">
  PO: [(${PURCHASE_ORDER_NUMBER})]
</p>

<p th:if="${OPERATOR_NOTES}">
  Notes: [(${OPERATOR_NOTES})]
</p>

This works on any element — <p>, <div>, <tr>, and so on.

Visual indicator: In the Visual tab, elements with th:if show a blue outline and label so you can see them at a glance without reading the source.


Using taxes

TAXES is a pre-rendered HTML block — not a plain value you can inline like FINAL_PRICE. It outputs one <tr> per tax component applied to the order. Each row has three cells:

CellContent
1 (empty)Spacer
2Tax short name + percentage — e.g. VAT (10%)
3Formatted tax amount — e.g. $125.00

Because TAXES outputs <tr> elements, you must wrap it in a <table> and use [(\${TAXES})] (unescaped output):

<table style="width: 100%;">
  [(${TAXES})]
</table>

Use th:if="${TAXES}" to hide the block entirely when no taxes are configured on the order:

<table th:if="${TAXES}" style="width: 100%;">
  [(${TAXES})]
</table>

A typical use is inside a totals summary table alongside SUB_TOTAL and FINAL_PRICE. Because TAXES outputs <tr> rows, it slots directly between the other rows:

<table style="width: 50%; margin-left: auto;">
  <tr>
    <td>Subtotal</td>
    <td style="text-align: right;">[(${SUB_TOTAL})]</td>
  </tr>
  <tr>
    <td>Shipping</td>
    <td style="text-align: right;">[(${SHIPPING_FEE})]</td>
  </tr>
  [(${TAXES})]
  <tr>
    <td><strong>Total</strong></td>
    <td style="text-align: right;"><strong>[(${FINAL_PRICE})]</strong></td>
  </tr>
</table>

ℹ️ TAXES is only available on Order Invoice, Order Estimate, Order Confirmation, and Custom Document templates. It is not set on Traveller or Consignment Label templates.


Build a custom parts table

Use PARTS to build your own layout. Each part has: name, technology, material, color, quantity, unitPrice, processingPrice, thumbnailImg (raw base64), postProcessings (a list with name and price), infill (nullable string — e.g. "20%"), precision (nullable string — e.g. "Standard"), and physical dimensions: volume (mm³), height, width, length (mm), area (mm², also available as surfaceArea — same value). shrinkWrapVolume and minimumWallThickness are available on Pro and Factory Floor plans. customerArticleReference (nullable string) is the customer's article reference for the part — use th:if to show it only when present.

<table style="width: 100%; border-collapse: collapse;">
  <thead>
    <tr>
      <th style="text-align: left; padding: 6px;">Part</th>
      <th style="text-align: left; padding: 6px;">Material</th>
      <th style="text-align: left; padding: 6px;">Colour</th>
      <th style="text-align: left; padding: 6px;">Size</th>
      <th style="text-align: right; padding: 6px;">Qty</th>
      <th style="text-align: right; padding: 6px;">Total</th>
    </tr>
  </thead>
  <tbody>
    <tr th:each="part : ${PARTS}">
      <td style="padding: 6px;">[(${part.name})]</td>
      <td style="padding: 6px;">[(${part.technology})], [(${part.material})]</td>
      <td style="padding: 6px;" th:text="${part.color}"></td>
      <td style="padding: 6px;">[(${part.width})] × [(${part.height})] × [(${part.length})] mm</td>
      <td style="text-align: right; padding: 6px;">[(${part.quantity})]</td>
      <td style="text-align: right; padding: 6px;">[(${part.processingPrice})]</td>
    </tr>
  </tbody>
</table>

To include a thumbnail image:

<img th:if="${part.thumbnailImg != null and !#strings.isEmpty(part.thumbnailImg)}"
     th:src="|data:image/png;base64,${part.thumbnailImg}|"
     style="max-width: 40px; max-height: 40px;" alt="" />

Visual indicator: In the Visual tab, rows with th:each show an amber outline and label so loop blocks are easy to spot.

Show part specification metadata

Every document type with part lines can show the metadata of each part's specification, using the same key-value shape as CUSTOMER.metadata. Read a key with part.metadata['KEY'], which also works for keys with spaces. The Variables picker lists metadata['KEY'] on each parts list. Replace KEY with your metadata key.

A missing key prints null when joined onto other text, so guard it:

<td style="padding: 6px;" th:text="'ERP no: ' + (${part.metadata['ERP no']} ?: '')"></td>

In travellers, metadata is on each LINE_ITEMS item and each LINE_ITEMS_WITH_MAPS entry, and on each entry of an order's lineItemsWithMaps.


Build a custom expenses table

Use EXPENSES to build your own layout. Each expense has name, description, price, and type (FIXED or HOURLY). Hourly expenses also have ratePerHour and hours.

<table style="width: 100%; border-collapse: collapse;">
  <tr th:each="expense : ${EXPENSES}">
    <td style="padding: 6px;">
      [(${expense.name})]
      <div th:if="${expense.description != null and !#strings.isEmpty(expense.description)}"
           style="font-size: 0.9em; color: #666;">
        [(${expense.description})]
      </div>
    </td>
    <td style="padding: 6px;" th:if="${expense.type.name() == 'HOURLY'}">
      [(${expense.hours})] hrs × [(${expense.ratePerHour})]
    </td>
    <td style="text-align: right; padding: 6px;">[(${expense.price})]</td>
  </tr>
</table>

Group Traveller — parts and workflow routing

Use LINE_ITEMS to list parts in the group. Each item has: partName, customerName, quantity, thumbnailImg, purchaseOrderNumber, orderNumber, unitPrice (nullable), currency (nullable), and physical attributes material, color, postProcessings, infill, precision, volume, area (also available as surfaceArea), height, width, length, shrinkWrapVolume, and minimumWallThickness (all nullable).

Use LINE_ITEMS_WITH_MAPS and ALL_WORKFLOW_STEPS together to build a routing matrix — rows are parts, columns are workflow steps. Each entry also exposes .unitPrice and .currency shortcuts for easy price rendering:

<table style="width: 100%; border-collapse: collapse;">
  <thead>
    <tr>
      <th style="text-align: left; padding: 6px;">Part</th>
      <th style="text-align: right; padding: 6px;">Unit Price</th>
      <th th:each="step : ${ALL_WORKFLOW_STEPS}" style="padding: 6px; text-align: center;">
        [(${step})]
      </th>
    </tr>
  </thead>
  <tbody>
    <tr th:each="entry : ${LINE_ITEMS_WITH_MAPS}">
      <td style="padding: 6px;">[(${entry['lineItem'].partName})]</td>
      <td style="padding: 6px; text-align: right; white-space: nowrap;">
        <span th:if="${entry.unitPrice != null}"
              th:text="${(entry.currency != null and entry.currency != '') ? entry.currency + ' ' : ''} + ${#numbers.formatDecimal(entry.unitPrice, 1, 'COMMA', 2, 'POINT')}"></span>
        <span th:if="${entry.unitPrice == null}">—</span>
      </td>
      <td th:each="step : ${ALL_WORKFLOW_STEPS}" style="padding: 6px; text-align: center;">
        <span th:if="${entry['stepMap'].containsKey(step) and entry['stepMap'].get(step).completed}">✓</span>
        <span th:unless="${entry['stepMap'].containsKey(step) and entry['stepMap'].get(step).completed}">—</span>
      </td>
    </tr>
  </tbody>
</table>

Each part can carry production instructions from its specification. instructions is a list. Each element has text and operationName. operationName is empty when the instruction applies to every operation. The list keeps the order set on the specification.

A group traveller lists, for each part, the instructions for the operation of the production step you download it from, plus the instructions that apply to every operation. Instructions for other operations are left out.

Instructions are internal. They never appear on customer documents (quote or estimate, order confirmation, invoice, consignment label, custom documents) or on the Traveller Sheet. The default traveller templates do not print them. To print them, add a loop like this to your own template:

<div th:each="item : ${LINE_ITEMS}">
  <strong th:text="${item.partName}"></strong>
  <div th:each="instruction : ${item.instructions}">
    <strong th:if="${!#strings.isEmpty(instruction.operationName)}"
            th:text="${instruction.operationName + ': '}"></strong>
    <span th:text="${instruction.text}" style="white-space: pre-line;"></span>
  </div>
</div>

Instruction text is free text. Use th:text, not [(...)]: th:text prints a < or & as typed, and [(...)] does not escape it. The white-space: pre-line style prints the line breaks in an instruction.


Order Traveller — iterating orders

Use ORDERS to iterate over each order. Each order has: orderNumber, orderDate, customerName, taxCode, billingAddress, shippingAddress, billingAddressData (nullable — raw address object), shippingAddressData (nullable — raw address object), purchaseOrderNumber, finalPrice (nullable), formattedFinalPrice (nullable — pre-formatted price string), currency, ownerName (nullable), accountingInvoiceNumber (nullable), accountingEstimateNumber (nullable), accountingConfirmationNumber (nullable), allWorkflowSteps, and lineItemsWithMaps. Each entry in lineItemsWithMaps exposes .unitPrice and .currency shortcuts for per-part pricing, plus the same physical-attribute shortcuts as Group Traveller's line items. Each entry also exposes .instructions, the list of production instructions (also available as .lineItem.instructions).

GROUP_NAME is a top-level variable (not per-order) — it is the production group name when the traveller is downloaded from a production step, and blank otherwise.

<!-- Optional group name header — only shown when downloaded from a production step -->
<h2 th:if="${GROUP_NAME}">Group: [(${GROUP_NAME})]</h2>

<div th:each="order : ${ORDERS}">
  <h3>Order [(${order.orderNumber})] — [(${order.customerName})]</h3>
  <p>[(${order.orderDate})]</p>
  <p th:if="${order.purchaseOrderNumber != null and !#strings.isEmpty(order.purchaseOrderNumber)}">
    PO: [(${order.purchaseOrderNumber})]
  </p>

  <!-- Accounting reference — show whichever is set -->
  <p th:if="${order.accountingInvoiceNumber != null}">
    Invoice ref: [(${order.accountingInvoiceNumber})]
  </p>
  <p th:if="${order.accountingEstimateNumber != null and order.accountingInvoiceNumber == null}">
    Estimate ref: [(${order.accountingEstimateNumber})]
  </p>

  <!-- Parts with unit price -->
  <table style="width: 100%; border-collapse: collapse;">
    <tr th:each="entry : ${order.lineItemsWithMaps}">
      <td>[(${entry['lineItem'].partName})]</td>
      <td>Qty: [(${entry['lineItem'].quantity})]</td>
      <td style="text-align: right;">
        <span th:if="${entry.unitPrice != null}"
              th:text="${(entry.currency != null and entry.currency != '') ? entry.currency + ' ' : ''} + ${#numbers.formatDecimal(entry.unitPrice, 1, 'COMMA', 2, 'POINT')}"></span>
        <span th:if="${entry.unitPrice == null}">—</span>
      </td>
    </tr>
  </table>

  <!-- Order total -->
  <p th:if="${order.finalPrice != null}" style="text-align: right; font-weight: bold;">
    Total:
    <span th:text="${(order.currency != null and order.currency != '') ? order.currency + ' ' : ''} + ${#numbers.formatDecimal(order.finalPrice, 1, 'COMMA', 2, 'POINT')}"></span>
  </p>
</div>

Which instructions an entry lists depends on where you download the order traveller:

  • From a production step: the instructions for that step's operation, plus the instructions that apply to every operation. This is the same rule as the group traveller.
  • From an order: every instruction on the part. Each one carries its operationName, so your template can show it as a label.

Instructions are internal and never appear on customer documents. To print them, copy the inner loop from Print production instructions into your entry : ${order.lineItemsWithMaps} loop and loop over entry.instructions.


Add id="page-header" or id="page-footer" to repeat an element on every page. Place the element anywhere in the <body> — the renderer pulls it out of the normal flow automatically.

<div id="page-header">
  [(${OPERATOR_NAME})] | Order [(${ORDER_NUMBER})]
</div>

<div id="page-footer" data-footer-height="40px">
  Page <span class="page-current"></span> of <span class="page-total"></span>
</div>

Use data-footer-height to control how much space is reserved at the bottom of each page. The default is 40px, which fits a single line. Increase it when your footer has more content:

<div id="page-footer" data-footer-height="60px">
  <table width="100%">
    <tr>
      <td style="font-size: 8pt; color: #999;" th:text="${OPERATOR_NAME}"></td>
      <td style="text-align: right; font-size: 8pt; color: #999;">
        Page <span class="page-current"></span> of <span class="page-total"></span>
      </td>
    </tr>
    <tr>
      <td colspan="2" style="font-size: 7pt; color: #bbb;" th:text="${OPERATOR_EMAIL}"></td>
    </tr>
  </table>
</div>

Page numbers — use these two spans inside any footer or header content:

SpanRenders as
<span class="page-current"></span>Current page number
<span class="page-total"></span>Total page count

Side-by-side columns

The PDF renderer (OpenPDF) supports CSS 2.1 only: no flexbox, CSS Grid, or CSS variables. Use <table> for multi-column layouts:

<table style="width: 100%;">
  <tr>
    <td style="vertical-align: top;">
      <img th:if="${LOGO_IMG != null and !#strings.isEmpty(LOGO_IMG)}"
           th:src="|data:image/png;base64,${LOGO_IMG}|"
           style="max-height: 40px;" alt="" />
    </td>
    <td style="vertical-align: top; text-align: right;">
      [(${OPERATOR_NAME})]<br/>
      [(${OPERATOR_EMAIL})]
    </td>
  </tr>
</table>

Page breaks

Use the CSS 2.1 page-break properties to control where pages split:

<!-- Start a new page -->
<div style="page-break-before: always;"></div>

<!-- Keep a table row on one page -->
<tr style="page-break-inside: avoid;">...</tr>

Fonts

Fontfont-family value
Poppins (default)Poppins
ArimoArimo
Gentium PlusGentium
Source Serif ProSourceSerif

⚠️ For templates in Russian, Ukrainian, Bulgarian, or Greek use Arimo to ensure all characters render correctly.


Page sizes

Standard templates default to A4. Custom Document, Invoice, Group Traveller, and Order Traveller templates let you set any size in millimetres when creating the template. There is no size picker: type the Page Width (mm) and Page Height (mm). A Consignment Label uses the label size selected when the template is created, not @page CSS. Common sizes:

SizeWidth × Height
A4 (default)210 × 297 mm
A3297 × 420 mm
A5148 × 210 mm
US Letter215.9 × 279.4 mm

Last updated on

On this page