iVendNextDevelopers My apps

A receipt laid out for your market — the recipe

This recipe makes the till's receipt look the way a country's tax rules or a retailer's brand require: a tax invoice with the company's tax number, an address, a logo, a line for each VAT rate, and a second language beside the first. It is for an iVendNext Partner, or the CitiXsys Consulting Team. The sample to copy is samples/s4_receipt_pack/: a UAE tax invoice, English beside Arabic.

Next: the sample, S4 · UAE tax invoice receiptAll recipes

In the App library: UAE tax invoice receipt

A sale and its tax invoice in the till's Print sheet

A sale at two VAT rates, then its tax invoice, in English beside Arabic, in the till's Print sheet.

When to use it: you want a different layout of figures iVendNext has already worked out. It is Rung 4 of the guide's build ladder: a manifest with one print format.

A receipt prints money; it never decides money. If you need the tax authority's QR code or seal on the receipt, this recipe does not do it: the fiscal reader records them and the shipped mPOS Receipt prints them (no kit sample yet). A format of your own prints them on paper only if its template calls receipt_fiscal_marks(doc) (the fiscal reader page, What the receipt prints); this recipe's template does not.

Steps

  1. Put the facts where iVendNext keeps them, not in the layout. In iVendNext Desk, put the company's tax ID on the Company, link an Address to the Company, and set the Company Address on the till's POS Profile. When a sale is saved, iVendNext puts the company's address on it (the profile's, or else the Company's own address) and a field on the sale copies the tax ID. The template prints what the sale holds and reads no other record, so one layout serves every company.

    • The tax ID is a field your package adds to the POS Invoice (pp_rcp_company_tax_id in the sample: Data, read-only, fetch_from company.tax_id). A retailer whose UAE setup has already added company_trn to the sale needs no field: the sample reads that first. A sale saved before your package was installed has no copy, so it reprints without the number.
    • The address prints as the retailer's address layout sets it, usually on several lines. A sale whose profile and Company have no address prints none, and no error.
  2. Copy the sample and edit its template. samples/s4_receipt_pack/receipt.html is the layout: a readable Jinja template, with comments. logo.png is the logo. Change the words, the order and the logo. Your print format's name is your own (PP RCP … in the sample).

    • Rates come from the sale's own lines. Never type a rate into the template. Each line shows the VAT rate it was booked with (the line's item_tax_rate), and the summary shows the taxable value at each rate. A reprint of an old sale keeps its old rate, even if the retailer's tax setup has changed since. When a retailer changes its VAT setup, the receipt follows with no edit.
    • Arabic beside English: every label sits in a two-column row. The Arabic cell is marked dir="rtl" lang="ar". Keep the Arabic words in the template as plain text.
    • A template reads the sale and nothing else. No call to read another record, and no name of the framework: the sample's tests fail on either. A figure the layout works out itself (a taxable value, the VAT, a charge) has no field to format, so the sample puts it on the sale's write_off_amount in memory, formats it with the retailer's own currency and number format, and puts the value back; the print view loads the sale afresh for each print and never saves it. Do not print write_off_amount in a layout built from this one. A direct way to format a figure in a template is a request to ask for, through the feedback forms.
    • Another record on a receipt, from POS build 2.0.0.654 (guidance, not a promise the sample keeps): a print format may read other records through ivn_rows and ivn_value, with the rights of the person viewing the print (the manifest guide, the print template readers page). A print sent from the e-mail queue, a background print, a share key or a receipt rendered as another user shows its own record only, so a receipt meant to be sent must read well with those rows empty. Read no other record by any other means: the kit's checker warns on any other reader. For a customer's address or contact on the receipt, print the sale's own display fields. S4's layouts read the sale only.
    • The logo is inline. build.py writes the small PNG into the page as a data address, so printing needs no outside fetch.
    • A template may not contain script, frames or event attributes. The checker refuses them.
  3. Build and check, before anyone installs it (in an app you made from S4, run python3 build.py in service/rcp/ instead: it writes the app's own manifest.json, then ivn check):

    python3 samples/s4_receipt_pack/build.py
    python3 tools/manifest/validate.py samples/s4_receipt_pack/manifest.json     # VALID, exit 0
    
  4. Try it on your sandbox with ivn try; a customer's administrator installs it from App library.

  5. Set the format on the till's POS Profile. This is configuration: iVendNext Desk → POS Profile → open the profile → the Print Format field → pick your format → Save. ⚠ A manifest cannot do this step yet. It may not change a POS Profile: the manifest key for a register's format has not shipped. The till reads the profile's format each time it prints, so the change is live on the next receipt, with no restart. Before the app is removed (Export and uninstall), set the profile's Print Format back to what it was (or empty it): otherwise the profile names a format that is gone, and the till prints the sale's plain form.

  6. Look at a real sale. Book a sale on the till. Here, one item at 15% VAT and one zero-rated:

    a sale at two VAT rates

    Open the Print sheet. It shows your format as the printer is fed it (before page geometry). The header carries the logo, the address, the tax number and the bilingual title:

    the invoice's header

    Each item has its own line, with the VAT rate it was booked with:

    its lines and rates

    The summary shows the taxable value at each rate, the VAT and the total:

    the taxable value per rate

What a customised format gives up

The seeded receipt (mPOS Receipt) carries more than the sample does, and a format of your own stops receiving our fixes.

The sample keeps the seeded receipt's VAT figure, and shows charge money on a Charges row (copied, with its source, from the seeded format). It leaves out:

Copy back any of those your market needs from the seeded format (ivendnext_mpos/install.py, RECEIPT_FORMAT_HTML), and test it. A defect in a copied line is a defect there: report it on the POS app's board.

When the till is offline

There is no offline final receipt. An offline sale prints a provisional slip only. This format is for the booked sale.

Limits

Technical notes

The walk

The GIF and the four stills come from our test bench (2026-10-10, iVendNext POS app at 87812e141; frame: the till, 1440 wide; nothing sent to a printer). The Print sheet shows the configured format's render (the page the printer is fed (before page geometry)). The recipe's reference implementation, samples/s4_receipt_pack/, is proven on our test bench.

What the sample was proven to do (our test bench)

Three sales, one for each tax shape (standard-rated, zero-rated, a mix of both), each printed through the till's own receipt read, and each element read from the receipt's own text, beside its label: the logo, the company name, the tax number, the address, the English and Arabic titles and labels, right-to-left on the Arabic, the invoice number, the customer, every item with the VAT rate it was booked with, the taxable value at each rate, and the Total and the VAT beside their own labels, equal to the booked figures, with the taxable values adding up to the sale's net total. Canaries: the seeded receipt has no tax number, no Arabic, no logo and no right-to-left mark; a receipt whose Total row shows another figure is caught, and one with no VAT row is caught. A sale with 30.00 of charge money (built in memory: the bench has no surcharge set up) prints the VAT as the tax alone and the charge on its own Charges row. Uninstall, reinstall: the site's schema as found, and as it was before the first install.

0.1.2 (the layout reads only the sale), checked on our sandbox on 2026-10-16 through the print view, not the till's Print sheet: the 0.1.1 and 0.1.2 formats printed the same draft sales (standard-rated, zero-rated, a mix) with every money line, label and Arabic cell equal; the address moved to several lines; sales saved before the install showed — for the tax number and sales saved after it showed the number; a sale with no address anywhere printed none and no error. Not run on the sandbox: a returned sale, a charge row, a discount or rounding (the laptop tests render them against stand-in sales and compare with what 0.1.1 printed), a UAE company's own company_trn, and the till's Print sheet. The four photographs on this page show 0.1.1: the address on one line.

What it has not proven

⚠ Not proven: Arabic shaping and right-to-left order in the PDF or printer path (the checks read the page's text and its dir="rtl" marks, not a printed page); AED and 5% VAT (the bench's company is ZAR at 15%; the layout reads whatever the retailer has); a real Item Surcharge or fulfilment charge (only the in-memory case above); a returned sale (the Credit Note title is in the template and was not booked on the bench).

Tests

Needs this serves

This page in the kit