Document Auto-tags

About Auto-tags

Auto-tags act as a placeholders that gets replaced with specific values. WHMCS provides you 4 auto-tags. Let's analyze them:
  • {YEAR} current year
  • {MONTH} current month
  • {DAY} current day
  • {NUMBER} document number (invoice, proforma and credit note number)

Custom Auto-tags

Billing Extension offers you several new auto-tags that you can freely use to customize the numbering style of your documents. If you need an auto-tag request it from our Lab describing us how it should work.

System ID

{ID} auto-tag is available for proformas only and is equal to the system ID of the document (i.e. The Auto-Index of table).

User ID

The value of {USERID} auto-tag corresponds to the ID of the customer.


{COUNTRY} auto-tag gets replaced by ISO 3166-1 alpha-2 two-letter country code (eg. IT, US, UK, FR...).


The auto-tag {CURRENCY} assumes the three-letter currency code of the document in question (eg. USD, EUR, GBP...).


This number is used by Finnish companies. {VIITENUMERO} basically it is an extra reference number displayed on invoices, its purpose is to avoid typing/transcription errors. To get it, we should multiply every digit of invoice numbers in a specific way and then perform further calculations.

Let us describe you an example with invoice number equal to 3025. First we have to multiply each digit (starting from right) by specific numbers:
  • 5 x 7 = 35
  • 2 x 3 = 6
  • 0 x 1 = 0
  • 7 x 3 = 21
Then we have to sum all numbers together 35 + 6 + 0 + 21 = 62. Now we have to subtract 62 from the next bigger tenth value (70 - 62 = 8) and add this number right after invoice number so that invoice 3025 becomes 30258. Here you can find a tool that allows you to generate such numbers.

Don't forget that {VIITENUMERO} returns just the reference number. That means that to get 30258, where 3025 is invoice number and 8 viitenumero, you have to use {NUMBER}{VIITENUMERO}.

If you need to print both numbers separately on invoices (eg. Invoice number: 3025 & Viitenumero: 30258), do not use {VIITENUMERO} auto-tag. In viewinvoice.tpl and invoicepdf.tpl just use the variable $viitenumero to get 30258 anywhere you want. Last but not least this variable is already formatted according to regulation: space every 5 characters, leading zero if invoice number is less than 3 digits (eg. 178 96553, 178 96566, 178 96579).