Topic: Update material cost when quantity on hand is zero
If we make purchase or produce a work order for an items while quantity on hand of this items is zero then item's material cost will be replaced by last transaction's price.
This is not causing overall problems but makes a small issue which can be seen in Inventory Dashboard:
-Top 10 sold Items shows sold item's cost but in the mentioning case this cost is being constituted by the last items cost that have not been sold.
Why is this important ? In single unit production the price (material cost) of products is rarely the same, even change with large amplitude between orders
I would like to propose new calculation that calculates a more realistic costs for manufacturing items:
lines 106 - 107 of work_order_costing_db.inc should be :
if ($qty > 0 && ($qoh != -$qty)) {
if($qoh == 0 && $avg_cost != 0)
$avg_cost = ($avg_cost + ($unit_cost*$qty_new)/($qoh+$qty))/2;
else
$avg_cost = ($avg_cost*($qoh+$qty_delayed)+$unit_cost*$qty_new)/($qoh+$qty);
}