uid: T-181 title: Service Invoice upload pipeline β PDF-only, no cropping, no substantiation note, manual match hook status: todo area: accounting created: 2026-07-25 updated: 2026-07-25 owner: girafeev1 related: T-178
T-181 β A submission pipeline that fits Service Invoices¶
Why¶
The existing pipeline was built for photographed reimbursement receipts β crumpled, skewed, shot on a phone β so it runs Gemini cleanup, an OpenCV cropper and Document AI verification, and asks for a substantiation note. A service invoice is none of those things. Owner, 2026-07-25:
"most of those invoices are a) computer generated or well formatted and scanned invoice PDF, so it doesn't need any cropping, while b) scanning it for auto-input of invoice information is useful, but c) it shouldn't require substantiation notes. Also, d) auto-match should work only for Service Invoices with the manual input of a auto-match hook (pattern)"
And on formats:
"the submission pipeline for receipts should accept as much image or document format files as possible while I'd say that it would be appropriate for the Service Invoice pipeline to only accept PDF"
Scope¶
- No image cleanup or cropping.
ReceiptUploadModalalready offers an "Upload β skip image cleanup" action for rectified scans; here the skip is not an option, it is the only path. - Keep AI extraction β auto-filling invoice fields is the valuable half.
- Drop the substantiation note. An invoice substantiates itself.
- PDF only. Receipts stay maximally permissive on format; this pipeline rejects anything else.
- Auto-match only on an operator-entered pattern. Precedent to reuse: the WOPC matching-reference
scheme (
#ERL-WOPC|JC-2026-007) already established increate-pending. - Share components with the receipt pipeline where they genuinely coincide; fork where they don't.
Non-goals¶
Housing and tab separation is T-180.
Source¶
Split out of T-178 on 2026-07-25 at the owner's request β verbatim: "Please, if you feel the need, separate the tasks into multiple more tasks as I feel like this one/ two tasks with so many different things might come off as confusing (it's not a bill passed in the senate)." T-178 keeps the reimbursement payment pipeline (WOPC document, Reimbursements tab, issuance); everything about how expense documents are submitted and housed moved here.
Source: Records (Infrastructure) Β· https://claude.ai/code/session_018RDB37kCqfouHdygVXTAtD