[0000095] Bad behaviour of routine number_format and round in Windows.
[fa-stable.git] / purchasing / includes / ui / invoice_ui.inc
index d72b0dcb95ec4d6697b325dab191bab0dc7a6ebf..88fcfd59bbee596a76618bb28e059acc86643a45 100644 (file)
@@ -27,7 +27,7 @@ function copy_to_trans(&$supp_trans)
        {
                foreach ( $supp_trans->grn_items as $grn)
                {
-                       $supp_trans->ov_amount += round(($grn->this_quantity_inv * $grn->chg_price),
+                       $supp_trans->ov_amount += round2(($grn->this_quantity_inv * $grn->chg_price),
                          user_price_dec());
                }
        }
@@ -344,9 +344,9 @@ function display_grn_items_for_selection(&$supp_trans, $k)
                        null, null, $dec);
             amount_cells(null, 'ChgPrice'.$n, price_format($myrow["unit_price"]));
             if ($supp_trans->is_invoice)
-               amount_cell(round($myrow["unit_price"] * ($myrow["qty_recd"] - $myrow["quantity_inv"]), user_price_dec()));
+               amount_cell(round2($myrow["unit_price"] * ($myrow["qty_recd"] - $myrow["quantity_inv"]), user_price_dec()));
             else       
-               amount_cell(round($myrow["unit_price"] * max($myrow['quantity_inv'], 0), user_price_dec()));
+               amount_cell(round2($myrow["unit_price"] * max($myrow['quantity_inv'], 0), user_price_dec()));
             if ($supp_trans->is_invoice)       
                        submit_cells('grn_item_id'.$n, _("Add"), '', _("Add to Invoice"), true);
                else    
@@ -460,7 +460,7 @@ function display_grn_items(&$supp_trans, $mode=0)
             }
                        qty_cell(abs($entered_grn->this_quantity_inv), true, $dec);
                        amount_cell($entered_grn->chg_price);
-                       amount_cell( round($entered_grn->chg_price * abs($entered_grn->this_quantity_inv), user_price_dec()), true);
+                       amount_cell( round2($entered_grn->chg_price * abs($entered_grn->this_quantity_inv), user_price_dec()), true);
 
                        if ($mode == 1)
                        {
@@ -470,7 +470,7 @@ function display_grn_items(&$supp_trans, $mode=0)
                        }       
                        end_row();
 
-               $total_grn_value += round($entered_grn->chg_price * abs($entered_grn->this_quantity_inv),
+               $total_grn_value += round2($entered_grn->chg_price * abs($entered_grn->this_quantity_inv),
                           user_price_dec());
 
                $i++;