Skip to main content
When document numbering is on, Foliant gives invoices, credit notes and quotes their own sequential numbers, such as INV-0042. A template prints the number with {{ document_number }}, or in the visual editor with the Document number block.

Before you start

  • Turn on numbering in Settings › Documents & printing › Document numbering. See Set up document numbering.
  • Set the template’s Document type to Invoice, Credit note or Quote on its settings page. Templates of type Other (not numbered) don’t get numbers.

In the visual editor

Add the Document number block (in Compliance). It prints the number and the document’s date with their labels, such as “Invoice number” and “Invoice date” (“Credit note date” on a credit note, “Quote date” on a quote), in the document’s language. It appears only on numbered documents. You can also add Document number and Document date to a Header block’s Details under the title, or use Document number as what a Barcode / QR block encodes.

In code

Print the number only when there is one:
'document_date.invoice' | t prints “Invoice date” in the document’s language; use document_date.credit_note or document_date.quote for the other types.

The invoice date

An invoice’s date is the day it was issued: the day its number was given. That’s not the order date, and not today’s date, which changes each time you print it again. {{ document_date }} gives you that date:
  • On a numbered document, it’s the day the number was issued, in your store’s time zone. Printing the document again next month doesn’t change it.
  • On a document without a number, it’s the order’s date. For orders imported from elsewhere, that’s the date the order was processed. A credit note uses the date of its refund.
So one template works whether numbering is on or off. The built-in invoice, credit note and quote templates already print it, labelled “Invoice date”, “Credit note date” or “Quote date”. If your own template prints 'now' | date as its date, replace that with {{ document_date | date: '%d %B %Y' }}.

If your template doesn’t print the number

When a numbered document’s template doesn’t use document_number anywhere, Foliant adds a small line at the end with the number and the date it was issued, such as “Invoice number: INV-0042 · October 4, 2026”, so the number is never missing. Add {{ document_number }} where you want it, and the extra line goes away. If your template already prints document_date or document_issued_at, the line shows just the number.

Good to know

  • A document gets its number the first time it’s downloaded, printed or exported, and keeps it.
  • The editor’s preview shows the number your next document would get, without using it up.
  • A barcode of the number: {{ document_number | barcode }}. See Barcodes and QR codes.
  • Templates for all the selected orders are never numbered.