feat(reports): finance daily invoice export (#38) #113
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/kws!113
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/38-daily-invoice"
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?
What
Finance reports PR B of #38 slice 2: the Daily Invoice Excel export,
GET /v1/admin/reports/finance/daily-invoice/export?from&to[¤cy](admin_portal.finance.manage, platform scope only; max 366 days; two at a time per node).Daily Invoice(per Nairobi day: DR = money received per provider, aWaivedline, CR = revenue recognised at check-in by station,Recognised at salefor vehicle tickets and overstay,Tax,Service charge,Expired unused),Deferred Revenue(roll-forward per currency and station) andSummary(per currency).0029_currency_gl_code(currencies.general_ledger_code, admin-only likeaccount); settings typesledger_code/textand keysgl_mpesa,gl_wallet,gl_recognised_revenue,gl_tax,gl_service_charge,gl_waiver,finance_bank_name.exportDailyInvoiceReport+ live contract test; ADR 0023 and CLAUDE.md updated.Owner defaults (research defaults; all [verify] in ADR 0023)
DR is money received (not legacy's net-of-fee figure); waived sales are their own DR line; vehicle/overstay recognised at completion; expired unused recognised on the Nairobi day of
expires_at; deferred as of the end ofto; no KES conversion; refund-due money excluded. Finance still has to set thegl_*settings andfinance_bank_name; the codes are not assumed.Verification
make cover: 91.0% total (minimum 80%);make lint0 issues;make contractok;go test -race ./...ok; client generation ran.20:59:59Z/21:00:00Zfor completion, check-in, expiry and the deferred cut-off. The roll-forward identity (opening + issued - recognised - cancelled - expired - recognised at sale = closing) is pinned on a mixed fixture.Review
Dual-pass. Pass 1 (ponytail): Must fix none; Should-fix items skipped (shared ledger-code regex, unused label constants, showing
ClosingandClosing (direct)both [kept on purpose as a visible cross-check], Go-side totals). Pass 2 (correctness): 0 Critical; Important (Paid To printed " - KES" when the bank name is unset) fixed in756a710with a test, plus wording fixes; Pass 1 re-check of the fix: Must fix none. The store review found one Important (queries could not use the partial completed-sales index), fixed in0826eec.Known gaps
Closingdiffer fromClosing (direct)for a range that splits those days. Documented in the ADR.shortcut:with the upgrade path of a monthly snapshot job).🤖 Generated with Claude Code