NS sales order — Path 2 · assembly (Work Orders FROM SO)

SO entry → classify line as assembly → WO created FROM SO → BOM consume → assembly build → FG credit → Item Fulfillment → ★ Finance alert (STUB) → Invoice → payment → close

Path 2 covers assembly build items needing production. For each assembly_line on the SO, a Work Order is created FROM the SO (workorder.createdfrom = so.id), preserving the SO ↔ WO link end-to-end. BOM components are consumed from inventory, the build runs on the production floor (HITL approved by Mike), finished goods are credited, then Item Fulfillment fires. If the finished assembly is already on hand, the shortcut path is to fulfill from inventory and close the WO marked unused. The customer PO# field on the Work Order is TBD pending Mike's review (expected pattern: bodyFields.memo). Workflow: so_lifecycle_assembly_path.

PATH 2 REAL WO PO# field TBD (Mike review) ★ Finance alert pending NS automation

Pipeline — Path 2 deep view (field-level + WO chain)

idle
Path 2 assembly — WO chain with field-level depth + customer PO# threading (WO field TBD) 01 / Email intake 02 / SO entry (otherrefnum captures customer PO#) 03 / WO created FROM SO (createdfrom + memo TBD) 04 / BOM consume · assembly build · FG credit 05 / Item Fulfillment (createdfrom = SO id) 06 / ★ Finance alert (STUB) 07 / Invoice · payment · close WHAT THIS DOES: The system watches two mailboxes for incoming customer orders. Each email carries a customer PO number, which is the trace ID we keep for the whole order. TECHNICAL DETAILS: EMAIL INTAKE. SAMPLE: Driscoll order includes 1 Melt Mates kit assembly line. STATUS: REAL customer email intake orders@ / danielle@ PO# 72622 in body EXTERNAL · INTAKE i WHAT THIS DOES: The team creates the Sales Order in NetSuite. We record who it is for and copy the customer's PO number into otherrefnum, which is the thread we follow. TECHNICAL DETAILS: SALES ORDER (NS SalesOrd) — captures customer PO# as otherrefnum. FIELDS WRITTEN bodyFields.tranid = "1217" bodyFields.otherrefnum = "72622" bodyFields.entity = 2147 THREADING otherrefnum threads to Item Fulfillment + Invoice (Path 2 same as Path 1 for these records) STATUS: REAL Sales Order created in NetSuite otherrefnum = "72622" · tranid = "1217" includes assembly_line for Melt Mates kit D1: transactions + so_lines BACKEND · NS SalesOrd · THREAD START i WHAT THIS DOES: Each line on the order is sorted into one of three paths: pull from stock, build it ourselves, or have the vendor drop-ship it. One order can use all three at once. TECHNICAL DETAILS: CLASSIFY LINE — operator identifies assembly_line. LOGIC: items.itemtype = "Assembly" ACTION: dispatch so_lifecycle_assembly_path STATUS: REAL (operator) classify line · itemtype = Assembly item_code "MELT-MATES-KIT-A" dispatch so_lifecycle_assembly_path SECURITY · classifier · sub-contract i WHAT THIS DOES: A Work Order is created in NetSuite linked back to the Sales Order via createdfrom. TECHNICAL DETAILS: WORK ORDER CREATED FROM SO — preserves SO ↔ WO linkage. NS RECORD: WorkOrd FIELDS WRITTEN bodyFields.tranid = "WO-4471" (NS-assigned) bodyFields.createdfrom = 1217 (SO id) bodyFields.assemblyitem = "MELT-MATES-KIT-A" bodyFields.quantity = 24 bodyFields.memo = (TBD) — Mike's review pending; expected pattern: "72622" carrying the customer PO# threading from the SO THREADING WO field for customer PO# — TBD pending Mike's review Expected: bodyFields.memo = SO.otherrefnum STATUS: REAL (linkage) · TBD (PO# field confirmation) Work Order created FROM SO createdfrom = 1217 (SO id) · tranid = "WO-4471" assemblyitem = "MELT-MATES-KIT-A" · qty = 24 memo = TBD (Mike review pending; expected "72622") MESSAGEBUS · NS WorkOrd · WO PO# FIELD TBD i WHAT THIS DOES: This step is part of the Sales Order lifecycle. See the technical details below. TECHNICAL DETAILS: BOM LOOKUP — components. TABLES READ assembly_bom WHERE assembly_item = "MELT-MATES-KIT-A" SAMPLE COMPONENTS CHED-2LB qty 1; PRTZL-BAG qty 1; TURKEY-PAK qty 1; ... STATUS: REAL BOM lookup assembly_bom rows components: 5 SKUs per kit total components for qty 24 = 120 unit consumes DATABASE · assembly_bom i WHAT THIS DOES: This step is part of the Sales Order lifecycle. See the technical details below. TECHNICAL DETAILS: SHORTCUT BRANCH — if FG on hand, skip build. LOGIC if inventory_balance.quantityavailable("MELT-MATES-KIT-A") >= 24 then: fulfill from inventory; close WO marked "unused" else: continue to BOM consume + build STATUS: REAL (operator decision) shortcut: FG already on hand? if qty_available ≥ so_qty → fulfill from inventory → close WO marked "unused" SECURITY · branch decision i WHAT THIS DOES: The bill-of-materials components are consumed from inventory as the build runs. TECHNICAL DETAILS: BOM CONSUME — debit components from inventory. SQL UPDATE inventory_balance SET quantityavailable -= ? WHERE item_code IN (?...) PER COMPONENT reduce on_hand · log lot if traced STATUS: REAL BOM consume UPDATE inventory_balance SET quantityavailable -= bom.qty * 24 per component DATABASE · raw -− i WHAT THIS DOES: The production crew assembles the finished good and credits it back to inventory. Mike approves the build at /assembly-build.html. TECHNICAL DETAILS: ASSEMBLY BUILD on production floor. NS RECORD: AsmBuild FIELDS bodyFields.createdfrom = "WO-4471" bodyFields.assemblyitem = "MELT-MATES-KIT-A" bodyFields.quantity = 24 bodyFields.custbody_waste = 0 HITL: /assembly-build.html → Mike approves STATUS: REAL assembly build on floor NS AsmBuild · createdfrom = WO-4471 quantity = 24 · waste = 0 HITL: Mike approves at /assembly-build.html MESSAGEBUS · build i WHAT THIS DOES: The production crew assembles the finished good and credits it back to inventory. Mike approves the build at /assembly-build.html. TECHNICAL DETAILS: FG CREDIT — credit assembly to inventory. SQL UPDATE inventory_balance SET quantityavailable += 24 WHERE item_code = "MELT-MATES-KIT-A" STATUS: REAL FG credit to inventory UPDATE inventory_balance SET quantityavailable += 24 item_code = MELT-MATES-KIT-A DATABASE · FG ++ i WHAT THIS DOES: This step is part of the Sales Order lifecycle. See the technical details below. TECHNICAL DETAILS: CLOSE WO. SQL: UPDATE work_orders SET status='Built' WHERE id=4471 STATUS: REAL close WO status = 'Built' WO-4471 BACKEND · WO close i WHAT THIS DOES: All three paths land here. The Item Fulfillment record closes (status=Shipped), inventory is decremented, BOL and ASN are generated. This is what triggers the alert to Finance. TECHNICAL DETAILS: ITEM FULFILLMENT CREATED. NS RECORD: ItemFulfill FIELDS WRITTEN bodyFields.createdfrom = 1217 (SO id, NOT WO id) bodyFields.otherrefnum = "72622" (inherits from SO) bodyFields.status = "Shipped" STATUS: REAL Item Fulfillment created createdfrom = 1217 (SO id) · otherrefnum = "72622" (from SO) BACKEND · item_fulfillments · PO# THREAD → i WHAT THIS DOES: The single named handoff between Operations and Finance. The moment Item Fulfillment is marked Shipped, an alert fires telling Finance to invoice. TECHNICAL DETAILS: ★ FINANCE ALERT (STUB). EVENT: events.so.finance_alert_fired STATUS: STUB ★ automation alert → Finance events.so.finance_alert_fired · STUB until NS workflow FINANCE · ★ KEY HANDOFF i WHAT THIS DOES: Finance posts the invoice in NetSuite. The customer's PO number is copied onto the invoice so the customer can match it on their end. TECHNICAL DETAILS: CUSTOMER INVOICE. FIELDS bodyFields.otherrefnum = "72622" bodyFields.createdfrom = 1217 STATUS: REAL Customer Invoice posted otherrefnum = "72622" createdfrom = 1217 BACKEND · CustInvc i WHAT THIS DOES: We watch the invoice's due date. Current/30/60/90+ buckets are tracked in v_customer_ar_aging. TECHNICAL DETAILS: MONITOR PAYMENT TERMS. VIEW: v_customer_ar_aging STATUS: REAL monitor terms v_customer_ar_aging bucket = current DATABASE · AR aging i WHAT THIS DOES: If the invoice goes past due, the dunning ladder fires (escalating reminder emails at 30, 60, 90+ days until paid or service hold). TECHNICAL DETAILS: PAST DUE → DUNNING. WORKFLOW: ar_aging_action_plan STATUS: REAL workflow past due → dunning ar_aging_action_plan 30 / 60 / 90+ buckets SECURITY · HITL i WHAT THIS DOES: The customer pays. We post a Customer Payment in NetSuite, apply it against the invoice, and AR is reduced. TECHNICAL DETAILS: PAYMENT APPLIED. NS RECORD: CustPymt STATUS: REAL Customer Payment appliedto = invoice id DATABASE · CustPymt i WHAT THIS DOES: Once shipped, invoiced, and paid, the SO is closed. We fire an order.closed event so the customer health watcher updates. TECHNICAL DETAILS: SO CLOSED. SQL: UPDATE transactions SET status='Closed' WHERE id=1217 STATUS: REAL SO → Closed status = 'Closed' BACKEND · close i asm line asm line asm line asm line asm line asm line asm line asm line ★ alert ★ alert TBD: thread SO.otherrefnum → WO.memo LEGEND Path 2 assembly lanes ★ Finance handoff (STUB) TBD — WO PO# field (Mike review pending)

