mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 01:40:01 +00:00
2d216e24c9
DB triggers on public.owner_ledger_entries (migration applied to prod): charges (debit) -> accounting.invoices; payments (credit) -> accounting.payments_received (deposited=false, Undeposited Funds). Customer balance recomputed authoritatively from the source ledger; ledger payments FIFO-applied to ledger invoices. Keyed external_source='acmacc_ledger'. Backfilled 6,756 invoices + 4,253 payments; balances reconcile exactly. Frontend: customer Ledger tab now renders real payments_received credits (true dates/amounts); Make Deposit page surfaces undeposited payments_received alongside Undeposited Funds transactions and deposits both. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>