Invoice lines don't add up to the subtotal
BILL-1187: Acme's AP team bounced our October invoice for being a cent off
From: Jonas (Customer Success), forwarding Acme Logistics' accounts-payable teamTue 27 Oct, 10:03 am
Acme AP: Hello, we cannot book invoice INV-2026-10-0412. The line items add up to $299.48, but your subtotal says $299.49. Our tool also prices the seats line (15 seats at $19.99, 10% off) at $269.87, while your PDF says $269.86. Please reissue a corrected invoice. This is the third time since you started showing per-line discounts.
Jonas: I checked with Finance and Acme is right on the seats line: 15 x $19.99 = $299.85, minus 10% = $269.865, which rounds to $269.87 like everyone else's tool does. We have had a handful of these one-cent complaints from other customers since we started offering per-line discounts, and each one costs an AP back-and-forth. Finance says our invoice rules are written down in the repo's README ("Invoice rules, agreed with Finance"), and the draft for this invoice is saved in the repo, so you should be able to see it yourself. I suggested rounding the total up to the next cent so we are never under what customers expect. Finance said no, that is not what the rules say.
Symptom
Some of the invoice's printed lines do not add up to its printed subtotal, and at least one line is a cent lower than the customer's own tool (and Finance) calculate.
Steps to reproduce
- Render the saved draft for Acme's October invoice (
samples/acme-2026-10.json) the way the PDF is made. - Add up the printed lines and compare them with the printed subtotal; compare the seats line with 15 x $19.99 less 10%.
Expected
The invoice follows Finance's rules. For this draft: seats line $269.87, storage line $5.63, subtotal $299.50, sales tax $26.58, total due $326.08. Lines add up to the subtotal exactly, for any invoice, not only this one.
Actual
Team plan seat x15 @ $19.99 (-10%) $269.86
Extra storage (10 GB) x3 @ $2.50 (-25%) $5.62
Priority support x1 @ $49.00 $49.00
Onboarding credit x1 @ -$25.00 -$25.00
Subtotal $299.49
Sales tax 8.875% $26.58
Total due $326.07
© AICodingRound. Ticket text for practice on this site; see Terms.
How it works
- 1Fix the problemin a real codebase.
- 2Use your ownAI, or none.
- 3Submit, then answera few short questions.
- 4Get your gradeand feedback.