KontoCloud

Help / Rules and tools

Document numbering

Your own number series for outgoing invoices and stock documents: template, start number, restart, and changes with a “valid from” date.

On this page

Every outgoing invoice and every stock document gets a number at the moment it is issued or posted. Without a special setting, KontoCloud numbers them in the standard sequence. With a number series the legal entity only sets the format of the number, for example “Ф-2026-0007” instead of “7”.

Number series are in Legal entity settings, on the Numbering page, in the “Document number series” section. See Settings.

Article 53, paragraph 10, item 1 of the VAT Law requires the invoice to contain the place, the date of issue and the number. The number series sets the format of that number. The database makes sure the same number does not appear twice and that numbers are assigned in order.

Shared numbering

In Account settings → Shared numbering, choose one template for sales documents and another for stock documents. The system template is {N}, starting at 1 and continuing across years. Each company has its own sequence. In Legal entity settings → Numbering you can override the template or restore inheritance. A series for a specific document type takes priority.

Open Overview by legal entity to check the effective template and next number. To transfer settings, open Import and export, upload the TOML file, enter a reason and review the changes before saving. Previously issued documents keep their numbers.

For which documents

A number series can be created for these document types:

  • Invoice, Advance invoice and Credit note (outgoing invoices, see Invoices)
  • Goods receipt, Goods issue, Transfer, Return to supplier, Return from customer, Stocktake differences and Reversal (stock documents, see Stock documents)

Incoming invoices carry the number from the supplier’s invoice and have no number series.

Overview of number series

The table shows all number series of the legal entity with the version valid today:

Column What it shows
Code short code of the number series
Document the document type
Warehouse the warehouse, or “All warehouses”
Template the number template
Example what the number looks like with the template
Default whether the series is the default for its document type
Documents how many documents have been numbered with the series
Status Active or “inactive”

The Name, Starts again, Valid from and Version columns are hidden. You show them with Columns, as in any table (Working with tables). When there is no number series, it says “No number series — documents are numbered in the standard sequence.”

New number series

  1. Use the cog beside the client’s name in the current client dropdown to open the current client’s settings, then choose Numbering.
  2. In the New number series section, choose Document.
  3. Enter a Code: up to 20 characters, only Latin letters, digits, dot, underscore and hyphen. The code is unique within the legal entity.
  4. For a stock document, optionally choose a Warehouse. Without a choice the series applies to all warehouses.
  5. Optionally enter a Name, up to 100 characters.
  6. Enter a Template. The initial suggestion is Ф-{YYYY}-{NNNN}.
  7. Enter a Start number, from 1 to 999999999. The suggestion is 1.
  8. For Starts again, choose Every year or Never.
  9. Enter Valid from. The suggestion is today’s date.
  10. Default and Active are checked by default. Uncheck Default if the series should not be the default for its document type.
  11. Below the form, check the line “Example: …”, then click Add.

“Number series saved” appears.

Important: The document type, code and warehouse cannot be changed after creation. If you need another type or another warehouse, create a new number series.

Template

The template is a text of 1 to 40 characters with tokens in curly brackets:

Token What it becomes
{YYYY} year, for example 2026
{YY} two-digit year, for example 26
{MM} month, for example 03
{N} … {NNNNNNNNN} sequence number. The number of N letters is the number of digits, with leading zeros
{WH} warehouse code, only for stock documents

Examples:

Template Document of 14.03.2026, sequence number 7
Ф-{YYYY}-{NNNN} Ф-2026-0007
{NNN}/{YY} 007/26
ПР-{WH}-{YYYY}{MM}-{NNNNN} ПР-01-202603-00007, for warehouse with code 01

If the sequence number has more digits than the token, it is not truncated. With {NN} the number 123 stays 123.

The database rejects the template when:

  • it does not have exactly one sequence number token: “The template has exactly one token for the sequence number ({N}, {NNN}, …)”
  • it has an unknown token: “Unknown token {…} in the template (allowed: {YYYY}, {YY}, {MM}, {N}…{NNNNNNNNN}, {WH})”
  • it has brackets outside the tokens: “The brackets { } in the template are only for tokens”
  • {WH} is in an invoice number series: “The {WH} token (warehouse) applies only to stock documents”
  • it is empty, longer than 40 characters, or starts or ends with a space: “The template is 1 to 40 characters, without spaces at the start and end”
  • the series starts again every year and the template has no year: “A number series that starts again every year must have the year in the template ({YYYY} or {YY})”

How the number is assigned

  • Starts again: Every year: the sequence number starts from the start number at the beginning of every year.
  • Starts again: Never: the sequence number keeps growing through all years.
  • The next number is the largest sequence number so far in the series (and the year, if it starts again) plus one, but not smaller than the Start number. That way you can continue from the number you reached in another program.
  • The number is assigned under a lock until the end of the transaction. Two documents issued at the same time cannot get the same number.
  • If the number produced by the template already exists on another document of the same type in the legal entity, including numbers in the standard format, the database rejects the document: “The number … already exists on another outgoing invoice — change the template of the number series” or “The number … already exists on another stock document — change the template of the number series”.

Which number series is used

For an outgoing invoice, the series is chosen in the invoice form, in the Number series field. The field appears only when there is at least one active series for the invoice type. The default choice is “Default series”. Then the series marked as Default is used, and if none is marked, the first active series created. The disabled Next number field shows the number the invoice would get. It is only a preview. The number is assigned on issue.

For a stock document, the series is chosen automatically, on posting:

  1. first an active series for the document’s warehouse
  2. then an active series for all warehouses
  3. among several such series, the default one, and then the first one created

If the chosen series is not valid on the document date, the database returns “The number series is not valid for this document on …”.

Changing a number series

A number series is not changed in place and not deleted. Every change is a new version valid from the date you enter.

  1. In the series row, click Change.
  2. “Change number series …” opens with the version history: Version, Valid from, Template, Start number, Starts again, Reason and Changed by.
  3. Change the fields you need: Name, Template, Start number, Starts again, Valid from, Default or Active.
  4. Enter a Reason. It is required for every change.
  5. Click Save.

Documents use the version with the latest “valid from” up to the document date. Numbers already issued stay the same.

To stop using a number series, change it and uncheck Active. From the date of the change, the series is not offered and not used for new documents.

The database rejects these changes:

Message Cause
“The change can apply from … at the earliest (the date of the last document with this number series)” The change must not apply before the last document numbered with the series.
“The next version is …, not … (someone else changed the number series)” Another user changed the series in the meantime. Open it again.
“The number series has no data (version 1)” The series was created without a template and the other data.

Who may do what

Action Who
Viewing number series and the next number every member of the legal entity
Creating and changing a number series administrator and accountant

For other roles the database returns “You do not have permission for this action in this legal entity”. See Roles and permissions.

Other rules:

  • Number series and their versions are append-only. Every creation and every change is recorded in the Audit trail.
  • When the legal entity is in read-only mode, a new series and changes are not possible.
  • Number series and all versions are in the legal entity’s archive.

From the command line

In kc number series are under kc series:

  • kc series list: the number series, with the version valid today
  • kc series add: a new series, for example kc series add F --doc-type invoice --template "Ф-{YYYY}-{NNNN}" --from 2026-01-01 --default
  • kc series edit: a change, as a new version with a reason
  • kc series next: the next number, without assigning it

When issuing an invoice, the series is chosen with kc invoice add --series.

Something unclear or wrong? Write to us at [email protected].