Skip to main content
Version: v1.0.0(int)

W131: Get work order detail

Returns a single WO with everything the detail page needs: header, items (with received-quantity rollup), recipe snapshot, referenced catalog rows, and the derived material status. Triggered by clicking a WO in the list.

Steps

  1. Load the WO header. Call WorkOrders.getWoById. Includes work-site location name.

  2. Load items with received rollup. Call WorkOrders.listItemsByWo. Each item carries receivedQuantity summed across all receipts so the page can show line-level progress.

  3. Load the recipe snapshot. Call WorkOrders.listInputsByWo to return every snapshot row (material id XOR input SKU id, per-unit quantity, total quantity at WO level, current unitCost).

  4. Hydrate catalog references. Output SKUs from Products.getSkusByIds; input materials from Materials.getMaterialsByIds; input SKUs from Products.getSkusByIds.

  5. Derive materialStatus. Same computation as W130 step 3, scoped to this WO.

Returns

The WO header (with work-site location name) plus items (with receivedQuantity), recipe snapshot (with per-input current unitCost), referenced catalog rows, and materialStatus.

Business rules

  • Recipe snapshot, not live BOM. The detail view shows what this WO will actually consume; the frozen snapshot rules. The live BOM may differ if it has been edited since WO creation.
  • materialStatus reflects current ledger state. Unlike snapshot quantities (frozen), the status is recomputed on every read against current inventory positions.

Errors

  • NotFoundError. The WO was not found.