Some additional fixes to last big committment
[fa-stable.git] / sales / view / view_invoice.php
index 90820a79b2fa16125bab8ddcd49d98a463fbbf1d..c15753b6c2678c80396e32f6cde34d788ba28a0f 100644 (file)
@@ -111,7 +111,8 @@ if (db_num_rows($result) > 0)
            if($myrow2["quantity"]==0) continue;
                alt_table_row_color($k);
 
-               $value = ((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]);
+               $value = round(((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]), 
+                  user_price_dec());
                $sub_total += $value;
 
            if ($myrow2["discount_percent"] == 0)
@@ -120,7 +121,7 @@ if (db_num_rows($result) > 0)
            } 
            else 
            {
-                       $display_discount = number_format2($myrow2["discount_percent"]*100,user_percent_dec()) . "%";
+                       $display_discount = percent_format($myrow2["discount_percent"]*100) . "%";
            }
 
            label_cell($myrow2["stock_id"]);
@@ -137,8 +138,8 @@ if (db_num_rows($result) > 0)
 else
        display_note(_("There are no line items on this invoice."), 1, 2);
 
-$display_sub_tot = number_format2($sub_total,user_price_dec());
-$display_freight = number_format2($myrow["ov_freight"],user_price_dec());
+$display_sub_tot = price_format($sub_total);
+$display_freight = price_format($myrow["ov_freight"]);
 
 /*Print out the invoice text entered */
 label_row(_("Sub-total"), $display_sub_tot, "colspan=6 align=right", 
@@ -148,7 +149,7 @@ label_row(_("Shipping"), $display_freight, "colspan=6 align=right", "nowrap alig
 $tax_items = get_customer_trans_tax_details(10, $trans_id);
 display_customer_trans_tax_details($tax_items, 6);
 
-$display_total = number_format2($myrow["ov_freight"]+$myrow["ov_gst"]+$myrow["ov_amount"]+$myrow["ov_freight_tax"],user_price_dec());
+$display_total = price_format($myrow["ov_freight"]+$myrow["ov_gst"]+$myrow["ov_amount"]+$myrow["ov_freight_tax"]);
 
 label_row(_("TOTAL INVOICE"), $display_total, "colspan=6 align=right",
        "nowrap align=right");