Bugzilla – Attachment 58050 Details for
Bug 14541
Tax rate should not be forced to an arbitrary precision
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14541: Do not truncate tax rate values
Bug-14541-Do-not-truncate-tax-rate-values.patch (text/plain), 9.25 KB, created by
Nick Clemens (kidclamp)
on 2016-12-08 17:20:11 UTC
(
hide
)
Description:
Bug 14541: Do not truncate tax rate values
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-12-08 17:20:11 UTC
Size:
9.25 KB
patch
obsolete
>From 4e33a1b390f156a841abe15efb0abee7f7b094d8 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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 <alexbuckley@catalyst.net.nz> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 6 +++--- > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt | 4 ++-- > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt | 4 ++-- > koha-tmpl/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 77ec72e..c39a9a5 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 %] > <tr> > <th></th> >- <th>Total (GST [% foot_loo.tax_rate * 100 | $Price %])</th> >+ <th>Total (GST [% foot_loo.tax_rate * 100 %])</th> > <th class="tax_excluded"> </th> > <th class="tax_excluded"> </th> > <th class="tax_included"> </th> >@@ -585,7 +585,7 @@ > <td class="number [% IF books_loo.quantity.search(zero_regex) %]error[% END %]">[% books_loo.quantity %]</td> > <td class="number tax_excluded [% IF books_loo.total_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.total_tax_excluded | $Price %]</td> > <td class="number tax_included [% IF books_loo.total_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.total_tax_included | $Price %]</td> >- <td class="number">[% books_loo.tax_rate * 100 | $Price %]</td> >+ <td class="number">[% books_loo.tax_rate * 100 %]</td> > <td class="number [% IF books_loo.tax_value.search(zero_regex) %]error[% END %]">[% books_loo.tax_value | $Price %]</td> > <td>[% books_loo.budget_name %]</td> > <td>[% books_loo.suppliers_report %]</td> >@@ -698,7 +698,7 @@ > <td class="number">[% order.quantity %]</td> > <td class="number tax_excluded">[% order.total_tax_excluded | $Price %]</td> > <td class="number tax_included">[% order.total_tax_included | $Price %]</td> >- <td class="number">[% order.tax_rate * 100 | $Price %]</td> >+ <td class="number">[% order.tax_rate * 100 %]</td> > <td class="number">[% order.tax_value | $Price %]</td> > <td>[% order.budget_name %] > </tr> >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 51f0191..9d156ef 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 @@ > <td class="number">[% order.quantity %]</td> > <td class="number tax_excluded">[% order.total_tax_excluded | $Price %]</td> > <td class="number tax_included">[% order.total_tax_included | $Price %]</td> >- <td class="number">[% order.tax_rate * 100 | $Price %]</td> >+ <td class="number">[% order.tax_rate * 100 %]</td> > <td class="number">[% order.tax_value | $Price %]</td> > <td>[% order.budget_name %]</td> > </tr> >@@ -188,7 +188,7 @@ > <tfoot> > [% FOR tf IN foot_loop %] > <tr> >- <th colspan="2">Total (GST [% tf.tax_rate * 100 | $Price %] %)</th> >+ <th colspan="2">Total (GST [% tf.tax_rate * 100 %] %)</th> > <th class="tax_excluded"/><th class="tax_included"/> > <th>[% tf.quantity %]</th> > <th class="tax_excluded">[% tf.total_tax_excluded | $Price %]</th> >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 e8463d1..7cd5e80 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() > <select name="tax_rate" id="tax_rate" onchange="updateCosts();"> > [% FOREACH gst IN gst_values %] > [% IF ( gst.option == tax_rate ) %] >- <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option> >+ <option value="[% gst.option %]" selected="selected">[% gst.option * 100 %]%</option> > [% ELSE %] >- <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option> >+ <option value="[% gst.option %]">[% gst.option * 100 %]%</option> > [% END %] > [% END %] > </select> >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 f36ae98..b6e790c 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 @@ > <select name="tax_rate" id="tax_rate"> > [% FOREACH gst IN gst_values %] > [% IF gst.option == tax_rate %] >- <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option> >+ <option value="[% gst.option %]" selected="selected">[% gst.option * 100 %]%</option> > [% ELSE %] >- <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option> >+ <option value="[% gst.option %]">[% gst.option * 100 %]%</option> > [% END %] > [% END %] > </select> >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 57755df..401ab11 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 @@ > </tr> > [% FOREACH book_foot IN book_foot_loop %] > <tr> >- <th colspan="10">Total (GST [% book_foot.tax_rate * 100 | $Price %]%)</th> >+ <th colspan="10">Total (GST [% book_foot.tax_rate * 100 %]%)</th> > <th>[% book_foot.tax_value | $Price %]</th> > <th></th> > </tr> >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 4ab50fd..e8401f5 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) { > <select name="tax_rate" id="tax_rate"> > [% FOREACH gst IN gst_values %] > [% IF ( tax_rate == gst.option ) %] >- <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format ("%.1f") %] %</option> >+ <option value="[% gst.option %]" selected="selected">[% gst.option * 100 %] %</option> > [% ELSE %] >- <option value="[% gst.option %]">[% gst.option * 100 | format ("%.1f") %] %</option> >+ <option value="[% gst.option %]">[% gst.option * 100 %] %</option> > [% END %] > [% END %] > </select> >@@ -353,7 +353,7 @@ function delete_contact(ev) { > <p><strong>Discount: </strong> > [% discount | format("%.1f") %] %</p> > <p><strong>Tax rate: </strong> >- [% 0 + tax_rate * 100 | format("%.1f") %] %</p> >+ [% 0 + tax_rate * 100 %] %</p> > [% IF deliverytime.defined %] > <p><strong>Delivery time: </strong> > [% deliverytime %] days</p> >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14541
:
41031
|
41075
|
57363
|
57872
| 58050 |
58051