A brake shop charges $562.72 for a repair. The customer paid the $85 diagnostic fee at drop-off, and that payment belongs to the same invoice. The card reader at pickup should ask for $477.72.
Here’s a bug that survives an assertion on the balance alone. One implementation records a $562.72 sale and an $85 payment. Another quietly reduces the sale to $477.72 and records no payment. Both can display $477.72 due . Only the first one can explain the $85 receipt the customer is holding.
Reproduce it in a spreadsheet
In the sample workbook, row 19 charges $85 for diagnosing brake noise. The other lines cover labor, pads, rotors and supplies. They bring the subtotal to $544.00. With the sheet’s $18.72 example tax, cell E35 reads $562.72.
Leave the charge in row 19. Enter 85 in E36 ( Amount paid ). E37 ( Balance due ) uses =E35-E36 and changes to $477.72. E35 stays at $562.72.…