On paper, matching supplier invoices to purchase orders and payments is a solved problem. Every ERP can do it, and the logic fits in a few lines:

the-easy-version.sql
SELECT i.invoice_no, p.po_no, b.payment_ref
FROM invoices i
JOIN purchase_orders p ON p.po_no = i.po_no
                      AND p.supplier_id = i.supplier_id
JOIN bank_lines b ON b.amount = i.total
                 AND b.supplier_id = i.supplier_id;

Three keys: PO number, supplier and amount. When all three are clean, the join works and nobody thinks about it again.

The trouble is that real finance data breaks every one of those keys, and it breaks them quietly. Rows that fail the join don't raise an error. They just aren't in the result, so they sit in an "unmatched" report that someone promises to clear at month-end.

Where the join breaks

1. The key is missing or mistyped. Scanned invoices arrive without a PO number, or with one typed by hand: "P0-4471" with a zero instead of the letter O, a missing hyphen, a reference copied from the wrong field. A delivery note quotes the supplier's own order number instead of yours. The join needs an exact match, so a single wrong character drops the row.

2. The same supplier has three names. The vendor master says "Mwanza Steel Limited". The invoice says "MWANZA STEEL LTD". The bank statement says "MWANZA STL (T) LTD" because the bank truncates names. To a person these are obviously one supplier. To a join on supplier name they are three, and a join on supplier ID only works if someone already mapped all three to that ID.

3. One invoice is not one payment. A single invoice is delivered in four shipments and paid in two instalments. A credit note reduces it after a short delivery. Exchange rates move between invoice and payment, so the shilling amount on the bank line doesn't equal the dollar amount on the invoice. The join assumes one invoice matches one payment for the same amount. Real trade rarely works that way.

(The supplier and references above are illustrative, not from a client file.)

Why it matters

In the organisations we work with, around 27% of transactions fall out of the match. That figure is our working estimate from client engagements, not an industry benchmark, and your number will differ. But the pattern is the same everywhere: unmatched items don't disappear. They carry forward, month after month, and they compound. By year-end they are an audit finding, and the people who could have explained them have moved on to other work.