Fixed correct calculation of stock_moves standard_cost when producing an Advanced...
[fa-stable.git] / manufacturing / includes / db / work_orders_quick_db.inc
index 63c69475d388955c42ef2bf11e30c397abfd9d10..72b5c8df7e0d873a5b2ed3371df46105f21f66ea 100644 (file)
@@ -225,8 +225,11 @@ function work_order_quick_costs($woid, $stock_id, $units_reqd, $date_, $advanced
         0, 0, $memo, -$total_cost);    
                
        //Chaitanya : Update cost of the manufactured item in stock moves table
-       $UnitWOCost = ($total_material_cost + $costs + $labour)/$units_reqd;
-       update_stock_move(ST_WORKORDER, $woid, $stock_id, $UnitWOCost);         
+       if (!$advanced)
+       {
+               $UnitWOCost = ($total_material_cost + $costs + $labour)/$units_reqd;
+               update_stock_move(ST_WORKORDER, $woid, $stock_id, $UnitWOCost); 
+       }       
 }
 
 //--------------------------------------------------------------------------------------