[0000101] More wonderful rounding issues
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 17 Dec 2008 14:39:28 +0000 (14:39 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 17 Dec 2008 14:39:28 +0000 (14:39 +0000)
CHANGELOG.txt
includes/ui/ui_view.inc
purchasing/includes/db/invoice_db.inc
sales/includes/db/sales_credit_db.inc
sales/includes/db/sales_delivery_db.inc
sales/includes/db/sales_invoice_db.inc

index a26d681887a70fbdcac8974df46b7a37e99fe04a..40d481ce216c664eaadb55f5bab0122471262b69 100644 (file)
@@ -19,6 +19,14 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+17-Dec-2008 Joe Hunt
+# [0000101] More wonderful rounding issues 
+$ /includes/ui/ui_view.inc
+  /purchasing/includes/db/invoice_db.inc
+  /sales/includes/db/sales_credit_db.inc
+  /sales/includes/db/sales_delivery_db.inc
+  /sales/includes/db/sales_invoice_db.inc
+  
 16-Dec-2008 Joe Hunt
 # [0000100] Keep getting left allocated weird results (rounding problems).
 $ /includes/ui/ui_view.inc
index d30db81b95249d24db56c692929a248af4553862..3aa462f7341c97a307bebb4d4d245f47ff509612 100644 (file)
@@ -453,7 +453,7 @@ function display_edit_tax_items($taxes, $columns, $tax_included, $leftspan=0)
        {
                label_row($taxitem['tax_type_name'] . " (" . $taxitem['rate'] . "%)",
                        number_format2($taxitem['Value'],user_price_dec()), "colspan=$columns align=right", "align=right",$leftspan);
-               $total +=  $taxitem['Value'];
+               $total +=  round2($taxitem['Value'], user_price_dec());
        }
     }
 
index fe26bf44d567cae680e124aef047738123b99602..f69ebe404332c9851e05cbfbcbaad3338101030b 100644 (file)
@@ -118,6 +118,7 @@ function add_supp_invoice($supp_trans) // do not receive as ref because we chang
 
     foreach ($taxes as $taxitem)
     {
+               $taxitem['Value'] =  round2($taxitem['Value'], user_price_dec());
        $tax_total += $taxitem['Value'];
     }
 
index 5629c5286fe9402d919d9e31c7b31f7a780499fc..dfb4c21b1ce244cc88c2431fbc07eed2858db591 100644 (file)
@@ -31,7 +31,8 @@ function write_credit_note($credit_note, $write_off_acc)
 
        $tax_total = 0;
        foreach ($taxes as $taxitem) {
-               $tax_total +=  $taxitem['Value'];
+               $taxitem['Value'] =  round2($taxitem['Value'], user_price_dec());
+               $tax_total += $taxitem['Value'];
        }
 
        if ($credit_note->tax_included == 0) {
index 11aa2f665c0cc57525320e3f8b87824c3d3a39b3..abbf8bb95a1d863c2c9a88a7834b30e1d7138e4d 100644 (file)
@@ -21,6 +21,7 @@ function write_sales_delivery(&$delivery,$bo_policy)
        $taxes = $delivery->get_taxes(); // all taxes with freight_tax
 
        foreach ($taxes as $taxitem) {
+               $taxitem['Value'] =  round2($taxitem['Value'], user_price_dec());
                $tax_total +=  $taxitem['Value'];
        }
        /* Insert/update the debtor_trans */
index 798b726e99f6c27a53351c1189c74a466d9e764b..87b9eb7ec580bc0b78f5da9971d903423e670ab4 100644 (file)
@@ -35,6 +35,7 @@ function write_sales_invoice(&$invoice)
        $taxes = $invoice->get_taxes(); // all taxes with freight_tax
 
        foreach ($taxes as $taxitem) {
+               $taxitem['Value'] =  round2($taxitem['Value'], user_price_dec());
                $ov_gst +=  $taxitem['Value'];
        }