[Bug 25750] New: Fallback to ecost_tax_included, ecost_tax_excluded not happening when no 'Actual cost' entered
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Bug ID: 25750 Summary: Fallback to ecost_tax_included, ecost_tax_excluded not happening when no 'Actual cost' entered Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: alexbuckley@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org The patchsets on bugs 23523 and 23522 set and display respectively the unitprice_tax_included/unitprice_tax_excluded if 'Actual cost' has been entered. If 'Actual cost' is not entered entered then Koha should fallback to ecost_tax_included/ecost_tax_excluded. However the fallback is not working correctly. When 'Actual cost' is not set it has a value of 0.00 and Koha evaluates 0.00 to true so ecost_tax_included/ecost_tax_excluded is never used. e.g. In this fallback: my $cost_tax_included = $line{unitprice_tax_included} || $line{ecost_tax_included}; my $cost_tax_included = 0.00 || 7.23 $cost_tax_included is set to 0.00 as Perl treats 0.00 as true. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 --- Comment #1 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 105866 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105866&action=edit Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded If 'Actual cost' has not been set then it has the value of 0.00 which Perl evaluates to true so this patchset resets it to 0, so the fallback to ecost_tax_included/ecost_tax_excluded happens. Test plan: 1. Add item to acquisition basket (make sure the vendor has: tax rate: 15%, 'List prices: Include tax', 'Invoice prices: Include tax') 2. Set 'Vendor price' = 10 and do not set 'Actual cost' 3. Save order 4. Observe basket.pl shows 'Total tax exc.' has a value of 0.00 and GST column has value of -8.70 5. Jump into the database: select tax_value_on_ordering from aqorders where ordernumber=<ordernumber>; [You can get the ordernumber from clicking on the 'Modify' line the item is listed in] 6. Observe a negative value: -8.70 7. Apply patch and restart plack 8. Add a second item to the basket 9. Set 'Vendor price' = 10 and don't set 'Actual cost' 10. Save order 11. Observe basket.pl shows 'Total tax exc' has value of 8.70 and GST has value of 1.30 12. Repeat step 5 and observe tax_value_on_ordering = 1.30 Sponsored-by: Horowhenua District Council, NZ -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |alexbuckley@catalyst.net.nz |ity.org | Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |major -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105866|0 |1 is obsolete| | --- Comment #2 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 105872 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105872&action=edit Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded If 'Actual cost' has not been set then it has the value of 0.00 which Perl evaluates to true so this patchset resets it to 0, so the fallback to ecost_tax_included/ecost_tax_excluded happens. Test plan: 1. Add item to acquisition basket (make sure the vendor has: tax rate: 15%, 'List prices: Include tax', 'Invoice prices: Include tax') 2. Set 'Vendor price' = 10 and do not set 'Actual cost' 3. Save order 4. Observe basket.pl shows 'Total tax exc.' has a value of 0.00 and GST column has value of -8.70 5. Jump into the database: select tax_value_on_ordering from aqorders where ordernumber=<ordernumber>; [You can get the ordernumber from clicking on the 'Modify' line the item is listed in] 6. Observe a negative value: -8.70 7. Apply patch and restart plack 8. Add a second item to the basket 9. Set 'Vendor price' = 10 and don't set 'Actual cost' 10. Save order 11. Observe basket.pl shows 'Total tax exc' has value of 8.70 and GST has value of 1.30 12. Repeat step 5 and observe tax_value_on_ordering = 1.30 Sponsored-by: Horowhenua District Council, NZ Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Alex, try: $order->{unitprice} += 0; instead. And add a quick test to cover the change. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105872|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 --- Comment #4 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 106217 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106217&action=edit Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded If 'Actual cost' has not been set then it has the value of 0.00 which Perl evaluates to true so this patchset resets it to 0, so the fallback to ecost_tax_included/ecost_tax_excluded happens. Test plan: 1. Add item to acquisition basket (make sure the vendor has: tax rate: 15%, 'List prices: Include tax', 'Invoice prices: Include tax') 2. Set 'Vendor price' = 10 and do not set 'Actual cost' 3. Save order 4. Observe basket.pl shows 'Total tax exc.' has a value of 0.00 and GST column has value of -8.70 5. Jump into the database: select tax_value_on_ordering from aqorders where ordernumber=<ordernumber>; [You can get the ordernumber from clicking on the 'Modify' line the item is listed in] 6. Observe a negative value: -8.70 7. Apply patch and restart plack 8. Add a second item to the basket 9. Set 'Vendor price' = 10 and don't set 'Actual cost' 10. Save order 11. Observe basket.pl shows 'Total tax exc' has value of 8.70 and GST has value of 1.30 12. Repeat step 5 and observe tax_value_on_ordering = 1.30 13. Run t/Prices.t unit test: sudo koha-shell <instancename> prove t/Prices.t Sponsored-by: Horowhenua District Council, NZ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #5 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Jonathan Druart in comment #3): Thanks very much Jonathan. I have made those changes :) Andrew if you have time could you please re-test the patch now? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #106217|0 |1 is obsolete| | --- Comment #6 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 106244 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106244&action=edit Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded If 'Actual cost' has not been set then it has the value of 0.00 which Perl evaluates to true so this patchset resets it to 0, so the fallback to ecost_tax_included/ecost_tax_excluded happens. Test plan: 1. Add item to acquisition basket (make sure the vendor has: tax rate: 15%, 'List prices: Include tax', 'Invoice prices: Include tax') 2. Set 'Vendor price' = 10 and do not set 'Actual cost' 3. Save order 4. Observe basket.pl shows 'Total tax exc.' has a value of 0.00 and GST column has value of -8.70 5. Jump into the database: select tax_value_on_ordering from aqorders where ordernumber=<ordernumber>; [You can get the ordernumber from clicking on the 'Modify' line the item is listed in] 6. Observe a negative value: -8.70 7. Apply patch and restart plack 8. Add a second item to the basket 9. Set 'Vendor price' = 10 and don't set 'Actual cost' 10. Save order 11. Observe basket.pl shows 'Total tax exc' has value of 8.70 and GST has value of 1.30 12. Repeat step 5 and observe tax_value_on_ordering = 1.30 13. Run t/Prices.t unit test: sudo koha-shell <instancename> prove t/Prices.t Sponsored-by: Horowhenua District Council, NZ Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Depends on| |25322 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25322 [Bug 25322] Adding a guarantor with no relationship defaults to first available relationship name -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 --- Comment #7 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Hey Nick, I see you set bug 25322 as a dependent patchset of this bug report. I was wondering did you mean to set something else instead? As Bug 25322 does not touch the Acquisitions module. Thanks, Alex -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|25322 |23522 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23522 [Bug 23522] Show "Actual price" in basket when available https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25322 [Bug 25322] Adding a guarantor with no relationship defaults to first available relationship name -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 --- Comment #8 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Thanks Nick! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #106244|0 |1 is obsolete| | --- Comment #9 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 106410 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106410&action=edit Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded If 'Actual cost' has not been set then it has the value of 0.00 which Perl evaluates to true so this patchset resets it to 0, so the fallback to ecost_tax_included/ecost_tax_excluded happens. Test plan: 1. Add item to acquisition basket (make sure the vendor has: tax rate: 15%, 'List prices: Include tax', 'Invoice prices: Include tax') 2. Set 'Vendor price' = 10 and do not set 'Actual cost' 3. Save order 4. Observe basket.pl shows 'Total tax exc.' has a value of 0.00 and GST column has value of -8.70 5. Jump into the database: select tax_value_on_ordering from aqorders where ordernumber=<ordernumber>; [You can get the ordernumber from clicking on the 'Modify' line the item is listed in] 6. Observe a negative value: -8.70 7. Apply patch and restart plack 8. Add a second item to the basket 9. Set 'Vendor price' = 10 and don't set 'Actual cost' 10. Save order 11. Observe basket.pl shows 'Total tax exc' has value of 8.70 and GST has value of 1.30 12. Repeat step 5 and observe tax_value_on_ordering = 1.30 13. Run t/Prices.t unit test: sudo koha-shell <instancename> prove t/Prices.t Sponsored-by: Horowhenua District Council, NZ Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.11.00 |20.11.00, 20.05.04 released in| | CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 20.05.x for 20.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable CC| |aleisha@catalyst.net.nz Version(s)|20.11.00, 20.05.04 |20.11.00, 20.05.04, released in| |19.11.10 --- Comment #12 from Aleisha Amohia <aleisha@catalyst.net.nz> --- backported to 19.11.x for 19.11.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25750 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #13 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Missing dependencies for 19.05.x, can't backport. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org