Sylloo ERP Help Center Sign in

Printed documents and receipts

Change printed invoices, vouchers and POS receipts, with the real variables, settings and copy-ready examples.

Updated 1 Nov 2026 8 min read

Printed documents and receipts

Every printed document in Sylloo (sale invoice, purchase order, quotation, delivery note, voucher, cheque, POS receipt, kitchen ticket) is a template. It is one HTML page with a few settings, so the business can change the title, the colour, the notes and what is printed without code.

A4 documents and receipts for 80 mm or 58 mm roll printers use the same template language. A receipt reads the roll width of the outlet in receipt.width.

When you use this

  • The business wants its own title, accent colour and footer note on the sale invoice.
  • You show the serial numbers and warranty of each item on the invoice.
  • You make the POS receipt fit a 58 mm printer.
  • You print the amount in words under the total.

Theme structure

Printed documents do not belong to a website theme. Each document is one template:

File What it is for
<name>.html The whole printed page: one HTML document with its styles in one <style> block. Names such as sale_invoice, purchase_order, quotation, delivery_invoice, money_receipt, payment_voucher, journal_voucher, cheque, stock_transfer.
<name>.json The settings the business can change: {"settings": [...]}. Their values arrive as invoice.data.<id>.
receipts pos_receipt, pos_return_receipt and kitchen_ticket: the same two files, for roll printers.

How it works

  1. The business opens Invoice and receipt templates, chooses a template and clicks Setup.
  2. The business changes its settings (title, colour, notes, show or hide parts) and sees the preview.
  3. When someone prints an order, receipt or voucher, Sylloo fills the template with that record (order, receipt …), the business details (shop) and the settings (invoice.data).
  4. The print window opens by itself once the page and its pictures have loaded.

Example: Thermal POS receipt

