docs(billing): document invoice lifecycle and void-vs-cancel (PMS-580) #410
Loading…
Reference in a new issue
No description provided.
Delete branch "docs/PMS-580-invoice-lifecycle"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PMS-580 (found in PMS-560 Invoices smoke)
The smoke test asked: once an invoice is Sent, it cannot be cancelled, only ... is this intended? Yes. This documents the lifecycle so the immutability is no longer a surprise.
What this adds
dev-docs/invoice-lifecycle.md, grounded in the code:models.rsInvoiceStatus,migrations/010_billing.sql): draft, pending, sent, paid, partially_paid, void, written_off. Nocancelledby design.is_frozen()(models.rs) = sent | paid | partially_paid | void | written_off; only draft / pending are editable.update_invoice(service.rs) is the single mutation path and rejects any change (including the transition tovoid) once frozen. So voiding is a pre-send back-out, available only while draft / pending. A sent invoice cannot be edited, cancelled, or voided.record_paymentpath) applies. Correcting a sent invoice belongs to a credit-note flow that is not yet built.AC3 decision (recorded in the doc)
No separate pre-send "cancel" control is needed: Void already backs out a draft / pending invoice and keeps the row for audit. Any relabelling (e.g. "Cancel" while still draft) is a separate UI-copy ticket, not a logic or status change.
Companion change
The UI clarity half of PMS-580 (an inline note on frozen invoices in the detail page) is a separate PR in mokosh-apps.
🤖 Generated with Claude Code