From 839c9f9d23f7cbe0130f4ccb7b11c11531ceb9e7 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 6daf6838cd..b876aa7f33 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -405,7 +405,7 @@ [% FOREACH foot_loo IN book_foot_loop %] - Total (GST [% foot_loo.gstrate * 100 | $Price %]) + Total (GST [% foot_loo.gstrate * 100 %])       @@ -507,7 +507,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 %] [% IF ( active ) %] @@ -619,7 +619,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 8e8b893a36..7909a00d45 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 7638f0289e..95dba4c42a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -557,9 +557,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 18be9012b4..2da245aa14 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -366,7 +366,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 e0c1a8d1da..7f92b2a54c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -272,9 +272,9 @@ function delete_contact(ev) { @@ -334,7 +334,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

-- 2.39.5