An invoice number identifies one document; it does not decorate a PDF. Article 145 of the Tax Code requires pre-numbered invoices drawn from a continuous series or produced by a computer system according to a continuous series. That calls for a clear procedure: a draft does not consume the final number, issue reserves it, a duplicate stops processing and an incident leaves an explanation rather than a rewrite.

Eight operating rules
- Define a short, stable structure.
- Assign the final number on issue.
- Guarantee uniqueness within the series scope.
- Never reuse an issued number.
- Do not backdate to fill a gap.
- Document drafts, failures and cancellations.
- Link a correction or credit to the original.
- Periodically reconcile sequence, invoices, sales and exports.
1. What a continuous series is
A series is a generation rule and control scope. A prefix such as F-2026- can aid reading, but does not replace order or uniqueness. The Tax Code sets continuity; this article should not invent a universal annual structure that every business must use.
| Element | Decision to write | Teaching example |
|---|---|---|
| Prefix | Document type | F for invoice |
| Period | Included or not | 2026 |
| Counter | Length and starting point | 000123 |
| Scope | Company/establishment/series | One defined counter |
| Trigger | Issue, never simple entry | Issue button |
| Control | Who reviews and reconciles | Monthly owner |
The result might be F-2026-000123, but that format is only an example. Have separate series, establishment changes and annual closure validated before configuration.
2. Draft, issue, sending and payment
These are four different events. A draft can change; issue creates the final document and number; sending delivers a copy; payment settles all or part of the debt. Numbering on first entry creates avoidable gaps, while numbering on payment leaves issued sales without an identifiable invoice.
- Create an internal draft.
- Check company, customer, date, lines and VAT.
- Check source sale, order or delivery.
- Have exceptions approved.
- Issue and atomically obtain the next number.
- Freeze number, date and controlled legal data.
- Produce PDF and export from the same document.
- Record sending separately.
- Record payment without renumbering.
- Correct through a linked trail after issue.
| State | Final number? | Allowed action |
|---|---|---|
| Draft | No | Edit or abandon |
| Ready | No | Review |
| Issued | Yes | Print, send, collect |
| Partially paid | Same number | Add payment |
| Corrected | Original retained | Link credit/process |
| Archived | Same number | Read, never recycle |
The full issue process is in how to make an invoice. The archive must find number, PDF and source together.
3. Handle a gap or duplicate
Do not repair a gap by silently fabricating a backdated invoice. Do not repair a duplicate by renaming only the PDF. Stop the affected series, qualify what actually exists, retain logs and have the responsible person and accountant decide the correction.
| Incident | First action | Trail to retain |
|---|---|---|
| Number reserved, issue failed | Check whether a final document exists | Log, error, time |
| PDF missing | Regenerate from issued document | Same number and data |
| Two documents, one number | Stop sending, determine original | IDs, users, timestamps |
| Gap discovered | Explain event | Incident register |
| Bad data after issue | Choose correction/credit | Original and link |
| Migration import | Freeze old series | Cutover report |
Do not automatically conclude every gap is fraud or harmless. Document what happened, prevent reuse and obtain the appropriate accounting treatment.

Changing a filename does not change the legal number
FACT-101-copy.pdf is still the same document when its source record says FACT-101. Controls must cover the record, PDF, structured export and journal, not merely the visible name in a folder.
4. Year, establishment and migration
A year change can start a new series if your procedure defines it; it cannot erase the old one. Several establishments or types may justify distinct series only where their rule and reconciliation remain clear.
When changing software, export the final number, invoices and credits, date the old series end, document the new first number and retain read access to the old system. Our Excel migration guide covers this file.
Do not reimport historical documents as freshly issued invoices. Retain their original number in the archive or a dedicated reference field, and test search across both periods.
5. How BelloPOS protects the sequence
In Pro, documents remain drafts and receive the next number on issue. Once issued, number, date and seal stay fixed; permissions and history frame a correction or linked credit. Go numbers the invoice created from a sale.
| Need | BelloPOS | Human check |
|---|---|---|
| Draft without legal number | Pro | Validate before issue |
| Sale invoice | Go/Pro | Customer and tax |
| Continuous series | Controlled issue | Configuration and reconciliation |
| PDF/UBL/hash | Go/Pro | Output consistency |
| Linked credit | Pro | Reason and amount |
| Migration | Exports available | Cutover plan |
BelloPOS does not transmit directly to the DGI. Test two-user concurrency, a failure during issue, restoration and period close before entrusting the series to the system.
Mistakes to avoid
- Numbering drafts on entry.
- Numbering on payment.
- Reusing an issued number.
- Backdating to fill a gap.
- Renaming a PDF without fixing data.
- Starting two series without scope.
- Resetting a year without a trail.
- Migrating without documented final/first numbers.
Frequently asked questions
What does continuous series mean?
A rule producing unique numbers in a controllable order over a defined scope, in line with Article 145.
Should a draft have a final number?
Not in a sound process: it has an internal ID and receives the legal number on issue.
Can I restart at 1 each year?
Only within a defined, validated annual series without erasing or confusing earlier series.
How do I fix a gap?
Do not fabricate an invoice. Identify the event, prevent reuse, retain evidence and validate the treatment.
What should I do with a duplicate?
Stop sending, determine the original record, retain traces and apply the validated correction.
Does BelloPOS prevent deletion of an issued invoice?
The issued document retains its number and history; corrections are controlled or use a linked credit in Pro.
What to take away
Sound numbering separates draft from issue, guarantees uniqueness and makes every incident explainable. Do not erase, recycle or backdate: reconcile the series with documents and exports.
Sources
The figures and rules quoted above come from these pages, read on the date given in the article.
- Moroccan General Tax Code 2026, DGI, read 29 August 2026
- BelloPOS numbered PDF invoices and fields, read 29 August 2026
- BelloPOS quotes, orders, deliveries, invoices and credit notes, read 29 August 2026
- BelloPOS Lite, Go and Pro pricing, read 29 August 2026
Test issue, not only the format
Create two drafts, issue them, simulate failure and check that numbers, PDFs, history and export remain consistent.
Read next
Other practical guides on the same subject: