projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4f85173
)
[0000101] More wonderful rounding issues
author
Joe Hunt
<joe.hunt.consulting@gmail.com>
Wed, 17 Dec 2008 14:39:28 +0000
(14:39 +0000)
committer
Joe Hunt
<joe.hunt.consulting@gmail.com>
Wed, 17 Dec 2008 14:39:28 +0000
(14:39 +0000)
CHANGELOG.txt
patch
|
blob
|
history
includes/ui/ui_view.inc
patch
|
blob
|
history
purchasing/includes/db/invoice_db.inc
patch
|
blob
|
history
sales/includes/db/sales_credit_db.inc
patch
|
blob
|
history
sales/includes/db/sales_delivery_db.inc
patch
|
blob
|
history
sales/includes/db/sales_invoice_db.inc
patch
|
blob
|
history
diff --git
a/CHANGELOG.txt
b/CHANGELOG.txt
index a26d681887a70fbdcac8974df46b7a37e99fe04a..40d481ce216c664eaadb55f5bab0122471262b69 100644
(file)
--- a/
CHANGELOG.txt
+++ b/
CHANGELOG.txt
@@
-19,6
+19,14
@@
Legend:
! -> Note
$ -> Affected files
! -> 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
16-Dec-2008 Joe Hunt
# [0000100] Keep getting left allocated weird results (rounding problems).
$ /includes/ui/ui_view.inc
diff --git
a/includes/ui/ui_view.inc
b/includes/ui/ui_view.inc
index d30db81b95249d24db56c692929a248af4553862..3aa462f7341c97a307bebb4d4d245f47ff509612 100644
(file)
--- a/
includes/ui/ui_view.inc
+++ b/
includes/ui/ui_view.inc
@@
-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);
{
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())
;
}
}
}
}
diff --git
a/purchasing/includes/db/invoice_db.inc
b/purchasing/includes/db/invoice_db.inc
index fe26bf44d567cae680e124aef047738123b99602..f69ebe404332c9851e05cbfbcbaad3338101030b 100644
(file)
--- a/
purchasing/includes/db/invoice_db.inc
+++ b/
purchasing/includes/db/invoice_db.inc
@@
-118,6
+118,7
@@
function add_supp_invoice($supp_trans) // do not receive as ref because we chang
foreach ($taxes as $taxitem)
{
foreach ($taxes as $taxitem)
{
+ $taxitem['Value'] = round2($taxitem['Value'], user_price_dec());
$tax_total += $taxitem['Value'];
}
$tax_total += $taxitem['Value'];
}
diff --git
a/sales/includes/db/sales_credit_db.inc
b/sales/includes/db/sales_credit_db.inc
index 5629c5286fe9402d919d9e31c7b31f7a780499fc..dfb4c21b1ce244cc88c2431fbc07eed2858db591 100644
(file)
--- a/
sales/includes/db/sales_credit_db.inc
+++ b/
sales/includes/db/sales_credit_db.inc
@@
-31,7
+31,8
@@
function write_credit_note($credit_note, $write_off_acc)
$tax_total = 0;
foreach ($taxes as $taxitem) {
$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) {
}
if ($credit_note->tax_included == 0) {
diff --git
a/sales/includes/db/sales_delivery_db.inc
b/sales/includes/db/sales_delivery_db.inc
index 11aa2f665c0cc57525320e3f8b87824c3d3a39b3..abbf8bb95a1d863c2c9a88a7834b30e1d7138e4d 100644
(file)
--- a/
sales/includes/db/sales_delivery_db.inc
+++ b/
sales/includes/db/sales_delivery_db.inc
@@
-21,6
+21,7
@@
function write_sales_delivery(&$delivery,$bo_policy)
$taxes = $delivery->get_taxes(); // all taxes with freight_tax
foreach ($taxes as $taxitem) {
$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 */
$tax_total += $taxitem['Value'];
}
/* Insert/update the debtor_trans */
diff --git
a/sales/includes/db/sales_invoice_db.inc
b/sales/includes/db/sales_invoice_db.inc
index 798b726e99f6c27a53351c1189c74a466d9e764b..87b9eb7ec580bc0b78f5da9971d903423e670ab4 100644
(file)
--- a/
sales/includes/db/sales_invoice_db.inc
+++ b/
sales/includes/db/sales_invoice_db.inc
@@
-35,6
+35,7
@@
function write_sales_invoice(&$invoice)
$taxes = $invoice->get_taxes(); // all taxes with freight_tax
foreach ($taxes as $taxitem) {
$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'];
}
$ov_gst += $taxitem['Value'];
}