Guides & comparisonsInvoicingRetail in Morocco

Invoice numbering in Morocco: series, gaps and duplicates

Understand continuous series, drafts, issue, year changes, gaps, duplicates, migration and correction without reusing or disguising a number.

By BelloCommerce

·

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.

Invoice numbering in Morocco with a continuous series
Invoice numbering in Morocco with a continuous series.

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.

ElementDecision to writeTeaching example
PrefixDocument typeF for invoice
PeriodIncluded or not2026
CounterLength and starting point000123
ScopeCompany/establishment/seriesOne defined counter
TriggerIssue, never simple entryIssue button
ControlWho reviews and reconcilesMonthly 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.

  1. Create an internal draft.
  2. Check company, customer, date, lines and VAT.
  3. Check source sale, order or delivery.
  4. Have exceptions approved.
  5. Issue and atomically obtain the next number.
  6. Freeze number, date and controlled legal data.
  7. Produce PDF and export from the same document.
  8. Record sending separately.
  9. Record payment without renumbering.
  10. Correct through a linked trail after issue.
StateFinal number?Allowed action
DraftNoEdit or abandon
ReadyNoReview
IssuedYesPrint, send, collect
Partially paidSame numberAdd payment
CorrectedOriginal retainedLink credit/process
ArchivedSame numberRead, 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.

IncidentFirst actionTrail to retain
Number reserved, issue failedCheck whether a final document existsLog, error, time
PDF missingRegenerate from issued documentSame number and data
Two documents, one numberStop sending, determine originalIDs, users, timestamps
Gap discoveredExplain eventIncident register
Bad data after issueChoose correction/creditOriginal and link
Migration importFreeze old seriesCutover report

Do not automatically conclude every gap is fraud or harmless. Document what happened, prevent reuse and obtain the appropriate accounting treatment.

Checking invoice-number gaps and duplicates
Checking invoice-number gaps and duplicates.

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.

NeedBelloPOSHuman check
Draft without legal numberProValidate before issue
Sale invoiceGo/ProCustomer and tax
Continuous seriesControlled issueConfiguration and reconciliation
PDF/UBL/hashGo/ProOutput consistency
Linked creditProReason and amount
MigrationExports availableCutover 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.

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: