Bug 14543: Order lines updated that have a tax rate not in gist will have tax rate set to 0!

If the tax rate for a given order line has been removed from the system
preference gist, that tax rate will show in the pulldown as 0. If a
librarian then saves the order line the original tax rate will be
overwritten with 0%!

Test Plan:
1) Find an order line
2) Remove the tax rate set for that order line from the syspref gist
3) Edit the order line
4) Note the tax rate is 0
5) Apply this patch
6) Edit the order line
7) Note the tax rate now displays with a warning

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5ae7554667)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c292fb91a5)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
This commit is contained in:
Kyle M Hall 2015-07-16 12:14:42 -04:00 committed by Aleisha Amohia
parent 7db46079cd
commit 6bdb4287c3
1 changed files with 15 additions and 7 deletions

View File

@ -391,14 +391,22 @@
<li>
<label for="tax_rate">Tax rate: </label>
<select name="tax_rate" id="tax_rate" onchange="updateCosts();">
[% FOREACH gst IN gst_values %]
[% IF ( gst.option == tax_rate ) %]
<option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
[% ELSE %]
<option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
[% END %]
[% END %]
[% SET gst_found = 0 %]
[% FOREACH gst IN gst_values %]
[% IF ( gst.option == tax_rate ) %]
<option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
[% SET gst_found = 1 %]
[% ELSE %]
<option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
[% END %]
[% END %]
[% IF !gst_found %]
<option value="[% tax_rate %]" selected="selected">[% tax_rate * 100 | html %]%</option>
[% END %]
</select>
[% IF !gst_found %]<span class="required">Tax rate not defined in system preference gist!</span>[% END %]
[% ELSE %]
<input type="hidden" name="tax_rate" value="0" />
</li>