Catching the Duplicate Invoice Before the Payment Leaves
Most payment mistakes in trade are not fraud. They are the same invoice arriving twice and a currency conversion nobody checked.
1. The two errors that keep happening
A supplier sends an invoice by email and again with the shipping documents. Both are entered, both are approved. Or a euro invoice is settled in dollars at a rate different from the one booked.
Each is small against a shipment's value, and each is real money that is slow to recover.
2. Rules before the release, not after
The check runs when a payment is queued: is there already a payment for this invoice, vendor and amount, and does the settled amount equal the invoice amount times the booked rate within a tolerance.
A payment that fails is held with the reason attached, so the person reviewing it knows what to look at.
3. Why the database matters
These checks are only trustworthy if the ledger cannot be half-written. We keep financial records in PostgreSQL transactions, so a payment and its audit result are stored together or not at all.
The sandbox runs both rules on a sample ledger in your browser.