manufacturingOrdersComplete
Completes one or more lines of an order and records their actual consumption and finished goods.
Business Rules
outputslists only the lines being completed. Lines not listed keep their component hold.inputslists every component of those lines exactly once, and nothing else.- Each line consumes from its own hold, then from other stock at the building.
- Each line can record a processed quantity, in the output’s unit. When it differs from the planned quantity, it replaces the planned quantity and rescales each component’s planned quantity in proportion; the completion keeps both in its history. Undo keeps the new plan. Yield is the completed quantity divided by the planned quantity.
- The completed quantity cannot be more than the processed quantity, which defaults to the planned quantity.
- The order stays In Production after every line completes. Mark Complete moves it to Completed.
- Each output records its own completion date, location, and labor hours. A missing date uses the order’s completion date, and a missing location uses the order-level location sent here, then the output’s own location, then the building’s Default Available location.
- Each output’s finished goods go into that output’s location.
- The order’s completion date is the latest completed line’s date.
- A line’s completion date cannot be on a calendar day before the order’s Actual Start, in the company’s time zone. Future dates are allowed.
- Labor hours replace the output’s labor hours; with a labor rate, the labor amount is recalculated.
- Component stock is consumed; finished goods are added at an Endless-managed building.
- Both manufacturing and supply chain entitlements are required.
Error Scenarios
- “Manufacturing orders are not enabled for this company”
- “Choose at least one line to complete.”
- “Every line must appear exactly once.”
- “SKU is already complete. Undo it to complete it again.”
- “Completed Qty can’t be more than Processed Qty.”
- “Processed Qty must be greater than zero.”
- “Completion date can’t be before Actual Start.”
- “Unarchive SKU before completing this manufacturing order.”
- “The unit of SKU changed since it was held. Revert the order to Draft and allocate it again.”
- “Choose an active location in Building to put finished goods into.”
- “Labor hours cannot be negative.”
- A message names components with insufficient stock.
- “parsec” isn’t a unit we recognize. (Units are matched by name, label, or symbol, ignoring case.)
- “SKU does not hold stock. Revert the order to Draft and allocate it again.”
- “Components were already used for this completion: SKU quantity. Complete it again with these quantities.” when an earlier completion stopped partway.
Permissions Required
manufacturing:complete_order
manufacturingOrdersComplete(
input: ManufacturingOrdersCompleteInput!
): ManufacturingOrder!
Arguments
manufacturingOrdersComplete.input ● ManufacturingOrdersCompleteInput! non-null input common
Parameters for ManufacturingOrdersComplete
Type
ManufacturingOrder object manufacturing
An order to make finished products at a building.