From: Janusz Dobrowolski Date: Thu, 17 Jan 2013 10:00:08 +0000 (+0100) Subject: Fixed gettext translations (memos generated by stock_cost_update() and adjust_deliver... X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=6eca77d06e7421fb9a1b3b47bac8c72d1761d241;p=textcart.git Fixed gettext translations (memos generated by stock_cost_update() and adjust_deliveries()) --- diff --git a/includes/db/inventory_db.inc b/includes/db/inventory_db.inc index 037d410..fa465ba 100644 --- a/includes/db/inventory_db.inc +++ b/includes/db/inventory_db.inc @@ -248,8 +248,9 @@ function adjust_deliveries($stock_id, $material_cost, $to) $dec = user_price_dec(); $old_cost = -round2($old_sales_cost-$old_purchase_cost,$dec); $new_cost = -round2($new_sales_cost-$new_purchase_cost,$dec); - - $memo_ = _("Cost was ") . $old_cost. _(" changed to ") . $new_cost . _(" for item ")."'$stock_id'"; + + $memo_ = sprintf(_("Cost was %s changed to %s x quantity on hand for item '%s'"), + number_format2($old_cost, 2), number_format2($new_cost, 2), $stock_id); add_gl_trans_std_cost(ST_COSTUPDATE, $update_no, $to, $stock_gl_code["cogs_account"], $stock_gl_code["dimension_id"], $stock_gl_code["dimension2_id"], $memo_, $diff); diff --git a/inventory/includes/db/items_trans_db.inc b/inventory/includes/db/items_trans_db.inc index 78930e8..3b71bf5 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_)) @@ -57,7 +57,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));