• DevPilot's avatar
    feat(accounting): wire the cheque-clearing fee into installment intake · 4729ee75
    DevPilot authored
    Finished what last night shipped as configured-but-manual. Mapped the
    Installments module properly this time: cheques for a membership
    installment plan live in `installment_cheques`, a table with no status
    lifecycle and no connection to the accounting cheque system at all
    (negotiable_instruments sits at zero rows) — two insert sites
    (ChequeController::storeBatch / store) plus a historical-backfill path
    in RetroactiveMembershipService.
    
    The fee cannot be folded into the plan's own total: `total_with_interest`
    is recalculated from principal and interest alone
    (InstallmentController::recalculate) and both intake paths hard-validate
    cheques against it — anything added would be silently erased or reported
    as a shortfall. So it bills as its own claim, the same shape as every
    other accrual in this system: Dr member receivable / Cr the clearing-fee
    revenue account already sitting in the chart from last night
    (410540), collected alongside the member's next ordinary payment.
    
    The billing unit is the CHEQUE, not the batch, via a
    `clearing_fee_charged` flag added to installment_cheques — which is also
    the idempotency key. A plan finished across three cashier visits bills
    three times for exactly the cheques each visit added; a retried request
    bills nothing twice. The 102 live cheques already on file are marked
    charged in the same migration — they were handed over before this
    feature existed, and backfilling a charge onto them would invent
    something no member agreed to.
    
    Verified against a scratch copy of production: a fresh 3-cheque batch
    bills exactly 75.00 across 3 receivables, a replay bills nothing, a
    second visit adding 2 more cheques to the same plan bills exactly
    50.00, a branch with no fee configured bills nothing and leaves those
    cheques correctly unbilled (not stuck), and the historical 102 stay
    untouched. Trial balance nets to 0.00.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    4729ee75
Name
Last commit
Last update
..
Academies Loading commit data...
AcademyContracts Loading commit data...
AccessMatrix Loading commit data...
Accounting Loading commit data...
Achievements Loading commit data...
ActivitySubscriptions Loading commit data...
Alerts Loading commit data...
Archive Loading commit data...
Audit Loading commit data...
Auth Loading commit data...
Branches Loading commit data...
Carnets Loading commit data...
Cashier Loading commit data...
Children Loading commit data...
Coaches Loading commit data...
Dashboard Loading commit data...
Death Loading commit data...
Disciplines Loading commit data...
Divorce Loading commit data...
Documents Loading commit data...
Facilities Loading commit data...
FacilityDashboards Loading commit data...
FacilityGrids Loading commit data...
Fines Loading commit data...
Foreign Loading commit data...
Forms Loading commit data...
HR Loading commit data...
Honorary Loading commit data...
Installments Loading commit data...
Interviews Loading commit data...
Inventory Loading commit data...
MatchCenter Loading commit data...
MedicalBoard Loading commit data...
Members Loading commit data...
News Loading commit data...
Notifications Loading commit data...
ParentPortal Loading commit data...
Payments Loading commit data...
PlayerAffairs Loading commit data...
PlayerApi Loading commit data...
PlayerAuth Loading commit data...
PlaygroundAdmin Loading commit data...
PoolManagement Loading commit data...
Pricing Loading commit data...
Procurement Loading commit data...
Receipts Loading commit data...
Rentals Loading commit data...
Reports Loading commit data...
Reservations Loading commit data...
Roles Loading commit data...
Rules Loading commit data...
Sales Loading commit data...
Scheduling Loading commit data...
Seasonal Loading commit data...
ServiceCatalog Loading commit data...
Sessions Loading commit data...
Settings Loading commit data...
Sports Loading commit data...
SportsActivity Loading commit data...
SportsDashboard Loading commit data...
Spouses Loading commit data...
Subscriptions Loading commit data...
Support Loading commit data...
Temporary Loading commit data...
Tournaments Loading commit data...
TrainerPortal Loading commit data...
Training Loading commit data...
TrainingGroups Loading commit data...
Transfers Loading commit data...
Treasury Loading commit data...
Tutorials Loading commit data...
Users Loading commit data...
Waiver Loading commit data...
Workflow Loading commit data...