The order was for ten valves. The invoice billed ten. The delivery note recorded eight received. The unit price had moved from €12.00 to €12.50. Those are separate exceptions. A warehouse clerk can check the missing pieces. The buyer can check the price against the terms on the order.
That synthetic case was used to test DocMatch, a local invoice reconciliation prototype. The interesting part was getting from the scanned page to a decision someone could check later.
A number needs a column and a source
A text PDF can be read directly. On a scan, optical character recognition supplies the text and its position on the page. A language model can suggest where a field belongs. The application keeps the reference to the original text so a reviewer can open the page and check it.
Finding a number in the source is only one check. One synthetic row listed a quantity of 4, a unit price of 10.00 and a line amount of 40.00. An extraction proposal put the line amount in the unit-price field. All three numbers occurred on the page. The useful check was the position of each number within the table wherever the column layout could be recognised. An unclear field stays open for review.
Check the goods received against what has already been invoiced
Matching a supplier’s VAT number and order reference gets you to the order. The next step is to find the item and put both documents in comparable units. Grams convert to kilograms directly. For cartons, the conversion needs the pack size for that particular item.
Suppose eight pieces have arrived on one purchase order and five have already been confirmed on an earlier invoice. A new invoice for six has to start from the available balance. For one matched item in the same unit, both quantities come from subtracting the pieces already confirmed.
from decimal import Decimal
ordered = Decimal("10")
received = Decimal("8")
already_confirmed = Decimal("5")
open_order = max(Decimal("0"), ordered - already_confirmed) # 5
available_to_match = max(Decimal("0"), received - already_confirmed) # 3
Six would exceed the open order by one and the available receipt quantity by three. The prototype reports each exception separately, subject to the tolerances set for that comparison. It also checks unit price and the net amount. Amounts use decimal arithmetic, with each line rounded to cents before summing the invoice.
The reviewer’s decision belongs with the documents
The review shows the proposed value, the source and the calculation. A reviewer can correct a field or record a reason for accepting a difference. Confirmation stores the values behind the decision and produces a CSV. Later corrections to delivery records feed into open cases. Confirmed cases use their saved snapshot.
Two kinds of duplication come up in the same workflow. A file with identical bytes can be recognised immediately. A new scan of the same invoice has different bytes, so it goes through a separate check against the supplier’s VAT number, invoice number and year. That second check flags a possible duplicate for review.
What to try with another supplier
Before choosing a model for a new set of documents, try an ordinary matched invoice, a partial delivery and a layout with an awkward table. Keep a few examples aside for a later check. Count the fields people had to correct and the discrepancies they missed. Time the review as well as the extraction. A fast reading step can still leave a slow review.
Scan quality, monthly volume, available hardware and data-handling rules all affect that choice. The examples here are synthetic, so the next useful evidence comes from a representative sample of the documents the team actually reviews.
This article was drafted with AI using the prototype and its test cases. Project case study on Silicon LogiX



Top comments (0)