Signed change order raises the supplier POs

When a change order is fully signed, one draft purchase order is created per supplier on its line items — idempotently.

What it is

On the last signature, the change order's line items are grouped by supplier and one draft PO is raised for each, back-referenced to the change order and stamped with an internal memo naming it. Lines with no supplier are ignored. POs are deliberately created as drafts so a human sends them.

Also called: change order to purchase order · auto PO from change order · supplier split

See it
New Change Order — Line Items
Line Items+ Add Line
KindDescriptionSupplierQtyUnitUnit PriceTotal
Material12×12 insulated overhead doors (2)Kaufman Door Supply2ea2480.00$4,960.00×
LaborFrame openings, headers, jamb & track installUnassigned18hr68.00$1,224.00×
Credit (subtracts)Delete one 3068 walk door from base scopeUnassigned1ea640.00-$640.00×
Markup %
12
Tax %
6
Subtotal$5,544.00
Markup (12%) + Tax (6%)$1,037.84
Total$6,581.84
Schedule+3 days
Two new draft POs appearing under two suppliers moments after the last change-order signature. changeOrders.ts `generateSupplierOrdersForChangeOrder`. The real screen, drawn from the product’s own design system. Sample data — no customer information appears here.
How it works
  1. 1Fired without awaiting so signing never blocks on PO generation
  2. 2Existing POs linked to the change order are read first and those suppliers skipped
  3. 3A partial unique index on (change_order_id, supplier_id) makes a double-create impossible even on a retry
  4. 4Errors are collected per supplier so one failure does not stop the rest
Why we built it

Migration 050 records the requirement: 'a change order may combine items sourced from different suppliers. Customer needs to see the breakdown in the portal AND sign each supplier block separately, so each supplier has the legal authorization for THEIR portion.' The draft default is deliberate: 'They've already approved the customer-facing CO; the PO send to the supplier is a separate step that needs human eyes on it.'

The problem
  • An approved change order stalls because nobody raised the orders
  • A retry double-orders
Sound familiar?
What you get
Approved scope turns into orders automatically
A retry can never double-create
A human still presses send

See it on your own jobs

Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.

or keep browsing features →