Quick answer
TL;DR
| Problem | Credit notes reused the invoice path, so they showed the whole order instead of the refund |
| Decision | A one-class, single-refund first fix instead of a multi-week tables-and-revisions rebuild |
| How | Classify each refund into one of ten cases, build only refunded rows, reconcile every total |
| Then | Aggregation across all refunds on an order, and merging of same-kind rows |
| Status | Later removed from the free WordPress.org build of this repository |
| Team | Me, with guidance from Samin Yaser, who wrote the case definitions and full plan |
The problem
The decision
How a refund gets classified
From one refund to every refund
Where this code lives now
FAQ
Why write a smaller plan instead of building the full design?
Why print an adjustment row instead of a fractional quantity?
Why run reconciliation on every case, not just the amount-only one?
Why build aggregation five days after listing it as a non-goal?
Part of the WowInvoice frontend engineering case study series →