0000948: Cost Update form uses cached old cost
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 18 Jul 2011 20:58:27 +0000 (22:58 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 18 Jul 2011 20:58:27 +0000 (22:58 +0200)
inventory/cost_update.php

index 7268d797ab9bde32bdceac23e5a98ada8594991a..b5ee125dd966fab6f3094b8360c60692e950d428 100644 (file)
@@ -38,8 +38,8 @@ if (isset($_GET['stock_id']))
 if (isset($_POST['UpdateData']))
 {
 
-       $old_cost = input_num('OldMaterialCost') + input_num('OldLabourCost')
-           + input_num('OldOverheadCost');
+       $old_cost = get_standard_cost($_POST['stock_id']);
+     
        $new_cost = input_num('material_cost') + input_num('labour_cost')
             + input_num('overhead_cost');
 
@@ -92,9 +92,6 @@ set_global_stock_item($_POST['stock_id']);
 $myrow = get_item($_POST['stock_id']);
 
 div_start('cost_table');
-hidden("OldMaterialCost", $myrow["material_cost"]);
-hidden("OldLabourCost", $myrow["labour_cost"]);
-hidden("OldOverheadCost", $myrow["overhead_cost"]);
 
 start_table(TABLESTYLE2);
 $dec1 = $dec2 = $dec3 = 0;