Small changes in costing by Chaitanya.
[fa-stable.git] / purchasing / includes / db / grn_db.inc
index 56e694b4b47ed856815e1c3130557956dbeb9346..df35e23db60577bda56800421bfbcc337bf679e1 100644 (file)
@@ -13,8 +13,9 @@
 function update_average_material_cost($supplier, $stock_id, $price, $qty, $date, $adj_only=false)
 {
        //Handle if inventory will become negative
-       if (is_inventory_item($stock_id))
-               handle_negative_inventory($stock_id, $qty, $price, $date);
+    //8-OCT-2011 : Skip negative inventory adjustment for case of adjust_only\r
+    if (is_inventory_item($stock_id) && !$adj_only) \r
+        handle_negative_inventory($stock_id, $qty, $price, $date);     
 
        // probably this function should be optimized
        // passing transaction cart as argument. This would