manufacturingOrdersUpdateCosts
Updates costs on an order’s outputs and inputs.
Business Rules
- Omitted fields remain unchanged; null clears a nullable field.
- When hours and rate are present, their product determines the amount.
- An amount sent with that cost’s hours or rate is refused. Clearing hours or rate while sending an amount is allowed.
- Refresh from BOM sets an output’s labor and packaging amounts to the product’s latest per-unit labor and packaging costs times the planned quantity. It clears their hours and rate, and clears an amount the product does not have a cost for. Overhead and other are unchanged.
- An input’s unit cost is a manual cost; null clears it, keeps the Manual source, and leaves the input unpriced.
- An input sent with a cost source is re-priced from it. BOM uses the current BOM line cost on the output’s revision (live for an active revision, frozen for a superseded one), then the default landed cost, then the default unit cost. Default landed falls back to the default unit cost. The input records the source that priced it. When nothing in the chain has a cost, the input keeps the chosen source and stays unpriced.
- A unit cost can be entered only with the Manual cost source or no cost source.
- An input whose resolved cost and source are unchanged is not recorded as a change.
- An input without a unit cost is unpriced whatever its source, and makes the costs incomplete.
- Costs lock when the order is Closed or Canceled.
- Both manufacturing and supply chain entitlements are required.
Error Scenarios
- “Manufacturing orders are not enabled for this company”
- “Costs cannot be negative.”
- “Costs are too large.”
- “Costs cannot be edited at this status.”
- “Choose Manual to enter a unit cost.”
- “Enter hours and rate, or an amount, not both.”
- “Refresh from BOM sets labor and packaging. Leave their hours, rate, and amount out.”
- “Enter a unit cost, or clear it, for a manual cost.”
- “A line is not on this manufacturing order or appears more than once.”
- “The last undo of SKU did not finish. Undo it again to finish it.”
Permissions Required
manufacturing:update_order_costs
manufacturingOrdersUpdateCosts(
input: ManufacturingOrdersUpdateCostsInput!
): ManufacturingOrder!
Arguments
manufacturingOrdersUpdateCosts.input ● ManufacturingOrdersUpdateCostsInput! non-null input common
Parameters for ManufacturingOrdersUpdateCosts
Type
ManufacturingOrder object manufacturing
An order to make finished products at a building.