Master data management Β· features 286-305
πŸ›’οΈ SQL Server Β· MasterDataLabDB
πŸ”€

303Document Prefix / Suffix

The letters put before and after document numbers. Running numbers read them through {PREFIX} and {SUFFIX}.

Try it

Where each prefix is used

Running numbers (295) read {PREFIX} / {SUFFIX} from here each time they build a number
TypePrefixSuffixRunning number patternNext number today
CN Credit note CN -R {PREFIX}{YYYY}/{SEQ:4}{SUFFIX} CN2026/0001-R
GR Goods receipt GR β€” not used yet β€”
INV Tax invoice INV β€” {PREFIX}{YYYY}{MM}-{SEQ:5} INV202611-00001
PO Purchase order PO β€” {PREFIX}-{FY}-{SEQ:5} PO-FY2027-00001
PR Purchase request PR β€” {PREFIX}{SEQ:6} PR001000
QT Quotation QT β€” {PREFIX}{YY}-{SEQ:4} QT26-0001
RC Receipt RC /BKK {PREFIX}{BE}{MM}{SEQ:4}{SUFFIX} RC2569110001/BKK
SO Sales order SO β€” {PREFIX}{YYYYMMDD}-{SEQ:3} SO20261109-001

Edit the INV prefix (e.g. to IV) and come back: the next number changes at once.

# Document type Name Prefix Suffix Status
5 CN Credit note CN -R Active ✏️
8 GR Goods receipt GR β€” Active ✏️
3 INV Tax invoice INV β€” Active ✏️
7 PO Purchase order PO β€” Active ✏️
6 PR Purchase request PR β€” Active ✏️
1 QT Quotation QT β€” Active ✏️
4 RC Receipt RC /BKK Active ✏️
2 SO Sales order SO β€” Active ✏️
Showing 1–8 of 8
πŸŽ“ Learn: how this master is built table doc_prefix
  • Change a prefix here and the next running number uses it at once - nothing is copied.
Entity
domain/DocPrefix.java
Repository
repo/DocPrefixRepository.java
Definition
MasterRegistry: "doc-prefixes"
Page / form
web/MasterController.java
Try-it panel
templates/tools/prefix-preview.html
REST API
GET /api/running-numbers/INV/preview
SELECT p.doc_type, p.prefix, p.suffix, r.pattern
FROM doc_prefix p LEFT JOIN running_number r ON r.doc_type = p.doc_type;