Contents
1. What this section is for2. Template syntaxExamplesRules3. The e-Fatura / e-Arşiv / e-İrsaliye format4. Resetting every year5. Filters and the order in which a series is chosen6. The series that come ready-made7. The series selector on the document screen8. When the number is assigned, and why it never changes9. Counter correction10. How to change a series that has issued numbers11. Bank matching and accounting vouchers12. On the phone (Garden + Step)13. Error codesHelp › Settings and Log › Document Number Series
Document Number Series — A Guide from Scratch
Every final document — invoice, delivery note, order, quotation, receipt, cheque batch — has a number that is shown to the customer, the accountant and the tax office. HNR generates this number from a series template that you define: a fixed prefix, optionally the year, and a zero-padded sequential number. For example art00001, SF2026000001 or, in the GİB e-Fatura format, ABC2026000000001. The number is assigned once, when the document is saved, and never changes again.
1. What this section is for
A document number has two parts: the series template (the format of the number) and the sequence (the next number from the series counter). Series are used for eight document types: invoice, delivery note, order, quotation, business partner receipt, cash receipt, bank receipt and cheque batch.
- Old documents are kept. Documents saved before this scheme was switched on keep their numbers: when the company opens, the old number is carried into the same field as text and appears as before in lists, in search and on printouts. Because old numbers consist of digits only, new templates must contain at least one letter — an old and a new number can never clash.
- The technical ID is not shown. Every document also has a technical ID (SIRA, e.g. a 13-digit number). The program uses it to link documents to each other and to their attachments; it does not appear on screen, in lists or on printouts. The number the customer sees is always the series number.
- The number comes from the series, not from the document kind. That is why correcting the kind or the date of a document does not change its number (section 8).
Where to open it. Settings › Company details › Document series. Only the system administrator adds and edits series and corrects counters; other users only choose in the series selector on the document screen (section 7).
2. Template syntax
A template is a short text that says how the number is written. The parts in curly braces are placeholders; everything else is written as it is.
| Part | Meaning |
|---|---|
| plain text | Letters, digits and . _ / -. Upper and lower case are kept (art stays lowercase). |
{seri} | The series code (e.g. ANK). |
{yyyy} | The year of the document date, 4 digits (2026). |
{yy} | The year of the document date, 2 digits (26). |
{00000} | The sequential number. The number of zeros is the number of digits (1-12); the number is padded with zeros on the left. A template must contain exactly one. |
Examples
| Template | Series code | First number |
|---|---|---|
art{00000} | ART | art00001 |
SF{yyyy}{000000} | SF | SF2026000001 |
{seri}-{yy}/{0000} | ANK | ANK-26/0001 |
ABC{yyyy}{000000000} | ABC | ABC2026000000001 |
Rules
- The generated number must contain at least one letter (old numbers are digits only, so that they cannot clash).
- There must be exactly one number field; an unknown field or an unclosed curly brace is not accepted.
- The generated number can be at most 40 characters long.
- If the number outgrows the padding width (e.g. the 1000th document with
{000}), no number is assigned andBELGE_NUMARA_SERI_DOLUis shown; the program does not widen the field by itself. Create a wider series (section 10). - If two active series of the same type could produce the same number (same fixed prefix and number format), saving is refused:
BELGE_SERI_CAKISMA. - The series code is 1-10 characters (A-Z, 0-9, _) and cannot be changed later.
Preview. While you type the template, the preview box below it shows the first number live — and, for a series that resets yearly, next year's first number too. If a rule is broken it turns red; fix it before saving.
3. The e-Fatura / e-Arşiv / e-İrsaliye format
The number of a GİB e-document is 16 characters: a 3-character prefix (uppercase letters or digits) + a 4-digit year + a 9-digit sequence. In HNR this is exactly the template ABC{yyyy}{000000000} → ABC2026000000001.
- The e-Document format box on the form appears only for invoice and delivery note series. When you tick it, the template is filled in as
ABC{yyyy}{000000000}; replaceABCwith your own 3-character prefix. - In an e-document series, resetting every year is mandatory: each year starts again from
000000001. - If the template does not match this pattern exactly, or the series is not an invoice or delivery note series, saving is refused (
BELGE_SERI_EBELGE).
This setting only determines the format of the number. Sending the document to GİB is a separate step.
4. Resetting every year
If Restart from 1 every year is ticked, the series has a separate counter for each calendar year, and the year is taken from the document date (not from the day of saving): a document dated 2026 gets SF2026000017, while a document dated 2025 entered on the same day continues the 2025 counter. That is why such a series must have {yyyy} or {yy} in its template — otherwise two years would produce the same numbers. A series without the tick has a single counter that keeps growing over the years (art00001, art00002, …).
5. Filters and the order in which a series is chosen
A type can have several series: for example so that sales and purchase invoices, two branches, or the shop and the B2B portal are numbered separately. Filters decide which document takes its number from which series. An empty filter covers all of them.
| Filter | What it looks at |
|---|---|
| Kind | The invoice kind (1 sale, 0 purchase, 3 sales return, 2 purchase return, 9 retail sale…), the delivery note kind, the receipt type or the cheque batch operation (CG, CC, BT, IG, IC, DV). Several values are written comma-separated. |
| Warehouse / branch | The document's warehouse. Branches are told apart by warehouse code (e.g. ANKARA,IZMIR). |
| Channel | Where the document was entered: Desktop, Mobile, B2B portal, Field sales, External API. |
When a document is saved, the series is determined in this order:
- The series the user chose on the document. It must be active, of the same type and suitable for the document's kind/warehouse/channel; otherwise
BELGE_SERI_UYUMSUZ. - The most specific series. Among the active series that pass the filters, the one with the most filled-in filters wins.
- The default series. If several candidates are equally specific, the one marked as default is chosen.
- It is asked on the document. If it is still ambiguous, the document is not saved;
BELGE_SERI_SECIM_GEREKLIopens the series selector on screen. If no series fits at all:BELGE_SERI_YOK.
Example. There are the series SF (kind filter: sales kinds) and ANK (kind: sales kinds + warehouse: ANKARA). A sales invoice issued from the Ankara warehouse takes its number from ANK (two filled-in filters, more specific); sales invoices from the other warehouses take theirs from SF. There cannot be two default series with the same filter (BELGE_SERI_VARSAYILAN).
6. The series that come ready-made
If no series has been defined for a document type, HNR adds a default series for that type when the company opens (it appears in the audit trail as "System default"). All of them reset yearly and use a 6-digit sequence; you can edit them, deactivate them or create new ones as you like. Invoices get two series: SF numbers issued invoices (the kinds on the sales side: sale, purchase return, export…), AF numbers received invoices (the kinds on the purchase side: purchase, sales return…).
| Code | Document type | Template | First number (2026) |
|---|---|---|---|
SF | Invoice (sales side) | SF{yyyy}{000000} | SF2026000001 |
AF | Invoice (purchase side) | AF{yyyy}{000000} | AF2026000001 |
IR | Delivery note | IR{yyyy}{000000} | IR2026000001 |
SP | Order | SP{yyyy}{000000} | SP2026000001 |
TK | Quotation | TK{yyyy}{000000} | TK2026000001 |
CM | Business partner receipt | CM{yyyy}{000000} | CM2026000001 |
KM | Cash receipt | KM{yyyy}{000000} | KM2026000001 |
BM | Bank receipt | BM{yyyy}{000000} | BM2026000001 |
CB | Cheque batch | CB{yyyy}{000000} | CB2026000001 |
7. The series selector on the document screen
On the invoice, delivery note, order, quotation, receipt and cheque batch screens, the Document number series box appears only when more than one series fits the document. If only one series fits, it does not appear at all and the number comes from that series.
- The Auto (CODE · number) option uses the series the program suggests.
- The list shows each series' code, name, estimated next number and the default mark.
- If a choice is required, the box gets a red border and reads "Several series match: select a series before saving."
- The number under the box is an estimate: the final number is assigned at the moment of saving. If someone else saves a document from the same series at the same time, yours gets the next one.
- If you change the kind or the warehouse and the series you chose no longer fits, the choice goes back to "Auto" by itself.
8. When the number is assigned, and why it never changes
- The number is assigned while the document is being saved, as the last step of the save. The counter, the number ledger and the document are written in the same transaction: if the transaction fails, the number is not used up either. So series have no gaps and no duplicates. Drafts do not get a number.
- On update the number is kept: correcting the kind, the date or the lines does not produce a new number. Trying to change the series of a final document gives
BELGE_SERI_KORUMA. - The number of a deleted document stays in the ledger marked "deleted" and is never given to anyone again; the counter is not rolled back.
- Subcontracting dispatch and return documents (
FI/FD) are outside this scheme and keep their old fixed format.
9. Counter correction
The Counter button on the series' row opens the counter correction form. It is used so that numbering continues where it left off when you move over from a paper ledger or an old program.
- Only the system administrator can correct it.
- You enter the "Sequence of the last issued number"; the form shows the next number immediately. For a series that resets yearly, first choose the period (year).
- The counter can jump forward, but it cannot be set below the highest number already issued in that period (
BELGE_SERI_SAYAC_GERI). Skipped numbers stay unused; a number is never issued twice. - A justification of at least 5 characters is required. Every correction is written to the audit trail with the old and new value, the user and the justification, and it cannot be undone — it can only be moved further forward by a new correction.
- The Audit trail button on the list shows addition, change, deletion, counter correction and system default records with date, user and justification.
10. How to change a series that has issued numbers
Once a series has issued its first number, its template and its yearly reset rule are locked (BELGE_SERI_KULLANILMIS); on the form these fields are greyed out. The name, the filters and the default and active marks can still be changed. To change the format:
- Create a new series with the new format.
- Untick Active on the old series (deactivate it).
- Old documents keep their old numbers; new documents take their numbers from the new series.
Deleting is possible only for a series that has never issued a number; a series that has issued numbers is not deleted but deactivated. The document type of a series cannot be changed later either.
11. Bank matching and accounting vouchers
- When bank transactions are imported, invoice numbers in the description are recognised with a pattern derived from the company's invoice series:
SF2026000017,SF 2026 000017andSF-2026-000017all find the same invoice; upper and lower case do not matter. Old (digits-only) numbers are still recognised too. Details: Bank transaction import. - An accounting voucher shows the final number of the source document, not its technical ID. Details: Accounting.
12. On the phone (Garden + Step)
On a small screen the series list appears as cards: code, document type, name, next number and the Default / Inactive / e-Document badges; each card has Edit, Counter and (if it has issued no number) Delete buttons. A new series or an edit is done with a four-step wizard:
- Type — document type, code and name.
- Template — template, yearly reset, e-Document format and live preview.
- Filter — kind, warehouse/branch, channel, default and active.
- Confirm — summary, first number and justification; Save.
You cannot move on until the required fields of a step are correct. The series selector on document screens works on the phone too, with the same rules and a large touch target. For the phone interface see Mobile.
13. Error codes
| Code | What it means | What to do |
|---|---|---|
BELGE_SERI_SECIM_GEREKLI | Several series fit equally well and there is no single default among them. | Choose a series in the box on the document; or make one of the series the default, or narrow the filters. |
BELGE_SERI_UYUMSUZ | The chosen series is inactive, belongs to another type or does not fit the document's kind/warehouse/channel. | Set the box to "Auto" or choose a suitable series. |
BELGE_SERI_YOK | There is no active series for this document type, or the requested series code was not found. | Create a series in Settings › Document series, or make an inactive series active again. |
BELGE_SERI_KORUMA | An attempt was made to change the number or series of a final document, or the document type of a series. | The number is kept. If necessary, cancel the document and issue a new one. |
BELGE_SERI_KULLANILMIS | An attempt was made to change the template or reset rule of a series that has issued numbers, or to delete it. | Create a new series and deactivate the old one (section 10). |
BELGE_SERI_CAKISMA | Another active series of the same type could produce the same numbers. | Change the fixed part (prefix) of the template. |
BELGE_NUMARA_SERI_DOLU | The digits of the number field are used up; no number was assigned. | Create a new series with a wider number field and deactivate the old one. |
BELGE_SERI_SAYAC_GERI | An attempt was made to set the counter below a number already issued in that period. | The counter can only be moved forward (section 9). |
The definition form may also show these codes: BELGE_SERI_SABLON (the template rules in section 2), BELGE_SERI_EBELGE (the e-document pattern, section 3), BELGE_SERI_VARSAYILAN (a second default series with the same filter), BELGE_SERI_GEREKCE (the justification of a counter correction is shorter than 5 characters).
Related guides: Settings and Log · Document Entry · Bank transaction import · Accounting · Mobile.