A retailer pays a $1,000.00 invoice with $900.00 cash and a $100.00 "quantity shortage" deduction. The remittance balances, so most AR processes post it and move on. But balancing only proves the arithmetic. Whether the deduction is supported is a second, separate question.

The three steps below are small, but mixing them up is how suppliers lose money on deductions:

  1. Reconcile: expected = cash + deductions + unresolved difference. A difference outside tolerance is never silently turned into a deduction.
  2. Test the rule that was active for that customer on the event date. For a shortage: (invoiced − accepted) × unit price, capped at the claim.
  3. Record recovery as events: a credit memo is a recovery; using that credit on the next invoice is not a second one.
from decimal import Decimal as D def reconcile(expected, cash, deductions, tolerance=D("0.01")): diff = expected - cash - sum(deductions) return {"balanced": abs(diff) <= tolerance, "unresolved": diff} def shortage_rule(invoiced_units, accepted_units, unit_price, claimed): supported = max(0, invoiced_units - accepted_units) * unit_price supported = min(supported, claimed) return {"supported": supported, "dispute_candidate": claimed - supported} class RecoveryLedger: """Credits and cash are separate events; using a credit later is not a second recovery.""" def __init__(self): self.events = [] def credit_memo(self, amount): self.events.append(("credit", amount)) def cash(self, amount): self.events.append(("cash", amount)) def credit_used(self, amount): self.events.append(("credit_used", amount)) def recovered(self): return sum(a for kind, a in self.events if kind in ("credit", "cash")) print(reconcile(D("1000.00"), D("900.00"), [D("100.00")])) # balanced, 0.00 print(shortage_rule(100, 94, D("10.00"), D("100.00"))) # 60.00 / 40.00 led = RecoveryLedger(); led.credit_memo(D("40.00")); led.credit_used(D("40.00")) print(led.recovered()) # 40.00, not 80.00 

The shortage rule gives 6 × $10.00 = $60.00 supported and $40.00 to dispute. When the retailer confirms a $40.00 credit and you apply it later, the ledger still says $40.00 recovered, not $80.00.

Two more cases a real audit needs: a deduction whose receiving record was only requested is "missing evidence" (no conclusion either way), and a second deduction with the same customer, invoice, reason, shipment and amount is a possible duplicate, not a new charge.

These rules are the core of Retail Deductions & Short-Pay Audit ($29 one-time, free demo). It does not file disputes or make legal findings.