Invoice Reader
Overview
Read invoices (PDF/scan/photo) into clean records, validate the math, and flag anomalies. Built for batches.
Extraction schema
| Field | Notes |
|-------|-------|
| Vendor (name, address, tax IDs) | FR: SIREN/TVA; DZ: NIF/RC/AI |
| Invoice number & date | duplicate-check key |
| Due date / payment terms | |
| Currency | |
| Line items | description, qty, unit price, total |
| Subtotal HT / VAT per rate / Total TTC | |
| Payment details (IBAN) | ⚠ see fraud rules |
Validation checks (every invoice)
- Math: Σ lines = subtotal; subtotal + VAT = total; VAT = rate × base (rounding tolerance)
- Duplicates: same vendor + number, or same amount + date pattern
- Anomalies: amount ≫ vendor's history, new IBAN for a known vendor (🚨 classic fraud - always flag), missing tax IDs, suspicious rounding
Workflow
- Ingest via the
pdf-ocr-extractorpipeline (pdfplumber → OCR fallback for scans/photos). - Extract per schema; every field carries a confidence note; low-confidence values marked
⚠ à vérifier. - Run validations; produce the record + anomaly flags.
- Batch: registre in xlsx via
spreadsheet-analyst- one row per invoice + status column (ok / à vérifier / anomalie). - Optional: due-date reminders (
cron) for payables.
Register format
| # | Fournisseur | N° | Date | HT | TVA | TTC | Échéance | Statut |
Rules
- Never auto-approve a payment - extraction and flags only; decisions are human.
- IBAN changes are always escalated, never silently recorded.
- Keep source files linked to records for audit.