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.
Editing a template
- Open System › HTML Templates (or LaTeX for PDF) and pick the document: invoice, sales order, statement, cheque, payslip…
- 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.
- 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. - Save. The next document printed uses the new layout; there is nothing to restart.
- Shared pieces — head.html, letterhead.html, foot.html — are linked from the top and bottom of each template, so the letterhead is changed once.
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.
- A variable prints a value:
<%name%>,<%address1%>,<%invnumber%>,<%invdate%>,<%duedate%>,<%ordnumber%>,<%employee%>,<%shippingpoint%>,<%subtotal%>,<%invtotal%>,<%paid%>,<%text_amount%>(the total in words),<%currency%>. - 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%>. <%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.<%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.- 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.
- Reminder letters escalate: reminder1, reminder2 and reminder3 are separate templates, chosen by the customer’s reminder level on the AR reminder report.
From the blog
- Invoice Set Up on pre-printed forms — Original Question: Could someone point me in the right direction to create an invoice template for a pre-printed form.
- Bootstrap for SQL-Ledger — We 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