> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alforse.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Numbering sequences

> The per-company generator behind every readable document number — jobs, change notices, payments, and more.

Each Alforse document receives a human-readable number, such as `J000001`, `CN-000001`, or `PAY-2026-07-000001`. A company-scoped sequence maintains the counter for each document type. Under **Settings → Sequences**, you can change a sequence's prefix, counter, and padding.

Alforse formats and advances the counter atomically to prevent duplicate numbers:

```
{prefix}{next + step, zero-padded to size}{suffix}
```

NOTE

**The number is stored on the document, not recomputed**

Once created, a document's number never changes. Retuning a sequence only affects documents created **after** the change; it never renumbers what exists.

## Fields

Alforse screenshot**Settings → Sequences: the sequence form with prefix, current, size, step, suffix, and the live preview of the next number**

The form previews the next number as you type.

FieldType

<details>
  <summary>**Prefix**`text`</summary>

  Text prepended to the number. Optional; supports date tokens, so `PAY-%{yyyy}-%{mm}-` renders as `PAY-2026-07-`.
</details>

<details>
  <summary>**Current**`integer`</summary>

  The last value handed out; the next document gets `Current + Step`. Set it to restart or fast-forward numbering. Must be `≥ 0`. Set it at or above the highest number already used so the next automatic number does not collide with a document that was given a custom ID.
</details>

<details>
  <summary>**Size**`integer`</summary>

  Zero-padding width: size `6` gives `000001`. Accepted range `1`–`20`; most sequences ship at `6`. A counter that outgrows the size is issued in full, so size `6` at `1000000` gives `1000000`.
</details>

<details>
  <summary>**Step**`integer`</summary>

  How much the counter climbs each time. Almost always `1`; must be `≥ 1`.
</details>

<details>
  <summary>**Suffix**`text`</summary>

  Text appended after the number. Optional; same date tokens as the prefix.
</details>

### Date tokens

Prefix and suffix can embed the current date — how payments and journal entries get their year/month partitioning. Tokens are interpolated when the number is generated, not when you save: `%{yyyy}` (2026), `%{yy}` (26), `%{mm}` (01–12), `%{ww}` (ISO week, 01–53), `%{dd}` (01–31), plus `%{hh}` and `%{ss}` for hour and second.

## Seed defaults

Every numbered document type has a standard sequence, created for the company the first time it is needed or configured. Fixed asset and depreciation run sequences start with `Current` at `1`, so their first number is `000002`.

| Document type | `table` | Prefix | Example |
| - | - | - | - |
| Job | `job` | `J` | `J000001` |
| Quote | `quote` | `Q` | `Q000001` |
| Sales order | `salesOrder` | `SO` | `SO000001` |
| Sales RFQ | `salesRfq` | `RFQ` | `RFQ000001` |
| Sales invoice | `salesInvoice` | `AR` | `AR000001` |
| Purchase order | `purchaseOrder` | `PO` | `PO000001` |
| Purchase invoice | `purchaseInvoice` | `AP` | `AP000001` |
| Purchasing RFQ | `purchasingRfq` | `PRFQ` | `PRFQ000001` |
| Supplier quote | `supplierQuote` | `SQ` | `SQ000001` |
| Receipt | `receipt` | `RE` | `RE000001` |
| Shipment | `shipment` | `SHP` | `SHP000001` |
| Warehouse transfer | `warehouseTransfer` | `WT` | `WT000001` |
| Stock transfer | `stockTransfer` | `ST` | `ST000001` |
| Picking list | `pickingList` | `PL` | `PL000001` |
| Inventory count | `inventoryCount` | `IC` | `IC000001` |
| Change notice | `changeOrder` | `CN-` | `CN-000001` |
| Issue (NCR) | `nonConformance` | `NCR` | `NCR000001` |
| Inspection | `inspection` | `INS` | `INS000001` |
| Gauge | `gauge` | `G` | `G00001` |
| Maintenance dispatch | `maintenanceDispatch` | `MAIN` | `MAIN000001` |
| Customer | `customer` | `CUS` | `CUS000001` |
| Supplier | `supplier` | `SUP` | `SUP000001` |
| Fixed asset | `fixedAsset` | `FA` | `FA000002` |
| Fixed asset transfer | `fixedAssetTransfer` | `FAT` | `FAT000001` |
| Depreciation run | `depreciationRun` | `DR` | `DR000002` |
| Repair order | `repairOrder` | `REP` | `REP000001` |
| Warranty registration | `warrantyRegistration` | `WTY` | `WTY000001` |
| Sales return order | `salesReturnOrder` | `RMA` | `RMA000001` |
| Purchase return order | `purchaseReturnOrder` | `RTS` | `RTS000001` |
| Operation batch | `jobOperationBatch` | `BAT` | `BAT000001` |
| Journal entry | `journalEntry` | `JE-%{yyyy}-%{mm}-` | `JE-2026-07-000001` |
| Payment | `payment` | `PAY-%{yyyy}-%{mm}-` | `PAY-2026-07-000001` |
| Credit memo | `creditMemo` | `CR-%{yyyy}-%{mm}-` | `CR-2026-07-000001` |
| Debit memo | `debitMemo` | `DR-%{yyyy}-%{mm}-` | `DR-2026-07-000001` |

A company can change any prefix under **Settings → Sequences** (the page is for employees; changing a sequence needs update access on Settings).

Accounting posts are the heaviest user of this machinery: every GL post pulls a fresh `journalEntry` number as it books, which is why that sequence carries a month token by default. Sequences are company-scoped, so two companies in the same [group](/docs/reference/intercompany.md) number independently even when they share a chart of accounts. Where the numbers land day to day: [jobs](/docs/reference/jobs.md), [change notices](/docs/reference/change-orders.md), and [payments](/docs/reference/payments.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.