Statuses
How drafts become issued, paid, overdue or cancelled.
Invoicey stores facts—when an invoice was issued, cancelled, and which payment allocations are active—and derives its status whenever it is read. Time can therefore make an unpaid invoice overdue without a nightly status job.
Status at a glance
| Display status | Czech | When it applies |
|---|---|---|
draft | Návrh | Not issued; editable and deletable |
future | Budoucí | Issued with a future issue date |
unpaid | Nezaplaceno | Issued, unpaid and not past due |
overdue | Po splatnosti | Issued, unpaid and past due |
paid | Zaplaceno | Fully covered by active allocations |
cancelled | Stornováno | Cancelled; its number remains consumed |
Priority is cancelled → draft → paid → future → overdue → unpaid. A future invoice never appears
overdue, even when its due date was entered earlier than today.
Payment coverage also exposes a finer payment state on the invoice: unpaid, partial, paid,
or overpaid. Partial and overpaid never rewrite the issued document — they only change how much is
still outstanding.
Domain status vs. display status
Automation returns both status and displayStatus. The domain status keeps
future, unpaid and overdue under issued; the display status is the
finer label shown in lists and filters.
How it is derived
function deriveStatus(invoice, now) {
if (invoice.cancelledAt) return "cancelled";
if (!invoice.issuedAt) return "draft";
if (invoice.paidAt) return "paid"; // set when allocations fully cover the total
if (invoice.issueDate > today(now)) return "future";
return now > endOfDay(invoice.dueDate, "Europe/Prague")
? "overdue"
: "unpaid";
}The due date is a calendar date. An invoice due 2026-05-17 becomes overdue only after that day
ends in Europe/Prague, not at midnight UTC.
Actions and outcomes
| Action | Allowed from | Result |
|---|---|---|
| Save | new or draft | draft |
| Issue | draft | numbered and immutable |
| Mark paid / confirm allocation | open issued invoice | allocation; paid when fully covered |
| Unmark / reverse | allocated invoice | projections recomputed |
| Cancel | issued invoice | cancelled |
| Delete | draft only | permanently removed |
| Duplicate | any status | new draft |
issued → overdue is not a user action. Time passes and the result changes.
Bank match proposals are suggestions only until you confirm them.
Why issued invoices are frozen
After issue, the PDF may be in a client's inbox, the ISDOC in accounting software and a payment in flight against its variable symbol. Editing the database copy would silently make those artifacts disagree.
Use one of the auditable paths instead:
- Wrong client, amount or date: cancel and re-issue.
- Correction after accounting: issue a credit note, then a corrected invoice.
The cancelled document keeps its number, so the sequence still explains itself during an audit.