Number format explained

By default, we use a sequential number system for each document that starts at 1 and increases with each document created. However, you can customize your document number format by adding a prefix, suffix and padding.

Prefix and suffix #

You can add a prefix and/or suffix to your document number, whether for aesthetics purposes or to meet your domestic accounting laws. For example, in some countries, it’s necessary to add a letter before your document number as a prefix, or the current year after the document number as a suffix, to comply with accounting requirements.

Padding #

The padding is the number of zeros that will be added to the document number to have a minimum number of digits. For instance, if you enter a padding of 6, and the next document number is 123, three additional zeros will be added to complete the 6 (padding) digits: 000123

Formatting document number #

Following the examples above, let’s say that your number will need to follow this pattern:

  • The letter F as prefix followed by a dash (-).
  • The current order year as suffix, preceded by a dash (-). See Available placeholders below.
  • A 6-digit padding.

So, you’ll need to enter these settings as number format:

Let’s say that your next document number will be 123, and the current year is 2022, then your document number formatted will be F-000123-2022

Available placeholders #

You can use placeholders in the prefix and suffix to replace it with dynamically data. These are the available placeholders:

  • [order_number] — Replaced with the order number.
  • [order_day] — Replaced with the order day.
  • [order_month] — Replaced with the order month.
  • [order_year] — Replaced with the order year.
  • [order_date="{$date_format}"] (E.g. [order_date="Ymd"]) — Replaced with the order date based on the date format given. See PHP Date Formats.
  • [{$document_type}_day] (E.g. [invoice_day]) — Replaced with the document day.
  • [{$document_type}_month] (E.g. [invoice_month]) — Replaced with the document month.
  • [{$document_type}_year] (E.g. [invoice_year]) — Replaced with the document year.
  • [{$document_type}_date="{$date_format}"] (E.g. [invoice_date="Ymd"]) — Replaced with the document date based on the date format given. See PHP Date Formats.