MEGAINFRA-WEBAPP/docs/n8n
DEls 2c97f36ff4 fix(po-email): read the site off the PO's own lines, not just its subject
The site was only looked for in the PO's Subject field and in the email
subject, so a PO that names its site in the Description -- or only in the
project code on its line items -- could not be placed and was flagged for
review. MEGCPO9547 ("Chamberlain PO", Chamberlain is the supplier) gave the
site three ways: Description "Tools (Nellmapius EXT25)" and C26/27 on
every line, while its email subject named nothing.

The site is now resolved from the document itself, in order of how reliable
each signal is: the project code on the PO's own lines, then the site named
in its Description, then its Subject, then the email subject. Only the
line-item block is scanned for project codes, so the "Head office" in a PO's
contact block cannot be mistaken for the HEAD site code, and lines naming
two different sites are left for a human, as MEGA's own finalisation step
treats them.

Also splits the document parsing out of parse_pdf so it can be tested, and
covers it with scripts/test_po_email_intake.py.
2026-11-05 11:15:32 +02:00
..
delivery-note-ocr.md docs(n8n): rewrite for the two-node tick workflow 2026-09-17 15:23:16 +02:00
delivery-reconciliation-api.md fix(dn): harden delivery-note matching, posting and PO reconciliation 2026-09-28 21:16:24 +02:00
po-email-intake.md fix(po-email): read the site off the PO's own lines, not just its subject 2026-11-05 11:15:32 +02:00
po-email-intake.workflow.js feat(po-email): pre-flight duplicate check and filed labels 2026-10-28 23:17:52 +02:00
po-ingest-before-2026-10-04.json Integrate agent work and add dashboard attention indicators 2026-10-04 21:53:32 +02:00
purchase-order-ingest-implementation.md Integrate agent work and add dashboard attention indicators 2026-10-04 21:53:32 +02:00
purchase-order-ingest.md feat(po-email): n8n workflow + runbook to auto-file POs from the MEGA mailbox 2026-10-28 16:07:29 +02:00