Duplicate detection combines vendor ID, invoice number, file hash, amount, and ledger state. The second file may be a retry, correction, or distinct obligation. A credit note has its own identity and relation to the original bill; a model cannot subtract a hypothetical credit to make totals agree. Ask for both file-level and business-level duplicate checks and for the accounting period. Resolve ambiguous identities through the controlled payables workflow before posting.
Make this comfortable
Invoice prompts: distinguish duplicate ingests from credits
Operational case
North Quay's second INV-47 file has the same bytes as the first, so it is a duplicate arrival. The payable ledger still must be checked to learn whether INV-47 was already posted. No credit note appears in the current packet. If one arrives later for the two undelivered units, its vendor, reference, amount, and period will need independent verification. The model cannot preemptively create that missing record.
Upload A hash = Upload B hash
Business invoice candidate: INV-47, one identity
Posted ledger state: check separately
Credit in current packet: none
Second upload: not a second payablePerformance and review cost
Hashing B bytes and checking N candidate ledger records costs O(B+N) with indexed identities. A hash match establishes the same file, while changed formatting can still conceal a duplicate business obligation. Keep both checks so document packaging does not decide payment state.
Common Mistakes
- Do not count a repeated upload as a second payable.
- Do not invent a credit record.
- Do not use a file hash as the only invoice identity.
Connected lessons
- Production prompt engineering
- Prompt Engineering
- Prompt inputs: normalize records before asking for conclusions
- Document prompts: anchor each field to a page and resolve conflicts
- Invoice prompts: pin provenance and vendor identity
- Invoice prompts: anchor each extracted field
- Invoice prompts: recalculate typed charges
- Invoice prompts: match order, receipt, and bill
- Invoice prompts: route exceptions before approval
- Project: reconcile a North Quay invoice exception
- Invoice exception prompt decisions
prompt engineering
invoice operations
