Added rounding when needed to avoid document inconsistency
[fa-stable.git] / reporting / rep107.php
index 7baef1a4daadcb783c316f9f3a6aca3f6684494c..06e30233e0cbedd476e441849ba85acad44a4cd8 100644 (file)
@@ -39,7 +39,7 @@ function print_invoices()
                $from = 0;
        if ($to == null)
                $to = 0;
-       $dec =user_price_dec();
+       $dec = user_price_dec();
 
        $fno = explode("-", $from);
        $tno = explode("-", $to);
@@ -104,7 +104,8 @@ function print_invoices()
                        $SubTotal = 0;
                        while ($myrow2=db_fetch($result))
                        {
-                       $Net = $sign * ((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]);
+                       $Net = round($sign * ((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]), 
+                          user_price_dec());
                        $SubTotal += $Net;
                        $DisplayPrice = number_format2($myrow2["unit_price"],$dec);
                        $DisplayQty = number_format2($sign*$myrow2["quantity"],user_qty_dec());