Auto Numbering for Documents: Set the Prefix and Starting Number
The system gives every invoice, client, product and document an automatic number based on rules you set, such as the prefix INV, the number of digits and the starting number. This guide explains the auto numbering settings for each document type, prefix variables such as the year and month, manual number editing, when a number is used up, and why numbers can appear out of sequence.
🛈
Note: You need the Edit General Settings permission to change numbering settings.
Contents
Open the numbering settings
- Directly from Auto Numbering Settings.
- Or from Settings › Auto Number Settings.
- Or from the numbering button in the invoice, estimate, sales order or inventory settings.
The page’s side menu groups documents by module, such as Sales, Inventory & Purchases and Accounting. Choose a document to edit its numbering. A document appears only if its app is active.
Documents that have numbering
| Module | Documents (default prefix) |
|---|---|
| Sales | Invoice (INV), Invoice Payment (PAY), Refund Receipt (RR), Estimate (EST), Credit Note (CN), Sales Debit Notes (DN), Sales Order, Advance Payment Invoice, Offers (OFR). Each additional invoice type has its own numbering. |
| CRM | Client (CUS) |
| Accounting | Income (INC), Expense (EXP), Auto Journal (JNL), Manual Journal (JNL-M), Asset (AST) |
| Inventory & Purchases | Products (ITEM), Inbound Requisition (INR), Outbound Requisition (OBR), Transfer Requisition (TR), Stocktakings (STK), Stock Requests, Purchase Invoice (PI), Purchase Refund, Purchase Order (PO), Purchase Request (PR), Purchase Quotation (PQ), Supplier (SUP), and purchase notes and payments |
| HRM | Employees (EMP), Contracts (CTR), Employee Assets, Employee Custody, Task |
| Operations | Work Order (WO), Booking, Lease Contracts, Manufacturing Orders, Bill of Materials, Production Plan |
| Construction | Bids, Construction Projects, Construction Contracts, Construction Payment Certificate, Cost Sheets, Quotations |
Numbering options
| Option | Description | Required | Shown when |
|---|---|---|---|
| Next Number | The number the next document will get. A preview of the full number appears next to it. | Yes | Always |
| Sequence Format | Numeric digits (0, 1, 2, …) (the default), letters, letters followed by numeric digits, or hexadecimal numbers. | Yes | Always |
| Number of digits | The length of the number, padded with leading zeros. Example: with 5 digits, the number 3 appears as 00003. If a number exceeds this length, it simply gets longer. | No | Always |
| Unique | Prevents duplicate numbers and skips numbers already in use. | No | Always |
| Prefix and Prefix Format | Fixed or variable text before the number, such as INV- or INV-%Y-. | No | When the prefix is enabled |
| Separate Manual Entry Numbering | Gives manual journal entries their own sequence, separate from automatic entries. | No | In journal numbering |
Click Save. The message Numbering format has been saved appears. The new numbering applies to new documents only; existing documents keep their numbers.
The prefix and its variables
Click Variables Guide to see all variables. The most common are:
| Variable | Replaced with | Example |
|---|---|---|
| %Y | Four-digit year | 2026 |
| %y | Two-digit year | 26 |
| %m | Two-digit month | 03 |
| %d | Two-digit day | 15 |
Example
The prefix INV-%Y-%m- with 4 digits gives: INV-2026-03-0001
Variables use the date the document is created, not the document’s own date.
Yearly and monthly numbering
When the prefix contains a variable, such as the year or month, choose what happens when it changes in Prefix change options (only if the prefix is in a variable format):
| Option | What happens at the start of a new year or month |
|---|---|
| Continue from The Last Number | Numbering continues from the last number. Example: INV-2025-0150, then INV-2026-0151. |
| Create a Separate Serial for Each Prefix | Each prefix has its own sequence. Example: INV-2026-0001. |
| Start from Beginning | Numbering restarts from 1 whenever the prefix changes. |
For numbering that restarts every year, use the %Y prefix with Start from Beginning.
Editing the number manually
- For sales invoices, refunds, notes and advance payments: enable Manual Editing of Invoice Numbers in Invoice Settings. The number field then becomes editable when you create the document.
- Estimate and sales order numbers are always editable.
- When Saudi e-invoicing is enabled, the invoice number can’t be edited.
- If you enter a number higher than the Next Number with the same prefix, numbering continues after it. A lower number, or one in a different format, doesn’t change the sequence.
When does a document get its number?
- The number shown when you open the create form is for display only. It isn’t reserved.
- The number is assigned when you save and issue the document. If another user saves a document at the same time, yours may get the next number.
- A draft doesn’t take a number from the sequence. It gets its number when it’s issued.
- If saving fails because of an error, the number isn’t used up.
- A deleted document’s number isn’t reused.
Why are numbers out of sequence?
| Cause | Explanation |
|---|---|
| A higher number entered manually | The sequence jumps to the entered number and skips the numbers in between. |
| Changing the Next Number | Numbering starts from the new number. |
| Deleted documents | Deleted numbers aren’t used again. |
| Drafts issued later | A draft gets its number when issued, so number order can differ from date order. |
| Unique enabled | The system skips numbers that were already used. |
| Branches | Each branch has its own sequence, so numbers interleave when you view all branches together. |
| Prefix changes | Depending on the prefix change option, numbering may continue or restart. |
| Invoice and journal types | Each invoice type has its own sequence. Manual and automatic journal entries share one sequence unless you separate them. |
| Insurance invoices | They are created automatically and take numbers from the invoice sequence. |
Numbering with branches
When branches are enabled, each branch has its own numbering settings and sequence. You can add the branch name or code to the prefix to tell documents apart. Branches, employees, employee contracts and some manufacturing settings use one numbering for all branches.
Error messages and solutions
| Cause | Message | Solution |
|---|---|---|
| The number is already used by another document and Unique is enabled. | Serial number already exists | Change the number, or leave it to automatic numbering. |
| The Next Number doesn’t match the sequence format. | Number must match the format chosen | Enter a number in the same format, for example digits only for the numeric format. |
| The number field is empty or contains spaces. | The invoice number cannot accept spaces. | Enter a valid number. |
| The invoice is a Saudi e-invoice. | According to the instructions of the Zakat and Income Authority, it is forbidden to delete or update the invoice after it has been issued… | Issue a refund receipt or a credit note. |
FAQ
How do I change the next invoice number?
In Auto Numbering Settings, choose Invoice and change the Next Number.
I deleted an invoice. Why wasn’t its number used again?
Numbers aren’t reused after deletion, to keep the sequence intact.
How do I make numbering restart from 1 every year?
Add %Y to the prefix and choose Start from Beginning.
Why can’t I edit the invoice number?
Either Manual Editing of Invoice Numbers is off in the invoice settings, or Saudi e-invoicing is enabled.
The saved number differs from the one I saw when creating the invoice. Why?
Another user saved an invoice before you, so your invoice got the next number.