[ledger] Invoices: supplier, invoice numbers as variable symbols, VAT per rate, paid by a matching statement line, the tax reserve; v0.4.0

This commit is contained in:
2026-11-05 14:44:22 +01:00
parent deb31374ea
commit 0068d4b69a
8 changed files with 886 additions and 5 deletions
+17
View File
@@ -2,6 +2,7 @@
use crate::date::{Date, Timestamp};
use crate::import::StatementLine;
use crate::invoice::{Invoice, InvoiceId, Supplier};
use crate::money::Haler;
use crate::split::Share;
use crate::state::Glyph;
@@ -141,4 +142,20 @@ pub enum EventBody {
/// author replaces the earlier ones; an empty list withdraws them.
#[serde(rename = "subscriptions.shared")]
SubscriptionsShared { budget: BudgetId, names: Vec<String> },
/// Who issues invoices from this ledger, and what share of each paid one is set aside for tax. The latest
/// counts from then on; an invoice keeps the supplier it was issued under.
#[serde(rename = "supplier.set")]
SupplierSet { supplier: Supplier },
#[serde(rename = "invoice.issued")]
InvoiceIssued { invoice: Invoice },
/// Paid: by `payment` (a statement line whose amount and variable symbol match), or marked paid by hand
/// (`None`: cash, another account). The reserve is set aside then.
#[serde(rename = "invoice.paid")]
InvoicePaid { invoice: InvoiceId, payment: Option<PaymentId>, on: Date },
/// Cancelled before it was paid.
#[serde(rename = "invoice.cancelled")]
InvoiceCancelled { invoice: InvoiceId },
/// Money taken out of the tax reserve (the tax or insurance paid from it).
#[serde(rename = "reserve.withdrawn")]
ReserveWithdrawn { withdrawal: String, amount: Haler, on: Date, note: String },
}