An invoice lists two services, then prints a subtotal underneath. An extraction system returns all three rows as items. Every number may have been read correctly, yet summing the output now counts the services twice.
This is a structural error rather than a simple character-recognition error. The workflow needs to distinguish purchased items from summary amounts, taxes, discounts and the final balance.
Define the output before evaluating the model
Use separate fields for the line-item collection and invoice-level summaries. Microsoft’s Document Intelligence invoice documentation describes extraction of invoice information and line items into structured output. Whatever tool you choose, inspect its schema rather than assuming every detected table row is a purchase.
For an invented invoice with items of 40 and 60, a subtotal of 100 is a summary of those items. It should not become a third item that raises the sum to 200. Preserve the original label and page location so a reviewer can see why the row was classified.
Do not force every document into the same arithmetic. Tax-inclusive pricing, discounts, shipping, partial payments and rounding can change the relationship between fields. Store the observed values and explain discrepancies instead of silently rewriting them to balance.
Use reconciliation as a review signal
Check whether the extracted item amounts and summary fields have a plausible relationship under the document’s stated rules. A mismatch should trigger review, not an automatic conclusion that the printed invoice is wrong.
Include test documents where a subtotal appears inside the table, at the top of a new page and beside a carried-forward amount. These cases test classification, not merely whether the model can recognise digits.
Keep confidence values, source coordinates and the unaltered document available to authorised reviewers. Use synthetic or appropriately protected invoices during development. A readable AI response is only the beginning; the useful result preserves what each amount means.

