Skip to content

Receipt Templates ​

Customize the format and content of printed receipts and kitchen tickets.

Receipt Templates

Overview ​

Receipt Templates control exactly what gets printed on your thermal printers. You can customize kitchen tickets, customer receipts, proforma invoices, and fiscal receipts — each with its own template.

Use this page to:

  • View all configured receipt templates
  • Create new templates for different purposes
  • Edit template content and formatting
  • Set default templates for each type

What You'll See ​

Template Types ​

Filter templates by type using the tabs at the top:

  • All — show all templates
  • Proforma — customer bill templates (before payment)
  • Fiscal — tax-compliant fiscal receipt templates
  • Kitchen — kitchen ticket templates

Each template card shows:

  • Name — template name
  • Type badges — Kitchen, Proforma, Fiscal, and Default indicator
  • Template preview — the template code with formatting tags
  • Width — print width in characters
  • Last updated — when the template was last modified
  • Actions — edit or delete

Editing Templates ​

Click the edit icon on any template to open the template editor:

Template Editor

The editor has two panels:

  • Left panel — template code with formatting tags
  • Right panel — live preview showing how the receipt will look when printed

Editor Controls ​

ControlDescription
NameTemplate name
WidthPrint width in characters (typically 35 or 48)
DefaultSet as the default template for this type
Load built-in templateReset to the system default template
Show tag referenceDisplay available formatting tags
ValidateCheck the template for errors
Save TemplateSave changes

TIP

Changes take effect immediately for all subsequent prints — no restart needed. Test your changes by reprinting a recent order from the Orders page.

Quick Reference ​

How do I make text bold? ​

{{ bold }}This text is bold{{ boldOff }}

How do I center text? ​

{{ center }}This line is centered
{{ left }}Back to left-aligned

How do I make text larger? ​

{{ doubleHeight }}LARGE TEXT{{ doubleHeightOff }}
{{ doubleWidth }}WIDE TEXT{{ doubleWidthOff }}

How do I print a separator line? ​

{{ separator }}
{{ doubleSep }}

separator prints dashes (------------------), doubleSep prints equals signs (==================).

Template Syntax ​

Templates use {{ }} tags for dynamic content and formatting commands. Anything outside the tags is printed as-is.

Displaying Data ​

Access order, business, and item data using dot notation:

{{ .Business.Name }}
{{ .Order.ReceiptID }}
{{ .Waiter.Name }}

Loops ​

Print each item in the order:

{{ range .Items }}
{{ .Name }} x{{ .Quantity }}  {{ currency .Total }}
{{ end }}

Conditionals ​

Show content only when a condition is met:

{{ if notEmpty .Order.Notes }}
Notes: {{ .Order.Notes }}
{{ end }}

Text Formatting ​

CommandEffect
{{ bold }}Start bold text
{{ boldOff }}End bold text
{{ center }}Center-align subsequent lines
{{ left }}Left-align subsequent lines
{{ right }}Right-align subsequent lines
{{ doubleHeight }}Double-height text (for kitchen visibility)
{{ doubleHeightOff }}Normal height
{{ doubleWidth }}Double-width text
{{ doubleWidthOff }}Normal width

TIP

Alignment and size commands affect all lines that follow until changed. Remember to turn off bold/doubleHeight when you're done.

Layout Helpers ​

Two-Column Row ​

Print a label on the left and a value on the right:

{{ row "Total" (currency .Order.TotalDue) }}

Output: Total 1,234.56

Three-Column Row ​

{{ row3 "Left" "Center" "Right" }}

Centered Text ​

{{ centerText "RECEIPT" }}

Separator Lines ​

{{ separator }}
{{ doubleSep }}

Padding and Truncation ​

Align columns precisely:

{{ padRight (truncate .Name 20) 20 }} {{ padLeft (printf "%d" .Quantity) 3 }}
FunctionDescriptionExample
padRight text widthPad text with spaces on the rightpadRight "Chicken" 20 → "Chicken "
padLeft text widthPad text with spaces on the leftpadLeft "150" 8 → " 150"
truncate text lengthShorten text with "..." if too longtruncate "Grilled Chicken Breast" 15 → "Grilled Chic..."

Number and Date Formatting ​

Currency ​

{{ currency .Order.TotalDue }}

Formats with commas and two decimals: 1,234.56

Dates and Times ​

FunctionFormatExample Output
date .Order.CreatedAtDD/MM/YYYY07/04/2026
time .Order.CreatedAtHH:MM:SS14:30:00
datetime .Order.CreatedAtDD/MM/YYYY HH:MM07/04/2026 14:30
datetimeFull .Order.CreatedAtDD-MM-YYYY HH:MM:SS07-04-2026 14:30:00
datetime12 .Order.CreatedAtDD/MM/YYYY hh:mm:ss AM07/04/2026 02:30:00 PM

Printf Formatting ​

For precise number formatting:

{{ printf "%.2f" .Order.Tax }}     → 123.45
{{ printf "%d" .Quantity }}        → 3
{{ printf "%.0f" .Order.TotalDue }} → 1235

Graphics ​

QR Code ​

{{ qrcode .Fiscal.QRData }}

Prints a QR code that customers can scan (used on fiscal receipts for tax authority verification).

Barcode ​

