The Gaps in Your Invoice Numbers
A missing number in an invoice sequence looks like evidence of a suppressed sale. How numbering works here, where a gap can come from, why we never renumber or reuse one, and how to answer an auditor who asks.
A missing invoice number is one of the few things in accounting that looks like evidence of something. Usually it is evidence of a database index.
Document numbers here are issued per organisation, per document type, per year. Invoices, quotations, purchase orders, credit notes, till sales, till returns, assets, custodians and employees each have their own run, and each run restarts with the year. The number is taken inside a transaction with the sequence row locked, so two people saving at the same instant cannot receive the same number.
Where a gap can come from
A sequence can show a gap for reasons that have nothing to do with a suppressed sale. A document abandoned after its number was taken leaves that number unused. And in any system, numbering shared across more than one business or more than one site jumps wherever another user of the shared run moved ahead.
So the first question about any gap is what the run is shared with. Here the answer is nothing outside your organisation: a new number is the greater of your own counter and the highest number already on one of your documents, plus one. Nothing another business does moves it.
A shared run is the usual cause, which is the part worth understanding
Many systems hold one number space across everything they run — every site, every company in a group, or every customer of a hosted product — because a single uniqueness rule on the number column is the simplest way to stop two documents colliding. It works, at the price of numbering that skips for reasons belonging to somebody else. Here uniqueness is enforced on the organisation and the number together, so two businesses can hold the same invoice number and neither run moves for the other.
Why per-organisation numbering is two rules, not one
Per-organisation numbering rests on two rules that only work together. The database enforces uniqueness on the organisation and the number as a pair, so two businesses can hold the same invoice number without colliding. And the search for the highest number in use is narrowed to a single organisation. Either rule alone breaks something.
-
Narrow the search without the paired uniqueness
And the second organisation to reach a number fails to save its invoice.
-
Pair the uniqueness without narrowing the search
And numbers still jump for reasons that belong to somebody else.
-
Do both
Which is how numbering works here: genuinely per organisation, sequential, and safe under concurrency.
Two changes that are one change. Reverting either alone breaks something different.
A gap is never closed by renumbering
Nothing renumbers. The next number is always the greater of the stored counter and the highest number actually present, so numbering carries on upward rather than reusing anything that has been issued, and any gap stays exactly where it is.
That is the right call and it is worth defending, because the alternative sounds tidier and is much worse. Those numbers are printed on documents your customers hold. They are quoted in remittance advices, entered into your customers' purchase ledgers, referenced in credit notes and cited in payment reconciliations. Renumbering to close a gap would mean the invoice in your system and the invoice in your customer's filing cabinet disagree about what they are called — and it would do that silently, across every historical document, to make a sequence look neater.
| Option | What it costs |
|---|---|
| Renumber to close the gaps | Every issued document disagrees with the copy the customer holds. Reconciliation breaks retroactively. |
| Reuse the skipped numbers going forward | Numbers appear out of chronological order, which is worse to explain to an auditor than a gap. |
| Leave them and be able to explain them | A gap in the sequence, and a reason for it. The true record. |
How to explain a gap if you are asked
The question comes up in audits because a missing invoice number can indicate a suppressed sale. The answer should be specific and checkable: which document type, which numbers, and why they were never allocated. No document was issued and deleted; the number was never allocated to anything.
What supports that answer is that nothing in the system deletes an invoice out of the sequence. An invoice that should not stand is cancelled or credited, and both leave the original document in place with its number intact. So a gap is a number that was never used, and every number that was used still has a document attached to it.
What the sequence key does and does not contain
Organisation, document type and year. Not branch, not site, not user. Ten locations issuing invoices share one run of numbers, so invoice 000412 is the four hundred and twelfth invoice your organisation issued this year rather than the four hundred and twelfth from that shop. For a single-site business that is invisible; for a multi-site one it is a decision worth knowing you have made.
What AWRA OpsHub does today
- Sequential numbering per organisation, per document type and per year, across nine document types — invoices, quotations, purchase orders, credit notes, till sales, till returns, assets, custodians and employees.
- A locked sequence row inside a transaction, so two documents created at the same instant cannot take the same number.
- A next number taken as the greater of the stored counter and the highest number actually present, so a sequence cannot reissue a number that already exists on a document.
- A race-safe creation of a new year's sequence row, where a simultaneous first document of the year does not fail.
- Composite uniqueness on organisation and number, so two businesses on one installation can hold the same invoice number without colliding.
- Numbering scoped to your organisation alone, so a number never moves for reasons belonging to somebody else's business.
- Issued numbers left exactly as issued, because they are printed on documents customers hold.
- Zero padding and a per-type prefix, so a number is readable and sorts correctly.
More we can add to your workspace
- A branch or site segment in the sequence key, so each location can run its own numbering rather than sharing one organisation-wide run. Commission it
- A skipped-number report per document type, listing the numbers never issued in a period, so a question from an auditor is answered from a screen rather than from a spreadsheet. Commission it
- A stated reason recorded against a historical skip, attached to the sequence rather than kept in somebody's memory. Commission it
- Configurable sequence formats per organisation — segment order, padding width, a separator — for businesses with an existing numbering convention. Commission it
- A sequence that continues across the year boundary for organisations whose numbering is not annual. Commission it
- A preview of the next number on the document form, before it is saved. Commission it
Where we point you to a specialist
- We will not renumber issued documents to tidy a sequence. Those numbers are printed on paperwork your customers hold and quoted in their own ledgers, and quietly changing them would make your records and theirs disagree about what a document is called. A skipped number you can explain beats a sequence you cannot reconcile.
- We will not reuse a skipped number. Slotting one in later puts documents out of chronological order within the sequence, which is a harder thing to explain to an auditor than the skip it was meant to tidy away.
- What your tax authority requires of invoice numbering — whether a skipped number is acceptable, whether sequences must be unbroken, whether a fiscal device governs the number at all — is a question for your tax adviser in your jurisdiction. We will produce whatever sequence they specify, and the interpretation stays theirs.
A skipped-number report is the most useful small piece here: the data is already complete, and it turns an audit question into a screen rather than an exercise.
Numbering that fits how you are organised
The sequence machinery is sound and safe under concurrency. What organisations ask for is a different key and a way to answer questions about it.
A branch segment
Numbering per site as well as per organisation, so each location has its own run and a number identifies where it came from.
A skipped-number report
Which numbers in a period were never issued, per document type, produced from the sequence rather than reconstructed.
Configurable formats
Segment order, padding and separators per organisation, for businesses carrying a numbering convention from a previous system.
We publish scope, not dates.
Scope document numberingOur take
A missing invoice number looks like evidence and is usually an artefact of how the run is keyed. Here the run belongs to your organisation, document type and year, it is safe under concurrency, and a number once issued is never renumbered or reused. If an auditor asks about a gap, the answer is specific and checkable — a number never allocated to anything — and that is a better position than a tidy sequence that nobody can account for.
Five questions to ask about document numbering
What is the sequence keyed on?
A good answer sounds like
A named key.
What ours actually is
Organisation, document type and year. No branch segment.
Can two documents get the same number?
A good answer sounds like
No, with the mechanism named.
What ours actually is
No. The sequence row is locked inside a transaction, and the next value is the greater of the counter and the highest number present.
Do numbers ever skip?
A good answer sounds like
An honest answer with a reason.
What ours actually is
Numbers are issued sequentially and never reused, and nothing outside your organisation moves the counter. A number taken by a document that was then abandoned stays unused.
Would you renumber to close a gap?
A good answer sounds like
No.
What ours actually is
No. Those numbers are on documents customers hold, and changing them would make two sets of records disagree silently.
What happens to a cancelled invoice's number?
A good answer sounds like
It stays used.
What ours actually is
It stays used. Cancellation and credit both leave the original document and its number in place, so every issued number still has a document behind it.
If you are preparing for an audit, ask about your gaps first
A jump in an invoice sequence is a five-minute conversation if you know why it is there and a much longer one if you do not. We can walk through your sequences with you, document type by document type.
Talk through numberingFrequently asked questions
Do we have gaps in our invoice numbers?
Your sequences belong to your organisation alone, so nothing another business does creates one. A gap can still appear where a document was abandoned after its number was taken. The fastest check is to list a period's numbers per document type and look for the missing ones — and a skipped-number report that does it for you is something we can add.
Could a gap mean an invoice was deleted?
Not through the ordinary paths. An invoice that should not stand is cancelled or credited, and both leave the original document in place with its number intact — which is precisely why they exist. So a number missing from the sequence is a number that was never allocated to anything, rather than a document that was removed.
Why not just renumber the old documents?
Because those numbers are printed on paperwork your customers hold, quoted in their purchase ledgers, and referenced in remittances and credit notes. Renumbering would make your records and theirs disagree about what a document is called, silently, across every historical document — to make a sequence look neater. A gap with an explanation is a much better position.
Can each of our branches have its own numbering?
Not today. The sequence key is organisation, document type and year, so ten locations share one run and invoice 000412 is your organisation's four hundred and twelfth this year rather than that shop's. A branch segment is the change that separates them and it is the most-requested item on this list.
What happens on the first of January?
A new sequence row is created for the new year and numbering restarts, per document type. The creation is race-safe, so two people issuing the first document of the year at the same moment do not collide — one creates the row, the other finds it and takes the next number.
Does the system guarantee an unbroken sequence going forward?
It issues numbers sequentially and never reuses one, and nothing outside your organisation moves your counter. What no system can promise is that a number issued is a number saved — a document abandoned after its number was taken leaves that number unused. Whether an unbroken sequence is required of you is a question for your tax adviser, and the answer varies more between jurisdictions than most people expect.