Bug 14543

Summary: Order lines updated that have a tax rate not in gist will have tax rate set to 0!
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: AcquisitionsAssignee: Kyle M Hall (khall) <kyle>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: aleisha, jonathan.druart, lisettepalouse+koha, lucas, martin.renvoize, victor
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.01, 19.11.07
Circulation function:
Bug Depends on: 14541    
Bug Blocks:    
Attachments: Bug 14543 - Order lines updated that have a tax rate not in gist will have tax rate set to 0!
Bug 14543: Order lines updated that have a tax rate not in gist will have tax rate set to 0!
Bug 14543: Order lines updated that have a tax rate not in gist will have tax rate set to 0!
Bug 14543: Order lines updated that have a tax rate not in gist will have tax rate set to 0!
Bug 14543: Order lines updated that have a tax rate not in gist will have tax rate set to 0!
Bug 14543: Order lines updated that have a tax rate not in gist will have tax rate set to 0!
Bug 14543: (QA follow-up) Add missing filter

Description Kyle M Hall (khall) 2015-07-16 16:14:32 UTC
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%!
Comment 1 Kyle M Hall (khall) 2015-07-16 16:16:17 UTC
Created attachment 41033 [details] [review]
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
Comment 2 Jonathan Druart 2015-08-28 14:02:27 UTC
I would be happy to test this patch if it was not dependent on bug 14541.
Comment 3 Jonathan Druart 2019-12-03 10:57:47 UTC
Created attachment 95942 [details] [review]
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
Comment 4 Jonathan Druart 2019-12-03 11:21:47 UTC
Created attachment 95943 [details] [review]
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
Comment 5 Lisette Scheer 2020-01-15 22:10:24 UTC
It doesn't warn, but it does keep the old GST even once it has been removed from the gist sys pref. 
I tested in a sandbox.
Comment 6 Jonathan Druart 2020-05-21 12:29:17 UTC
Created attachment 105181 [details] [review]
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
Comment 9 Katrin Fischer 2020-05-22 11:13:12 UTC
Sorry, wrong tab, wrong bug.
Comment 10 Victor Grousset/tuxayo 2020-05-27 16:06:31 UTC
Created attachment 105404 [details] [review]
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>
Comment 11 Victor Grousset/tuxayo 2020-05-27 16:09:43 UTC
It works! :D
Comment 12 Martin Renvoize (ashimema) 2020-06-08 10:13:33 UTC
Created attachment 105629 [details] [review]
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>
Comment 13 Martin Renvoize (ashimema) 2020-06-08 10:13:36 UTC
Created attachment 105630 [details] [review]
Bug 14543: (QA follow-up) Add missing filter

This patch adds a missing `| html` filter to the tax_rate value option
that the patchset adds

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize (ashimema) 2020-06-08 10:14:03 UTC
Works as expected, with QA followup we pass the QA scripts.

Passing QA
Comment 15 Jonathan Druart 2020-06-12 12:17:24 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 16 Lucas Gass (lukeg) 2020-06-17 21:03:11 UTC
backported to 20.05.x for 20.05.01
Comment 17 Aleisha Amohia 2020-06-17 23:35:00 UTC
backported to 19.11.x for 19.11.07
Comment 18 Victor Grousset/tuxayo 2020-06-18 18:43:04 UTC
Can't backport to 19.05.x: can't solve a conflict.
If there is an interest in having this backported, feel free to submit a patch for 19.05.

The following part of the conflict must considered carefully:

Not sure if it's
                    </select>
                    [% END %]
                    [% IF !gst_found %]<span class="required">Tax rate not defined in system preference gist!</span>[% END %]

or

                    </select>
                    [% IF !gst_found %]<span class="required">Tax rate not defined in system preference gist!</span>[% END %]
                    [% END %]