From cb3d6625e87fbc861c11e181cea36f9f9cd329cc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 9 Nov 2016 09:13:27 +0000 Subject: [PATCH] Bug 14541: Do not truncate tax rate values Tax rates are stored in decimal(6,4) fields which means that 4 decimals are allowed. If a tax rate is 8.42%, it is stored as 0.0842 If a tax rate has more precision than that, Koha won't deal correctly with it. We will need to update the DB structure. With this patch, the tax rate will be displayed with the same precision as in the DB. So if you enter 8.42, you will see 8.42% instead of 8.4% without this patch. Test plan: Do a full acquisition workflow with a tax rate like 8.42% and confirm that it is correctly displayed. Signed-off-by: Alex Buckley Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 6 +++--- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt | 4 ++-- .../intranet-tmpl/prog/en/modules/acqui/neworderempty.tt | 4 ++-- .../intranet-tmpl/prog/en/modules/acqui/orderreceive.tt | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index 77ec72ec6c..c39a9a589a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -481,7 +481,7 @@ [% FOREACH foot_loo IN book_foot_loop %] - Total (GST [% foot_loo.tax_rate * 100 | $Price %]) + Total (GST [% foot_loo.tax_rate * 100 %])       @@ -585,7 +585,7 @@ [% books_loo.quantity %] [% books_loo.total_tax_excluded | $Price %] [% books_loo.total_tax_included | $Price %] - [% books_loo.tax_rate * 100 | $Price %] + [% books_loo.tax_rate * 100 %] [% books_loo.tax_value | $Price %] [% books_loo.budget_name %] [% books_loo.suppliers_report %] @@ -698,7 +698,7 @@ [% order.quantity %] [% order.total_tax_excluded | $Price %] [% order.total_tax_included | $Price %] - [% order.tax_rate * 100 | $Price %] + [% order.tax_rate * 100 %] [% order.tax_value | $Price %] [% order.budget_name %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt index 51f0191f93..9d156efde0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt @@ -179,7 +179,7 @@ [% order.quantity %] [% order.total_tax_excluded | $Price %] [% order.total_tax_included | $Price %] - [% order.tax_rate * 100 | $Price %] + [% order.tax_rate * 100 %] [% order.tax_value | $Price %] [% order.budget_name %] @@ -188,7 +188,7 @@ [% FOR tf IN foot_loop %] - Total (GST [% tf.tax_rate * 100 | $Price %] %) + Total (GST [% tf.tax_rate * 100 %] %) [% tf.quantity %] [% tf.total_tax_excluded | $Price %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt index e8463d1616..7cd5e8001c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -573,9 +573,9 @@ $(document).ready(function() diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index f36ae98c76..b6e790cce1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -335,9 +335,9 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index 57755df4ea..401ab11b5f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -379,7 +379,7 @@ [% FOREACH book_foot IN book_foot_loop %] - Total (GST [% book_foot.tax_rate * 100 | $Price %]%) + Total (GST [% book_foot.tax_rate * 100 %]%) [% book_foot.tax_value | $Price %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt index 4ab50fd203..e8401f559a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -291,9 +291,9 @@ function delete_contact(ev) { @@ -353,7 +353,7 @@ function delete_contact(ev) {

Discount: [% discount | format("%.1f") %] %

Tax rate: - [% 0 + tax_rate * 100 | format("%.1f") %] %

+ [% 0 + tax_rate * 100 %] %

[% IF deliverytime.defined %]

Delivery time: [% deliverytime %] days

-- 2.39.5