Wiki · WO master » Path 1 · R593

NS work order — Path 1 · from sales order

One or more SO lines require assembly. WO is created FROM the SO so records stay linked end-to-end. Production runs, Assembly Build entered, FG added to inventory at correct location, then SO is fulfilled. Item Fulfillment fires the ★ automation alert to Finance.

PATH 1 · from sales order WO PO# field TBD
What this is

WO created FROM Sales Order

Path 1 covers the case where one or more lines on a customer SO require assembly. A Work Order is created FROM the SO (workorder.createdfrom = so.id) preserving the SO ↔ WO link end-to-end. Components are reviewed at the correct location, production runs, the Assembly Build is entered in NetSuite (Mike approves at /assembly-build.html), finished goods are added to inventory, then the SO is fulfilled. Item Fulfillment fires the ★ automation alert to Finance; Finance reviews, invoices, monitors terms, applies payment, and closes the order.

Shortcut: if the FG is already on hand at the correct location, fulfill the SO from inventory and close the WO marked unused.

Diagram: ns-work-order-path-1-from-sales-order.html. Master wiki: wiki-ns-work-order-master.html. Other path: Path 2 inventory build. Workflow contract: wo_lifecycle_from_sales_order_path (risk 3).

When to use it

Trigger

★ The handoff

Item Fulfillment closes → events.wo.finance_alert_fired emits → Finance picks up review. Same handoff signal as the SO master.

WO PO# field — TBD pending Mike review

Expected pattern: bodyFields.memo threaded from SO.otherrefnum. Every WO Schema reference flagged TBD until confirmed.

Worked example

Driscoll Melt Mates kit

Driscoll SO #1217 · assembly_line MELT-MATES-KIT-A qty 24

Friday morning. Driscoll SO #1217 (otherrefnum "72622") includes 1 assembly line for Melt Mates kit qty 24. Operator dispatches Path 1; WO-4471 created with createdfrom = 1217 and memo (TBD, expected "72622"). Component review at location 3 (Heartland): CHED-2LB, PRTZL-BAG, TURKEY-PAK on hand. Production runs; crew completes build with 0 waste. Mike approves at /assembly-build.html; NS posts AB-1881 (createdfrom = 4471, quantity_built = 24, location = 3). FG credited: inventory_balance.quantityavailable += 24 for MELT-MATES-KIT-A at location 3. WO close: status='Built'. SO fulfilled: IF-2210 (createdfrom = 1217, otherrefnum "72622"). ★ Automation alert fires. Finance posts CINV-9032 for $18,420 Net 30; payment received + applied; SO closed.

For developers

Code paths + invariants

ConcernWhere
Linkage invariantworkorder.createdfrom = so.id
Assembly Build linkageassemblybuild.createdfrom = wo.id
Item Fulfillment linkageitemfulfillment.createdfrom = so.id (NOT wo.id)
FG creditinventory_balance.quantityavailable += quantity_built at location_id
HITL gate/assembly-build.html → proposed_actions → Mike approves
Finance alert (STUB)events.wo.finance_alert_fired on IF.status='Shipped'
WO PO# field (TBD)bodyFields.memo (expected) = SO.otherrefnum
Changelog

Dated trail

DateRoundChangeTouched by
2026-05-26R593Path 1 wiki created as part of WO master split (matches R592 SO pattern). Split into master + 2 path-details. Mike + Claude.Mike + Claude
Schema · data contract

Path 1 sub-contract spec

Sub-contract: wo_lifecycle_from_sales_order_path · risk 3 · dispatched by WO master when origin = from_sales_order.

Path 1 NS records (field-level)

NS recordKey fieldsSample valuesStatus
SalesOrd (upstream)tranid, otherrefnum"1217", "72622"REAL
WorkOrdtranid, createdfrom, assemblyitem, quantity, location"WO-4471", 1217, "MELT-MATES-KIT-A", 24, 3REAL
WorkOrdbodyFields.memo — customer PO# fieldTBD — expected "72622"TBD — Mike review pending
AsmBuildtranid, createdfrom, quantity_built, waste, location"AB-1881", 4471, 24, 0, 3REAL
ItemShiptranid, createdfrom, otherrefnum, status"IF-2210", 1217 (SO id), "72622", "Shipped"REAL
CustInvctranid, otherrefnum, amount"CINV-9032", "72622", 18420.00REAL
CustPymttranid, appliedto"CPYMT-3120", "CINV-9032"REAL

Path 1 verify_checks

namewindowexpected
wo_linked_to_so60 minwork_orders.createdfrom = so_id
assembly_build_posted2880 minassembly_builds.wo_id has ≥1 row
fg_credited2880 mininventory_balance.quantityavailable increased by build qty at location_id
if_created_from_so2880 minitem_fulfillments.createdfrom = so.id
finance_alert_fired2880 minevents.wo.finance_alert_fired exists for IF (STUB today)
wo_memo_carries_po · TBD2880 minTBD — Mike review pending; expected WO.memo = SO.otherrefnum once confirmed
so_closed43200 mintransactions.status = 'Closed'
Runbook

When Path 1 breaks

Assembly Build done but SO never fulfilled

  1. Verify the link: SELECT id, createdfrom, status FROM work_orders WHERE id=?
  2. If createdfrom is NULL: patch with UPDATE work_orders SET createdfrom=? WHERE id=?
  3. Force resync: POST /api/sync/run?tier=hot&table=transactions&id=<so_id>
  4. Trigger fulfillment manually in NS: from the SO, hit "Fulfill" with the assembly on hand

WO PO# field threading break (pending Mike)

  1. Confirm with Mike: which WO body field carries customer PO#? Expected bodyFields.memo
  2. Until confirmed: trace via createdfrom = so.id linkage only
  3. Schema fix post-confirmation: add WO.memo == SO.otherrefnum verify_check
Backlog

Open questions for Path 1

Related

Adjacent