[ledger] Invoices and the tax reserve (v1.1, v0.4.0) #5
Reference in New Issue
Block a user
Delete Branch "feature/invoices"
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?
v1.1's first piece in the core: invoices (faktury) and the tax reserve. Design:
docs/03_invoices.md.What
invoicemodule:Party,Supplier,Invoice,InvoiceLine,Totals, IČO and DIČ checks,line_amount,totals,invoice_number,same_vs,plan_invoice_payments.supplier.set,invoice.issued,invoice.paid,invoice.cancelled,reserve.withdrawn.supplier,invoices,invoice_numbers,invoice_payments,withdrawals;reserve_balance(),next_invoice_number(year),invoice_spayd(id).Decisions (proposals, recorded in the doc)
YYYYNNNNand is also the variable symbol: one string, so it cannot drift from the symbol.paid, thenincome, thenassignedto the invoice's budget), so sharing into a shared budget stays on the explicit-assignment path.Tests
cargo test --workspace: 103 (92 before, plus 10 intests/invoices.rsand 1 rounding unit test). All pass.Mutations, each caught by a failing test: the variable-symbol guard removed, the issue-date guard removed, the reserve set to zero.
Self-review
i128thentry_from; overflow becomesInvoiceError::Total, never a wrap.BTreeMap/Vecin log order; the planner sorts by log order and takes the earliest line in date then log order. Replaying the log twice gives the same state (tested).