NS records created / updated · field-level detail (Path 2)

StepNS recordFieldSample valueStatus
2SalesOrdbodyFields.otherrefnum (thread start)"72622"REAL
2SalesOrdbodyFields.tranid"1217"REAL
4WorkOrdbodyFields.createdfrom1217 (SO id)REAL
4WorkOrdbodyFields.assemblyitem"MELT-MATES-KIT-A"REAL
4WorkOrdbodyFields.quantity24REAL
4WorkOrdbodyFields.memo — customer PO# field(TBD) expected "72622"TBD — Mike review pending
7(none)inventory_balance.quantityavailable -= bom.qtyD1 UPDATE per componentREAL
8AsmBuildbodyFields.createdfrom"WO-4471"REAL
8AsmBuildbodyFields.quantity24REAL
9(none)inventory_balance.quantityavailable += 24D1 UPDATE for FGREAL
11ItemFulfillbodyFields.createdfrom1217 (SO id)REAL
11ItemFulfillbodyFields.otherrefnum"72622"REAL
12(event)events.event_type"so.finance_alert_fired"STUB
13CustInvcbodyFields.otherrefnum"72622"REAL
17SalesOrdbodyFields.status"Closed"REAL

Customer PO# threading on Path 2 (WO chain)

The customer PO# ("72622" in the running example) threads through these Path 2 records:

Open question for Mike: confirm the WO field that carries the customer PO# (expected: bodyFields.memo). Until confirmed, this is the only TBD field in the entire SO chain.

Sub-contract structured detail

CTR so_lifecycle_assembly_path · risk 3 REAL WO PO# field TBD

Sub-contract dispatched from the master when an so_line classifies as assembly_item. Preserves SO ↔ WO linkage via workorder.createdfrom = so.id. Customer PO# field on the WO is the only field-level TBD across the entire SO chain.
Fan-out targets
create_wo · bom_consume · assembly_build · finished_goods_credit · inventory_shortcut · item_fulfillment · finance_invoice_review · invoice_customer · payment_apply · close_so
Tables touched
work_orders · assembly_bom · assembly_builds · inventory_balance · item_fulfillments · customer_invoices · customer_payments · payment_applications · transactions · events · proposed_actions
HITL gates
/assembly-build.htmlproposed_actions → Mike approves
TBD invariant
if Mike confirms WO.memo = customer PO#, then verify_check: WO.memo == SO.otherrefnum