{{ barcode .Order.ReceiptID }}

Prints a CODE39 barcode of the given text.

Printer Control ​

CommandEffect
{{ feed 2 }}Feed 2 blank lines
{{ cut }}Cut the paper
{{ init }}Reset printer to defaults

A typical receipt ends with:

{{ feed 2 }}{{ cut }}

Available Variables ​

Order ​

VariableTypeDescription
.Order.IDnumberInternal order ID
.Order.ReceiptIDtextReceipt number (e.g., "RCP-2026-001234")
.Order.CreatedAttimestampWhen the order was placed
.Order.TabletextTable number or name
.Order.NotestextOrder-level notes
.Order.PaymentMethodtext"cash", "mpesa", "card"
.Order.MpesaCodetextM-PESA transaction reference
.Order.SubtotalnumberItems total before discounts
.Order.BaseTotalnumberTotal excluding tax
.Order.TaxnumberVAT amount
.Order.CTLnumberCatering Training Levy
.Order.DiscountnumberDiscount applied
.Order.TotalDuenumberFinal amount to pay

Business ​

VariableTypeDescription
.Business.NametextRestaurant name
.Business.AddresstextPhysical address
.Business.PostaltextP.O. Box
.Business.PhonetextPhone number
.Business.EmailtextEmail address
.Business.WebsitetextWebsite URL
.Business.PINtextTax PIN
.Business.VATRatenumberVAT rate (e.g., 0.16)
.Business.CTLRatenumberCTL rate (e.g., 0.02)
.Business.FootertextCustom footer message

Staff ​

VariableTypeDescription
.Waiter.NametextWaiter's name
.Cashier.NametextCashier's name

Items (use inside {{ range .Items }}) ​

VariableTypeDescription
.NametextMenu item name
.CodetextItem code
.QuantitynumberQuantity ordered
.PricenumberUnit price
.TotalnumberLine total (qty x price)
.NotestextItem-level notes / modifiers
.VatablebooleanWhether item is taxable
.CategorytextMenu category

Fiscal (for fiscal receipts) ​

VariableTypeDescription
.Fiscal.CodetextFiscal device code
.Fiscal.QRDatatextVerification URL for QR code
.Fiscal.InvoiceNotextFiscal invoice number
.Fiscal.TimestamptextFiscal signing timestamp

Other ​

VariableTypeDescription
.NowtimestampCurrent date and time
.Printer.NametextPrinter name

Math and Comparison ​

FunctionDescriptionExample
add a bAddition{{ add .Order.BaseTotal .Order.Tax }}
sub a bSubtraction{{ sub .Order.Subtotal .Order.Discount }}
mul a bMultiplication{{ mul .Price .Quantity }}
div a bDivision (safe){{ div .Order.Tax .Order.Subtotal }}

String Functions ​

FunctionDescription
upper textUPPERCASE
lower textlowercase
title textTitle Case
trim textRemove leading/trailing whitespace
repeat text nRepeat text n times

Full Example: Custom Proforma Receipt ​

Here's a complete custom receipt template showing common patterns:

{{ center }}{{ bold }}{{ doubleHeight }}{{ .Business.Name }}{{ doubleHeightOff }}{{ boldOff }}
{{ .Business.Address }}
{{ .Business.Phone }}
{{ separator }}
{{ left }}{{ datetime .Order.CreatedAt }}
Receipt: {{ .Order.ReceiptID }}
Table: {{ .Order.Table }}
{{ doubleSep }}
{{ bold }}ITEM                     QTY    PRICE AMOUNT{{ boldOff }}
{{ separator }}
{{ range .Items }}{{ padRight (truncate .Name 24) 24 }} {{ padLeft (printf "%d" .Quantity) 3 }} {{ padLeft (printf "%.2f" .Price) 8 }} {{ padLeft (printf "%.2f" .Total) 7 }}{{ if .Vatable }} C{{ end }}
{{ if notEmpty .Notes }}  -> {{ .Notes }}
{{ end }}{{ end }}{{ doubleSep }}
{{ bold }}{{ row "TOTAL" (currency .Order.TotalDue) }}{{ boldOff }}
{{ separator }}
VAT 16%: {{ printf "%.2f" .Order.Tax }}
CTL  2%: {{ printf "%.2f" .Order.CTL }}
{{ separator }}
Served by: {{ .Waiter.Name }}
Cashier: {{ .Cashier.Name }}
{{ separator }}
{{ center }}{{ .Business.Footer }}
{{ feed 2 }}{{ cut }}

Tips ​

  • Paper width: Standard 80mm thermal printers fit 48 characters per line (Font A). Plan your column layouts accordingly.
  • Preview first: Use the Preview button in the dashboard template editor to see how your template renders before saving.
  • Validate: The editor checks your template syntax before saving — fix any errors shown.
  • Item column alignment: Use padRight for left-aligned columns and padLeft for right-aligned numbers. Combine with truncate to prevent long names from breaking the layout.
  • C marker: The {{ if .Vatable }} C{{ end }} pattern marks taxable items with a "C" — a common convention on fiscal receipts.
  • Kitchen tickets: Use {{ doubleHeight }} for kitchen templates so cooks can read orders from a distance.

Moneta Pay POS — Built for African Restaurants