Fixed gettext translations (memos generated by stock_cost_update() and adjust_deliver...
authorJanusz Dobrowolski <janusz@frontaccouting.eu>
Thu, 17 Jan 2013 10:00:08 +0000 (11:00 +0100)
committerJanusz Dobrowolski <janusz@frontaccouting.eu>
Thu, 17 Jan 2013 10:00:08 +0000 (11:00 +0100)
includes/db/inventory_db.inc
inventory/includes/db/items_trans_db.inc

index 037d410171470823e988887dc3d1600c887f921d..fa465ba7b62f9560f77e9cac2b66410275c33386 100644 (file)
@@ -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);           
 
index 78930e81d9bce8ca9dc4132646aa25fa9664ef0e..3b71bf56d6af14d4fc176887ba343de1698ba2ff 100644 (file)
@@ -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));