Bug [0000061] Cost Update doesn't compute correctly after inventory adjust.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 2 Oct 2008 20:34:44 +0000 (20:34 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 2 Oct 2008 20:34:44 +0000 (20:34 +0000)
CHANGELOG.txt
inventory/includes/db/items_adjust_db.inc

index a2c91f83c17911163be767db52c7c2acafaad20a..0d53df4c16ff5ede1798775a12a7294e3c7013a0 100644 (file)
@@ -22,6 +22,8 @@ $ -> Affected files
 04-Oct-2008 Joe Hunt
 # Bug [0000069] Constraint on voiding delivery note if a non voided, linked invoice exists.
 $ /admin/db/voiding_db.inc
+# Bug [0000061] Cost Update doesn't compute correctly after inventory adjust.
+$ /inventory/includes/db/item_adjust_db.inc
 
 01-Oct-2008 Joe Hunt
 # When deleting the last module in FA a parce error arose:
index bd85f6cd8f7ec99a99df049e1f6a5deb0b540459..c824e003b7657063abe207f408614c7d59fe04a9 100644 (file)
@@ -61,6 +61,8 @@ function add_stock_adjustment_item($adj_id, $stock_id, $location, $date_, $type,
        display_db_error("Cannot do inventory adjustment for Service item : $stock_id", "");
     }
 
+       update_average_material_cost(null, $stock_id, $standard_cost, $quantity, $date_);
+
        add_stock_move(systypes::inventory_adjustment(), $stock_id, $adj_id, $location,
         $date_, $reference, $quantity, $standard_cost, $type);
 
@@ -74,7 +76,6 @@ function add_stock_adjustment_item($adj_id, $stock_id, $location, $date_, $type,
 
                add_gl_trans_std_cost(systypes::inventory_adjustment(), $adj_id, $date_, $stock_gl_codes['inventory_account'], 0, 0, $memo_, ($standard_cost * $quantity));
        }
-       update_average_material_cost(null, $stock_id, $standard_cost, $quantity, $date_);
 }
 
 //-------------------------------------------------------------------------------------------------------------