Receipt PDF
doc_receiptGenerate sales receipts as PDF with 80mm thermal-roll or A5 layouts, covering shop header, items, discounts, tax, totals, payment, and change.
Instructions
Make a simple sales receipt as PDF: an 80 mm thermal-roll receipt (page height fits the content, monospace) or an A5 page. Shop header (name, address, phone, tax number), receipt number with prefix, date/time, customer, items (name × qty × price), discount (% or fixed amount), tax % after discount, total, payment method, amount paid and change, note and footer. Same maths as the website: amounts rounded half-up to 0, 2 or 3 decimals. Also returns the totals and a 32-column plain-text version. English labels, Latin text only for now. Web version: https://s3eidat.github.io/receipt-maker/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| no | No | Receipt number. | |
| pay | No | Payment method. | cash |
| tax | No | Tax rate % applied after the discount. | |
| disc | No | Discount: a percentage, or an amount when discType is "amt". | |
| note | No | Note line above the footer. | |
| paid | No | Amount the customer paid (shows change). | |
| shop | No | Shop details: name, address, phone, taxId, currency, decimals, prefix, footer. | |
| when | No | Date and time, YYYY-MM-DDTHH:MM (default now). | |
| items | Yes | Items: name, qty, price. | |
| format | No | thermal = 80 mm roll (default), a5 = A5 page. | thermal |
| output | No | Where to write the result: a file path, or a folder ending in "/". Default: the server output folder (a temp folder unless --out-dir is set). | |
| customer | No | Customer name or table (optional). | |
| discType | No | pct = percent of subtotal (default), amt = fixed amount. | pct |
| returnBase64 | No | Also return the output as base64 in the result (only for small files). Default false. |