Customisable templates

Invoices, orders, statements, cheques, payslips and labels are all templates — edit them in the browser, in HTML, LaTeX, plain text or XML.

  • HTML, LaTeX, text and XML templates, edited in the application.
  • A separate template per document type: invoice, packing list, pick list, work order, order, quotation, RFQ, statement, cheque, payslip, receipt, label.
  • A template set per language, so each customer gets their own.
  • Per-dataset template sets, so two companies can look completely different.
  • LaTeX templates produce PDF directly, including on pre-printed stationery.
  • Any field on the transaction is available to the template.
  • Email a document straight from the screen that made it.

Where to find it System › HTML Templates  ·  System › LaTeX Templates  ·  System › Text Templates  ·  System › XML Templates

Editing a template

  1. Open System › HTML Templates (or LaTeX for PDF) and pick the document: invoice, sales order, statement, cheque, payslip…
  2. The list shows the default template and one per document language. Click the one to change; it is displayed as it will render, with the variable names in place of values.
  3. Press Edit to open the source. Variables are <%name%>; line items sit inside a <%foreach number%> loop; <%if%> blocks hide sections that do not apply. Every field on the transaction and the customer is available.
  4. Save. The next document printed uses the new layout; there is nothing to restart.
  5. Shared pieces — head.html, letterhead.html, foot.html — are linked from the top and bottom of each template, so the letterhead is changed once.
The invoice template displayed with its variable names, and an Edit button
invoice.html as the editor shows it: every field name where its value will print, with head, letterhead and foot linked above and below.
The invoice template with one version per document language
One default and one version per document language.
The cheque template with its language versions
Cheques, statements and payslips are templates too, translated the same way.
The invoice that template produces
And this is what it produces.

What a template can say

Templates are plain HTML (or LaTeX, text, XML) with variables and three control commands. The stock templates are the best reference: open one and read it.

  1. A variable prints a value: <%name%>, <%address1%>, <%invnumber%>, <%invdate%>, <%duedate%>, <%ordnumber%>, <%employee%>, <%shippingpoint%>, <%subtotal%>, <%invtotal%>, <%paid%>, <%text_amount%> (the total in words), <%currency%>.
  2. Line items sit inside <%foreach number%><%end number%>, where <%runningnumber%>, <%number%>, <%description%>, <%qty%>, <%unit%>, <%sellprice%>, <%discountrate%> and <%linetotal%> repeat per line. Taxes repeat the same way inside <%foreach tax%> with <%taxdescription%>, <%taxbase%>, <%taxrate%> and <%tax%>.
  3. <%if contact%><%end contact%> prints a block only when the field has a value; <%if not taxincluded%> is the negative. This is how the stock invoice shows a Subtotal line only when tax is not included and a Paid line only when something was paid.
  4. <%include letterhead.html%> pulls in the shared letterhead, so the company block is changed once for every document. head.html and foot.html work the same way.
  5. Text templates are for 40-column receipt printers at the till; LaTeX templates produce PDF and are the ones to use for pre-printed stationery.
  6. Reminder letters escalate: reminder1, reminder2 and reminder3 are separate templates, chosen by the customer’s reminder level on the AR reminder report.
The reminder letter template list with its language versions
Three reminder templates, one per escalation level, each translated per language.

From the blog

  • Invoice Set Up on pre-printed formsOriginal Question: Could someone point me in the right direction to create an invoice template for a pre-printed form.
  • Bootstrap for SQL-LedgerWe have recently updated our SQL-Ledger installation with latest version of Bootstrap (5.3.1 at the time of this writing), a popular CSS framework.

Every dataset on our hosting has this, from day one.

Create your free account or ask us about migrating