Problem. api/services/billing_service.py:recompute_invoices reads venues.nightly_cap_weekday/weekend at run time and recomputes the whole current month from scratch each run. An admin changing a cap mid-month therefore re-prices already-played nights at the new cap — retroactive, potentially disputable.
Fix. Snapshot the applicable cap onto each line item (or per period) at play/finalize time and recompute using the snapshotted value, so past nights keep the cap that was in force then.
Problem.
api/services/billing_service.py:recompute_invoicesreadsvenues.nightly_cap_weekday/weekendat run time and recomputes the whole current month from scratch each run. An admin changing a cap mid-month therefore re-prices already-played nights at the new cap — retroactive, potentially disputable.Fix. Snapshot the applicable cap onto each line item (or per period) at play/finalize time and recompute using the snapshotted value, so past nights keep the cap that was in force then.