- Shipped
- November 12, 2026 at 1:49 AM UTC
- Author
- Kamo
- Commit
- 216daa2
InvoiceLedger works out amount paid, amount due, credited and refunded totals, PAID_AT and the status from the invoice's total, its credit notes and its payment rows. New statuses PARTIALLY_CREDITED, CREDITED, PARTIALLY_REFUNDED, REFUNDED. Payment rows gain a kind (PAYMENT / REFUND / CREDIT_REFUND, NULL = PAYMENT), the credit note they pay out and a source ref for idempotent order-refund reconciliation. Credit notes gain a disposition (applied / refunded / kept as account credit) and the excess the customer had already paid. Invoice links can name the credit note an email carried. DDL applied by hand as kamo (all nullable, no row rewritten): **************** refunded_total; commerce_invoice_payments.kind, credit_note_id, source_ref; **************** excess_amount; ****************
