FAILURE MAP
← Case archive

FA-59567 / Subscription proration billing / Member archive

Credit notes and customer balance on an invoice: balance application cap · case 02

Customers with large balances see negative amounts due and a drained balance.

Member previewVariant 2 · 3 implementations · 10 checks per implementation

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 fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression 0[-15268, 0, 0][0, 15268, 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 ↗