MEGAINFRA-WEBAPP/docs/n8n
DEls 4e5d13950a fix(po-email): book a PO against the site name, not the cost code
The project code on a PO's lines is a cost allocation, not a statement of
where the work is going. MEGCPO9550 is a Cedar Gate delivery -- its subject
says "(Cedar Gate)" and its email subject says "RE: Cedar Gate Paving &
Kerbs PO" -- yet four of its seven lines are billed to C26/08 (Castle Gate)
and three to C26/13 (Cedar Gate). Booking by code would have put a Cedar
Gate PO against Castle Gate, and that risk grows as sites are added.

The site is now read from the name written on the PO: its subject line
first, then its description, then the email subject. A PO naming two sites,
or none, is flagged for review instead of being booked against one of them.
The code is still read and kept on the filed row as po_cost_codes, because
the app's own finalisation step uses it as evidence.

MEGA does not always write a site name the way the app has it, so the name
is also matched without its instance qualifier ("Munyaka" for "Munyaka 2")
and through an explicit table of the spellings seen on real POs ("West Park"
for Wespark, MEGCPO9554; "Nellmpius" for Nellmapius Ext 25, MEGCPO9475).
Without those, POs naming a site would have stopped filing themselves.
2026-11-06 10:25:34 +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): book a PO against the site name, not the cost code 2026-11-06 10:25:34 +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