A one-column receipt that fits 80 mm and 58 mm rolls. It follows the shipped pos_receipt template.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    {% set paper = receipt.width == 58 ? 58 : 80 %}
    <title>{{ invoice.data.title | default('Receipt') }} {{ order.code }}</title>
    <style>
        @page { size: {{ paper }}mm auto; margin: {{ paper == 58 ? 2 : 3 }}mm; }
        body { margin: 0 auto; width: {{ paper == 58 ? 54 : 74 }}mm; font-family: "Segoe UI", Arial, "Noto Sans Bengali", sans-serif; font-size: {{ paper == 58 ? 10 : 11 }}px; }
        table { width: 100%; border-collapse: collapse; }
        .c { text-align: center; } .r { text-align: right; white-space: nowrap; }
        .rule { border-top: 1px dashed #000; margin: 4px 0; }
        .total td { font-weight: bold; }
    </style>
</head>
<body>
    <div class="c"><strong>{{ shop.name }}</strong><br>{{ shop.address }}<br>{{ shop.mobile }}</div>
    <div class="rule"></div>
    <table>
        <tr><td>No.</td><td class="r">{{ order.code }}</td></tr>
        <tr><td>Date</td><td class="r">{{ order.order_date }}</td></tr>
    </table>
    <div class="rule"></div>
    <table>
        {% for item in order.items %}
        <tr><td colspan="2">{{ item.name }}</td></tr>
        <tr><td>{{ item.quantity }} x {{ item.amount }}</td><td class="r">{{ item.subtotal }}</td></tr>
        {% endfor %}
    </table>
    <div class="rule"></div>
    <table>
        <tr class="total"><td>Total</td><td class="r">{{ order.net_amount | currency_sign }}</td></tr>
        <tr><td>Paid</td><td class="r">{{ order.paid_amount }}</td></tr>
        {% if order.pay_change_amount > 0 %}<tr><td>Change</td><td class="r">{{ order.pay_change_amount }}</td></tr>{% endif %}
    </table>
    {% if invoice.data.footer_note %}<div class="c">{{ invoice.data.footer_note | nl2br }}</div>{% endif %}
    {{ global_js() | raw }}
</body>
</html>

Result: A narrow receipt with the business name, address and mobile, the receipt number and date, one line per item ("2 x 150.00 … 300.00"), the total "1,250.00 ৳", the amount paid, the change when there is any, and the footer note. On a 58 mm outlet it gets narrower by itself.

Every function, filter and variable

order

The order, invoice or receipt being printed: order.code, order.ref, order.order_date, order.delivery_date, order.order_by (who served), order.outlet.name, order.subtotal, order.vat_amount, order.discount_amount, order.additional_charge, order.net_amount, order.paid_amount, order.received_amount, order.pay_change_amount, order.due_amount, order.payment_method, order.note, order.vat_note, order.barcode (a picture of the code). Amounts are already formatted.

<p>Invoice {{ order.code }} · {{ order.order_date }}</p>
<p><strong>Total: {{ order.net_amount | currency_sign }}</strong> · Due: {{ order.due_amount }}</p>
{% if order.barcode %}<img src="{{ order.barcode }}" alt="{{ order.code }}" style="height: 28px;">{% endif %}

Result: "Invoice SI-2045 · 26-10-2026", "Total: 1,250.00 ৳ · Due: 250.00" and a barcode of the invoice number.

order.items

The lines of the document. Each item has name, quantity, amount (unit price), vat_amount, discount_amount, subtotal, and for serial-tracked products serials (a list of serial numbers), warranty (for example "12 months") and warranty_until (the date the warranty of the units ends).

<table class="items">
    <tr><th>#</th><th>Item</th><th>Qty</th><th>Price</th><th>Amount</th></tr>
    {% for item in order.items %}
    <tr>
        <td>{{ loop.index }}</td>
        <td>
            {{ item.name }}
            {% if item.serials %}<br><small>Serial: {{ item.serials | join(', ') }}</small>{% endif %}
            {% if item.warranty_until %}<br><small>Warranty {{ item.warranty }}, until {{ item.warranty_until }}</small>{% endif %}
        </td>
        <td>{{ item.quantity }}</td>
        <td>{{ item.amount }}</td>
        <td>{{ item.subtotal }}</td>
    </tr>
    {% endfor %}
</table>

Result: One row per item. A phone sold with serials shows "Serial: SN-1001, SN-1002" and "Warranty 12 months, until 24-Oct-2027" under its name.

order.contact

The customer or supplier: order.contact.name, order.contact.business_name, order.contact.mobile, order.contact.address.

{% if order.contact.name %}
<p><strong>Bill to:</strong> {{ order.contact.name }}{% if order.contact.business_name %}, {{ order.contact.business_name }}{% endif %}<br>{{ order.contact.address }}<br>{{ order.contact.mobile }}</p>
{% endif %}

Result: The customer's name, company, address and mobile under Bill to:. A walk-in sale without a customer prints nothing here.

shop

The business details: shop.name, shop.logo, shop.address, shop.mobile, shop.email, shop.website_address.

{% if shop.logo and (invoice.data.show_logo | default('show')) == 'show' %}<img src="{{ shop.logo }}" alt="{{ shop.name }}" style="width: 40mm;">{% endif %}
<div><strong>{{ shop.name }}</strong><br>{{ shop.address }}<br>{{ shop.mobile }}</div>

Result: The logo (unless the business chose Hide for Logo), then the business name, address and mobile.

invoice.data

The values of the template's settings from <name>.json. Always add | default('…') with the same default as the schema.

{
    "settings": [
        { "id": "title", "label": "Title", "type": "text", "default": "Quotation", "options": null, "info": "The heading of the document." },
        { "id": "accent_color", "label": "Accent colour", "type": "color_picker", "default": "#1d4ed8", "options": null, "info": null },
        { "id": "footer_note", "label": "Footer note", "type": "textarea", "default": "", "options": null, "info": "Printed at the bottom of the page." }
    ]
}
<h1 style="color: {{ invoice.data.accent_color | default('#1d4ed8') }};">{{ invoice.data.title | default('Quotation') }}</h1>
{% if invoice.data.footer_note %}<p>{{ invoice.data.footer_note | nl2br }}</p>{% endif %}

Result: In Setup the business sees Title, Accent colour and Footer note. The page shows the title in the accent colour and the note at the bottom, with its line breaks.

receipt

On receipts, receipt.width is the roll width of the outlet's printer: 80 (the default) or 58. On money receipts and vouchers, receipt is also the receipt itself, for example receipt.amount.

{% set paper = receipt.width == 58 ? 58 : 80 %}
<style>@page { size: {{ paper }}mm auto; margin: 3mm; }</style>

Result: The page size follows the outlet's printer: 80 mm or 58 mm wide.

A4 page

A4 documents set the paper in CSS and keep table rows together.

<style>
    @page { size: A4; margin: 12mm; }
    table { border-collapse: collapse; width: 100%; }
    tr { page-break-inside: avoid; }
    @media print { .no-print { display: none; } }
</style>

Result: The document prints on A4 with 12 mm margins, and no item row is cut in half between two pages.

number_to_word, number_to_word_bn

Write an amount in English or Bangla words.

<p>In words: {{ order.net_amount | number_to_word }}</p>

Result: "In words: ONE THOUSAND TWO HUNDRED FIFTY TAKA ONLY".

currency_sign

The filter | currency_sign formats an amount with the currency symbol; the function currency_sign() returns the symbol only.

<td>{{ order.net_amount | currency_sign }}</td>

Result: "1,250.00 ৳".

global_js

Adds the print page's own scripts. Put {{ global_js() | raw }} just before </body>. Do not call window.print() yourself: the print window opens by itself.

    {{ global_js() | raw }}
</body>

Result: The print window opens once the page and its pictures have loaded.

What else a document may use

The functions now(), date(), range(), cycle(), max(), min(), currency_sign(), trans(), global_js(); the filters abs, capitalize, default, first, format, join, last, length, lower, slice, title, trim, upper, number_to_word, number_to_word_bn, number_format, currency_sign, trans, batch, e/escape, keys, merge, nl2br, reverse, sort, striptags, url_encode, img_url, image_url, media_url, and raw only right after global_js(); the tags if, for, set, apply, autoescape, verbatim, do. Not available: include, extends, website theme functions such as settings(), media() or t().

{% for row in order.items | batch(20) %}<table class="items">{% for item in row %}<tr><td>{{ item.name }}</td></tr>{% endfor %}</table>{% endfor %}

Result: The items in tables of 20 rows each.

How to extend

  1. Change a document: open Invoice and receipt templates, choose the template and click Setup.
  2. Add a choice for the business: add a setting to <name>.json and read it as invoice.data.<id> with the same default.
  3. Show more about each item: use the item variables above, for example item.serials and item.warranty_until.
  4. Fit a roll printer: start from pos_receipt and keep the paper rule for 80 mm and 58 mm.

Rules and pitfalls

  • Everything inline: all styles in one <style> block; no outside stylesheets, fonts or scripts.
  • Simple layout: tables and blocks print the same everywhere; avoid flex, grid and fixed positions.
  • Black on white for receipts: roll printers print no colours; use black text and dashed lines.
  • Amounts are ready: amounts arrive already formatted; print them as they are.
  • Defaults everywhere: every invoice.data.<id> gets | default('…').

Common questions

How do I switch a receipt between 80 mm and 58 mm? Set the roll width on the outlet. The receipt reads it in receipt.width; use the paper rule from the example.

Can I print a barcode of the invoice number? Yes. order.barcode is a ready picture: <img src="{{ order.barcode }}" alt="{{ order.code }}">.

Where does the business change the footer note? In Invoice and receipt templates › Setup on the template, in Footer note.