Added rounding when needed to avoid document inconsistency
[fa-stable.git] / reporting / rep109.php
index dac0e0563f873d459e78f08d4d17e2c57dbb8825..36d5e491596530557f253a434056cea99e3cf529 100644 (file)
@@ -39,7 +39,7 @@ function print_sales_orders()
                $from = 0;
        if ($to == null)
                $to = 0;
-       $dec =user_price_dec();
+       $dec = user_price_dec();
        
        $cols = array(4, 60, 225, 300, 325, 385, 450, 515);
 
@@ -92,7 +92,8 @@ function print_sales_orders()
                $SubTotal = 0;
                while ($myrow2=db_fetch($result))
                {
-                       $Net = ((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]);
+                       $Net = round(((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]), 
+                          user_price_dec());
                        $SubTotal += $Net;
                        $DisplayPrice = number_format2($myrow2["unit_price"],$dec);
                        $DisplayQty = number_format2($myrow2["quantity"],user_qty_dec());