From 4ad29b9f2e445b718ddfc014adaa27802720d2e5 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 (cherry picked from commit cb3d6625e87fbc861c11e181cea36f9f9cd329cc) Signed-off-by: Katrin Fischer (cherry picked from commit ff33093591f903c22e251ba694ed59d8a0fb7500) Signed-off-by: Julian Maurice --- 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 ++-- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt | 6 +++--- 5 files changed, 11 insertions(+), 11 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 4c2c8b7708..1611244c35 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -454,7 +454,7 @@ [% FOREACH foot_loo IN book_foot_loop %] - Total (GST [% foot_loo.gstrate * 100 | $Price %]) + Total (GST [% foot_loo.gstrate * 100 %])       @@ -558,7 +558,7 @@ [% books_loo.quantity %] [% books_loo.totalgste | $Price %] [% books_loo.totalgsti | $Price %] - [% books_loo.gstrate * 100 | $Price %] + [% books_loo.gstrate * 100 %] [% books_loo.gstvalue | $Price %] [% books_loo.budget_name %] [% books_loo.suppliers_report %] @@ -671,7 +671,7 @@ [% order.quantity %] [% order.totalgste | $Price %] [% order.totalgsti | $Price %] - [% order.gstrate * 100 | $Price %] + [% order.gstrate * 100 %] [% order.gstvalue | $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 5b8ee465b3..5f1f3fe1f3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt @@ -173,7 +173,7 @@ [% order.quantity %] [% order.totalgste | $Price %] [% order.totalgsti | $Price %] - [% order.gstrate * 100 | $Price %] + [% order.gstrate * 100 %] [% order.gstvalue | $Price %] [% order.budget_name %] @@ -182,7 +182,7 @@ [% FOR tf IN foot_loop %] - Total (GST [% tf.gstrate * 100 | $Price %] %) + Total (GST [% tf.gstrate * 100 %] %) [% tf.quantity %] [% tf.totalgste | $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 805b1a6a02..ded47fbb03 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -562,9 +562,9 @@ $(document).ready(function() 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 c66f2f2549..cdc16fa01f 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.gstrate * 100 | $Price %]%) + Total (GST [% book_foot.gstrate * 100 %]%) [% book_foot.gstvalue | $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 02e143af7b..c9b5145b69 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -278,9 +278,9 @@ function delete_contact(ev) { @@ -340,7 +340,7 @@ function delete_contact(ev) {

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

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

+ [% 0 + gstrate * 100 %] %

[% IF deliverytime.defined %]

Delivery time: [% deliverytime %] days