Skip to content
CogniYukti

Billing

Two people raise the first invoice of the year at the same instant.

In most systems they both get number one. It is discovered weeks later, by an accountant, and the fix is a conversation nobody enjoys.

The answer is a lock, not a retry.

Numbering

Minted at finalising, under a lock, and never reused.

A draft carries no number at all, so abandoning one costs nothing. The number is taken at the moment the invoice becomes real, from a counter held under a lock — two simultaneous finalises serialise rather than colliding.

Voiding does not return the number to the pool. The gap in the sequence is the record, which is exactly what an audit wants to see.

  • The financial year follows the tax regime

    April to March where the regime works that way, the calendar year elsewhere — and receipts and credit notes use the same boundary, so three sequences never disagree about which year it is.

  • The due date is computed once

    At finalising, from the terms in force then, rather than being a rule re-evaluated every time somebody opens the invoice.

  • Addresses are snapshotted

    Copied from the customer when the invoice is drafted. Renaming the account next year does not rewrite what you sent.

  • The document layout is snapshotted too

    So a re-download years later reproduces the layout you had at the time, rather than today's template applied retroactively.

Correcting

There is no edit, and the refusal tells you what to do instead.

Only a draft is editable. Voiding a finalised invoice is allowed — unless a payment has landed against it, in which case the refusal names the route: issue a credit note.

That ordering is deliberate. The payment check runs first so the message is the actionable one rather than a generic complaint about status.

  • An invoice with no lines cannot be finalised

    Which sounds obvious, and is the kind of thing that otherwise ships.

  • The line discount is computed by the database

    Not by the application. A discount that disagrees with its own percentage cannot be written, by any route.

  • So is the balance

    Total minus paid, maintained by the database rather than by whichever code path last touched the invoice.

  • Every state change writes a snapshot

    Finalised, sent, applied, voided — each keeps a copy of the document as it was, alongside the ordinary audit trail.

How does tax get onto a line?

From effective-dated rates matched on the tax class, the entity and the country — and the rate that applies is the one in force on the invoice's own date, so a backdated correction uses that month's rates.

How is the split between tax components decided?

By comparing where you are supplying from with where you are supplying to. Same place, and the rate splits into its two components; different places, and it is a single combined one.

Where do invoices come from?

Five sources: raised by hand, from a deal, from an order line by line, from a placement, and from a retained-search tranche. Plus three that draft themselves — an accepted milestone, approved time, and approved expenses.

Can an invoice be deleted?

No. There is no delete, and a document with a payment against it cannot even be voided.