Document Numbering
How codes like PO/2026-27/00042 are built, and what a draft ref is.
Document Numbering#
Every transactional document in Neriyam has a code — PO/2026-27/00042, SO/2026-27/00100, GRN/2026-27/00231. The code is generated from a single format template per series. You decide what placeholders the format uses, what literal characters sit between them, and when the code gets assigned to a record.
The format template#
Each series has a single Format field — a template string that mixes placeholders with literal characters. Anything inside {...} is a placeholder; everything else (slashes, dashes, letters) is taken literally and appears as-is in the generated code.
The standard format is {DOC_ID}/{FY_START,4}-{FY_END,2}/{SEQ,5}, which produces SO/2026-27/00042 for sales order #42 in fiscal year 2026-27.
| Placeholder | Resolves to | Example |
|---|---|---|
{DOC_ID} | The series' document type code | SO, PO, PR, GRN |
{SEQ,N} | The running serial, padded to a minimum of N digits | {SEQ,5} → 00042 |
{FY_START,N} | Fiscal year start year, optionally truncated to N digits | {FY_START,4} → 2026 |
{FY_END,N} | Fiscal year end year, optionally truncated to N digits | {FY_END,2} → 27 |
{YEAR,N} | Calendar year, optionally truncated to N digits | {YEAR,4} → 2026 |
{MONTH} | Month, zero-padded to 2 digits | 04 |
{DAY} | Day, zero-padded to 2 digits | 08 |
{QUARTER} | Calendar quarter | 2 |
{WEEK} | Week of the year | 15 |
The number after the comma is the minimum width / padding length. Drop the comma to use the default width — for example, {SEQ} yields 42 instead of 00042.
Your admin configures the format in Settings › Document Numbering. A live preview shows the next generated code as you type.
Draft ref vs. real code#
When you first create a transactional document (sales order, purchase order, etc.), it is in Draft status. At that point Neriyam does not burn a real code on it yet — it assigns a temporary draft ref instead, like SO-DRAFT-1, PO-DRAFT-42, or SE-DRAFT-27. The format is the document type, the literal DRAFT, and a sequence — so abandoned drafts never use up real serial numbers.
The real code is assigned later — either on Create, Submit for Approval, or Approve, depending on how the series is configured.
When the code is assigned#
Each series has an Assign On setting with three options:
- On Create — code assigned immediately. No draft ref appears; the draft gets a real code right away.
- On Submit — code assigned when you click "Submit for Approval". Draft ref is replaced at that moment.
- On Approve — code assigned when the approver clicks "Approve". Draft ref stays until approval.
flowchart LR
Create([Create record]) --> A{Assign On?}
A -->|On Create| RC[Real code now]
A -->|On Submit| DR1[Draft ref]
A -->|On Approve| DR2[Draft ref]
DR1 --> Sub([Submit]) --> RC2[Real code now]
DR2 --> Sub2([Submit]) --> Pen[Pending Approval still draft ref]
Pen --> App([Approve]) --> RC3[Real code now]
On Submit is a good default for most documents — you commit a number as soon as the document is finalised, but still avoid wasting numbers on abandoned drafts.
Series management#
A series is a numbering sequence with its own counter and rules. Most organizations need only one series per document type — a single PO series, a single SO series, etc. — but Neriyam supports multiple series per document type if you need them (for example, separate branches or separate companies inside one organization).
Each series has these settings:
- Identifier — a short code for the series, used as the
{DOC_ID}placeholder (e.g.,PO,PO-EXPORT) - Name — human-friendly label (e.g., "Purchase Orders — Domestic 2026")
- Format — the template string described above
- Auto Numbering — generate automatically, or let users enter the code manually
- Allow Override — let users override the generated code (for importing historical data, for example)
- Assign On — On Creation / On Submit / On Approval (see above)
- Reset Frequency — when the serial counter resets: Never, Fiscal Year, Calendar Year, Quarterly, Monthly, Weekly, or Daily
Reset frequency#
The serial counter can reset on a schedule. The most common choice is Fiscal Yearly — on April 1 (or whatever your FY start is), the counter goes back to 1 and the fiscal-year portion of the code rolls to the new year.
| Reset | Sample effect |
|---|---|
| Never | PO/00042, PO/00043, ... continues forever |
| Fiscal Yearly | PO/2026-27/00042, then on April 1: PO/2027-28/00001 |
| Yearly | resets Jan 1 |
| Quarterly | resets Apr 1, Jul 1, Oct 1, Jan 1 |
| Monthly | resets on the 1st of each month |
| Weekly, Daily | as the names suggest — rare in real ERP use |
What gets numbered#
The following document types use configurable numbering series:
- Masters — Items, Item Categories, Customers, Suppliers, Warehouses
- Sales — Sales Orders, Sales Delivery Notes, Sales Returns
- Purchase — Purchase Requisitions, Purchase Orders, Goods Receipt Notes, Purchase Returns
- Inventory — Opening Stock, Stock Transfer, Stock Adjustment
- Manufacturing — Production Entries, Scrap Entries
- Job Work (planned) — Job Work Receipts, Job Work Deliveries, Job Work Returns
- Subcontracting (planned) — Subcontract Deliveries, Subcontract Receipts, Subcontract Returns
Your admin can see the full list in Settings › Document Numbering › Document Types.
Job Work and Subcontracting transactions are planned for an upcoming release. The numbering series are pre-configured so they're ready when the modules ship.
Stock-entry transaction types#
Inventory, Manufacturing, Purchase-stock, Sales-stock, and the planned Job Work / Subcontracting transactions are all stock entries under the hood, and each has a short code that appears in the API and in the system audit fields. The codes show up in error messages and ledger filters; the friendly labels show up in the UI.
| Code | Friendly name | Group | Status |
|---|---|---|---|
OPN | Opening Stock | Inventory | Active |
ADJ | Stock Adjustment | Inventory | Active |
TRF | Stock Transfer | Inventory | Active |
PPR | Goods Receipt | Purchase | Active |
PPT | Purchase Return | Purchase | Active |
SPD | Sales Delivery Note | Sales | Active |
SPT | Sales Return | Sales | Active |
MFG | Production Entry | Manufacturing | Active |
SCR | Scrap Entry | Manufacturing | Active |
PSD | Job Work Delivery | Job Work | Planned |
PSR | Job Work Receipt | Job Work | Planned |
PST | Job Work Return | Job Work | Planned |
SSD | Subcontract Delivery | Subcontracting | Planned |
SSR | Subcontract Receipt | Subcontracting | Planned |
SST | Subcontract Return | Subcontracting | Planned |
All planned series use the standard format {DOC_ID}/{FY_START,4}-{FY_END,2}/{SEQ,5} and reset on fiscal-year change. Active series can use any format your admin configures.
Planned Job Work and Subcontract series — default code prefixes#
| Series | Default code prefix | Example |
|---|---|---|
| Job Work Receipt | JW-GRN | JW-GRN/2026-27/00001 |
| Job Work Delivery | JW-DN | JW-DN/2026-27/00001 |
| Job Work Return | JW-RET | JW-RET/2026-27/00001 |
| Subcontract Delivery | SUB-DN | SUB-DN/2026-27/00001 |
| Subcontract Receipt | SUB-GRN | SUB-GRN/2026-27/00001 |
| Subcontract Return | SUB-RET | SUB-RET/2026-27/00001 |
Manual override#
If Allow Override is on for a series, you can type your own code when creating a record (instead of letting Neriyam generate one). This is useful when:
- Importing historical data that already has codes you want to keep
- Matching an external document number (an email from a customer requesting "Please use your code ABC-2026-001")
Manual override can break the continuous serial sequence. Use it sparingly — usually only for one-off data migrations.
Related#
- Approval workflow — when codes get assigned depends on the approval step
- Settings › Document Numbering — full admin walk-through
Last updated