Additional Outputs on Production Orders
Having additional outputs on production orders (sometimes refereed to as by-products or reclaimed material) is a common requirement. It could be scrap that should go back into inventory for further processing (melting it down, regrinding it, etc…) or it could be multiple products that are produced at the same time in a process.
This can basically be handled in two ways in Dynamics NAV:
- Negative Consumption
- Adding Production Order Line(s) for Multiple Outputs
In both ways you need to consider both the operational aspect and the inventory costs aspect. Option #1 is easier from an operational point of view since it allows defaulting an item in the Production BOM with a negative quantity and you can back flush it based on the output or have users enter the quantity that goes back into inventory manually. If the additional output should have an inventory value then the better option from an inventory cost aspect is #2 since with this option the additional output can have both Routing and Components that forwards the costs (option #1 is similar to making a positive adjustment from an costing perspective, which should be avoided). The downside with option #2 is that a user manually needs to enter the additional output on the production order. But like with everything else in Dynamics NAV, we might be able to automate it by some simple adjustments to the code.
Something like this could be done:
Create a new table where the additional outputs related to each of the items being produced can be defined, call it ‘Additional Output’. In this table we can then list the additional items that are being produced together with a Production BOM and a Routing to be used to capture the costs.
In this example we are cutting 8 ft bars (item ‘R114-8’) into 7 ft bars (item ‘R114-7’) and during that process we also get 1 ft bars (item ‘R114-1’), one for each time we cut a bar (trying to make it as simple as possible :-)). We define item ‘R114-1’ to be an additional output to item ‘R114-7’ in the new table like this:
The Production BOM ‘R114-1’ has 1/8 (0.125) of the 8 ft bar as a component.
The Routing ‘BACKFLUSH’ is a routing setup with the purpose of back flushing the output only (there are no capacity costs or scheduling involved).
The Production BOM for the 7 ft bar has 7/8 (0.875) of the 8 ft bar.
The Routing for producing the 7 ft bar has some time and capacity costs attached to it (in this example we want all the capacity costs to be applied to the 7 ft bar while the 1 ft bar will only have material costs).
We then modify the Refresh function, by the following: In the ‘Copy’ function of the ‘99000787 – Create Prod. Order Lines’ codeunit we insert a call to a new function that will insert our Additional Output Line(s). In this case we called it ‘InsertAdditionalOutput’.
The function ‘InsertAdditionalOutput’ looks like this:
That’s it!! 🙂
Now when we refresh a production order for the 7 ft bars we also get an additional output line with the 1 ft bars with the Production BOM and Routing according to our new table. Sweet…
Since everything is set to backward flushing we just change the status to finished once the production is done and Dynamics NAV will post all the consumption and outputs creating the following item transactions:
Above you can see that 1/8 of the material costs of the 8 ft bar has been applied to the output of the 1 ft bar. The 7 ft bar has a cost equal to 7/8 of the 8 ft bar plus the capacity costs defined in the routing.
Some things to note:
The planning worksheet (the MRP calculation) will not see the demand triggered by the additional outputs during its calculation, this demand will first show when the order is created.
The code above is for illustration only, use it on your own risk. I know that when you create production orders from the planning worksheet they are not refreshed the same way so this needs to be added as well to codeunit ‘99000813 – Carry Out Action’.
In a future blog I will describe a way to distribute the costs posted against one production order line towards multiple output lines, something that is useful if you for example would like to spread the capacity costs across all outputs.