X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=inventory%2Fincludes%2Fdb%2Fitems_trans_db.inc;h=b54c1980748d8e7e06e4076c4789d3c416d9ad87;hb=1571869d54be48452fdbe08f25130972ff0a7b5a;hp=923d18c4f79f5dc65690186196360203e78f1f16;hpb=1528943cad0e936781649f1dee6f7b778618eb60;p=fa-stable.git diff --git a/inventory/includes/db/items_trans_db.inc b/inventory/includes/db/items_trans_db.inc index 923d18c4..b54c1980 100644 --- a/inventory/includes/db/items_trans_db.inc +++ b/inventory/includes/db/items_trans_db.inc @@ -41,7 +41,7 @@ function stock_cost_update($stock_id, $material_cost, $labour_cost, $overhead_co WHERE stock_id=".db_escape($stock_id); db_query($sql,"The cost details for the inventory item could not be updated"); - $qoh = get_qoh_on_date($_POST['stock_id']); + $qoh = get_qoh_on_date($stock_id); $date_ = Today(); if (!is_date_in_fiscalyear($date_)) @@ -63,7 +63,8 @@ function stock_cost_update($stock_id, $material_cost, $labour_cost, $overhead_co { $stock_gl_code = get_stock_gl_code($stock_id); $update_no = get_next_trans_no(ST_COSTUPDATE); - $memo_ = "Cost was " . $last_cost . " changed to " . $new_cost . " x quantity on hand of $qoh"; + $memo_ = sprintf(_("Cost was %s changed to %s x quantity on hand for item '%s'"), + number_format2($last_cost, 2), number_format2($new_cost, 2), $stock_id); add_gl_trans_std_cost(ST_COSTUPDATE, $update_no, $date_, $stock_gl_code["adjustment_account"], $stock_gl_code["dimension_id"], $stock_gl_code["dimension2_id"], $memo_, (-$value_of_change)); @@ -72,7 +73,8 @@ function stock_cost_update($stock_id, $material_cost, $labour_cost, $overhead_co } } - add_audit_trail(ST_COSTUPDATE, $update_no, $date_); + if ($update_no != -1) + add_audit_trail(ST_COSTUPDATE, $update_no, $date_); commit_transaction(); return $update_no;