FA-59563 / Subscription proration billing / Member archive
Credit notes and customer balance on an invoice: excess credit note to balance · case 03
Credit notes larger than the invoice lose their excess value.
Case contract
Input {total, credit_notes, balance, min_payment}. Credit notes apply first, capped at the total; any excess credit-note value joins the customer balance. The balance then applies up to the remaining due. A remaining due above 0 but below min_payment is carried to the next invoice instead of charged. Return [due, balance_after, carried].
Why this case matters
Proration credits land as credit notes and balances whose application order determines the charge.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [0, 0, 0] | [0, 19667, 0] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