Money
Raising and issuing
Drafting, what issuing does that cannot be undone, gapless numbering, and why a credit note is not an edit.
A new invoice starts as a draft. Nothing about it is fixed and nothing has been promised, so everything can be changed and it can be deleted without leaving a trace.
Lines
A line is a description, a quantity, a unit price, an optional discount and a tax rate. The line's net is the quantity times the price less the discount, rounded once; the tax is computed on that rounded net rather than on an unrounded intermediate, so what is printed adds up to what is charged.
The tax rate on a line is a rate from your own list — see tax — and the line stores the name and the rate as they were as well as the link. A rate you edit next year does not restate a document already sent.
Issuing
- 1
The document is checked
It needs at least one line, a counterparty, a date, and a numbering sequence for its entity and kind. A refusal names which of those is missing rather than saying the document is invalid.
- 2
A number is taken
The next number in the sequence, atomically. This is the only moment a number is allocated.
- 3
The totals are frozen
Net, tax and gross are written onto the document. Nothing recomputes them afterwards.
Issuing cannot be undone
After it, the document cannot be edited and cannot be deleted. It can be voided, which cancels it while keeping the number taken, or credited, which is the correct answer whenever the customer already has it.
Numbering
A sequence belongs to one legal entity and one kind of document, so an invoice and a credit note number independently and two entities never share a series. The format is a prefix, an optional year and a zero-padded counter — GE/2026/0215.
A number is taken when something is issued, never when a draft is created
Draft an invoice and delete it and the sequence has not moved, so there is no hole to explain. This is the whole reason numbering happens at issue rather than at creation, and it is what makes a gap in the series mean something.
Numbering is gapless under concurrency. Six people issuing at the same moment get six consecutive numbers, because the counter is incremented in the database rather than read and written back — a read-then-write hands two people the same number and the collision is only found when the second document is filed.
The format is fixed once anything has been issued on that sequence. Changing a prefix after the fact would make two documents in one series look like they came from different systems, which is exactly what an auditor asks about.
Carrying on from numbers issued elsewhere
An organisation moving here mid-year sets the counter to where its old system reached, and records that the series started after that number. Without the second part, every number before the move would be reported as a missing document forever — on a report whose entire value is that a gap in it means something.
Credit notes
Crediting an issued invoice creates a new document on the credit-note sequence, with every line negated. It exactly reverses the original to the cent, and it points at what it credits so either one answers the question.
A partial credit is an ordinary credit note with the lines edited down while it is still a draft. The link to the original is kept either way.
Payments
A payment is recorded against one or more documents. What it settles on each one is recorded separately, so a single transfer covering three invoices shows on each of them as the part it settled — the balance on a document is always its own, never a share of something larger.
A payment against a draft is refused: there is nothing to settle, because nothing has been promised. A payment in a different currency from the document is refused too, rather than converted at a rate nobody chose.
Ageing
Outstanding documents are bucketed by how far past due they are: not yet due, 1–30 days, 31–60, 61–90, and over 90. Buckets are computed on every read from the due date and the balance, so nothing is ever a day stale.
The due date comes from the counterparty's own payment terms where they are recorded, and thirty days otherwise. It is written onto the document at issue, so changing a customer's terms does not restate what was already promised.