Accounts payable still spends hours on the same loop: open the supplier email, open the PDF, find the PO number, look it up in accounting, and chase mismatches by hand. Template #263 Invoice → PO Matching turns that into a visual workflow you load in Studio — IMAP in, OCR/PDF extract, database lookup, email only when something does not line up.
This guide walks through what the template does, how to seed purchase orders, and how to go live on-prem without writing custom OCR scripts.
Who this is for
- AP clerks and office managers who receive supplier invoices by email
- Teams that already keep purchase orders in SQLite, a synced ERP extract, or a local accounting DB
- Anyone who wants mismatch alerts without a full AP suite
What template #263 automates
- IMAP poll — unread messages; PDF/PNG/JPEG attachments saved to a local folder
- PDF vs image —
pdf.extractTextor Vision OCR - Field extract — supplier, invoice number, PO number, total, currency
- PO lookup — join against
purchase_orders; classifymatched,missing_po, oramount_mismatch - Notify — quiet log on match; SMTP email to AP on mismatch
The template is marked OnPremOnly because IMAP attachments and local OCR stay on your machine — credentials never leave your LAN unless you choose a cloud connector.
One-time setup
- Create the PO table:
CREATE TABLE purchase_orders( po_number TEXT PRIMARY KEY, amount REAL, vendor TEXT ); - In Studio, open Templates (or the home recipe When an invoice hits email…) and load #263.
- Set IMAP credentials, the DB path, and the AP clerk SMTP To address.
- Dry-Run, then Activate and watch Jobs → Schedule.
Why not only “invoice OCR”?
Inbox → OCR → SQLite is useful (#227 / #233 / #44), but AP value is matching. Template #263 closes the loop against purchase orders and only interrupts a person when the PO is missing or the amounts disagree — the Reddit-style chore teams actually complain about.