[Bug 18736] New: Problems in order calculations (rounding errors)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Bug ID: 18736 Summary: Problems in order calculations (rounding errors) Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: critical Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org The way we are calculating and/or storing our prices in acquisitions is causing some odd issues. For example: Place an order (no tax, let's not even deal with that right now please) listprice/rrp = 16.99 discount = 42% quantity = 8 estimated calculated at 9.85 but order total is 78.83, but 8 times 9.85 = 78.80 -- 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=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Depends on| |13321 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13321 [Bug 13321] Fix tax and prices calculation -- 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=18736 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 64061 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64061&action=edit Bug 18736 - Problems in order calculations (rounding errors) Unit tests to highlight the issue To test: Prove t/db_dependent/Budgets.t -- 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=18736 --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- The issue we need to decide here is whether we store the extra digits and correct calculations based on these, or store the price with 2 digits precision -- 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=18736 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #3 from Marc Véron <veron@veron.ch> --- We have a similar issue with fines: Bug 15741 - Incorrect rounding in total fines calculations (see comment #12) Bug 17140 - Incorrect rounding in total fines calculations, part 2 -- 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=18736 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 64065 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64065&action=edit Bug 18736: Correctly handle rounding The values displayed should be the sum of the rounded values, not the reverse. In ModReceiveOrder, i am wondering if: tax_value_on_ordering = quantity * format(ecost_tax_excluded) * format(tax_rate_on_ordering) is correct or if it must be: tax_value_on_ordering = quantity * format(ecost_tax_excluded * tax_rate_on_ordering) Note: the second form is used in 16.06.00.042 (bug 13321) -- 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=18736 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |francois.charbonnier@inlibr | |o.com, | |jonathan.druart@bugs.koha-c | |ommunity.org, | |laurence.rault@biblibre.com | |, nicolas.legrand@bulac.fr, | |sonia.bouis@univ-lyon3.fr See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18639 Status|NEW |In Discussion --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Here is my try, for discussion. We must understand and fix everything in one go, we need people that have been involved in bug 13321 and related to confirm the correct behaviours. See also bug 18639. -- 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=18736 Séverine Queune <severine.queune@bulac.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |severine.queune@bulac.fr -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #6 from Nick Clemens <nick@bywatersolutions.com> --- I think we shouldn't round the tax rates - they should be applied with as much precision as possible you have one ROUD where you want ROUND spent.pl will need an update too -- 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=18736 Koha Team Lyon 3 <koha@univ-lyon3.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |koha@univ-lyon3.fr --- Comment #7 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- Hi, what we need in our library is to have the more precise price for order and the exact invoice price. So we sould surely store precise result rather than rounded price. But, people will not understand if we display rounded prices and if the total is calculated on prices with 4 decimals... Perhaps, we souhld display more precise price (4 decimals ?)... I'm not really sure to help in this discussion because I feel that I miss some technical points. Sonia -- 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=18736 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=17140 -- 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=18736 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=15741 -- 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=18736 --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Hi Sonia, So do your invoices from vendors include portions of a cent? It seems most libraries/vendors round to nearest penny in the final calculations so not rounding causes errors. If you have the opposite situation perhaps we need a system preference to control exact vs. rounded prices? -Nick (In reply to Koha Team Lyon 3 from comment #7)
Hi, what we need in our library is to have the more precise price for order and the exact invoice price. So we sould surely store precise result rather than rounded price. But, people will not understand if we display rounded prices and if the total is calculated on prices with 4 decimals... Perhaps, we souhld display more precise price (4 decimals ?)...
I'm not really sure to help in this discussion because I feel that I miss some technical points.
Sonia
-- 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=18736 --- Comment #9 from Marc Véron <veron@veron.ch> --- (In reply to Nick Clemens from comment #8)
Hi Sonia,
So do your invoices from vendors include portions of a cent?
It seems most libraries/vendors round to nearest penny in the final calculations so not rounding causes errors. If you have the opposite situation perhaps we need a system preference to control exact vs. rounded prices?
-Nick
(In reply to Koha Team Lyon 3 from comment #7)
Hi, what we need in our library is to have the more precise price for order and the exact invoice price. So we sould surely store precise result rather than rounded price. But, people will not understand if we display rounded prices and if the total is calculated on prices with 4 decimals... Perhaps, we souhld display more precise price (4 decimals ?)...
I'm not really sure to help in this discussion because I feel that I miss some technical points.
Sonia
To make things a little bit more complicated: Switzerland and Finland round to 5 cents. 1,000–1,024 → 1,00 1,025–1,074 → 1,05 1,075–1,099 → 1,10 See: https://de.wikipedia.org/wiki/Rundung ("Rappenrundung": 5 Rappen (cents) is the smallest coin in Switzerland) -- 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=18736 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I think prices should be stored in 4 decimal digits precision, and so calculations made. Then for display purposes we could provide a way to specify how rounding should be done (number of digits). -- 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=18736 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am not sure if this is only a display issue. Thinking of the calculations we do like adding up the values of all orders to determine the available money. If you store exactly, display rounded, that will never 'add up correctly' and will make people wonder. I wonder how other ILS handle this? -- 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=18736 --- Comment #12 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- (In reply to Nick Clemens from comment #8)
Hi Sonia,
So do your invoices from vendors include portions of a cent?
Hi Nick, Our invoice amount looks like 1453.78 for example. But our colleagues often say us that there's few penny difference between Koha and the invoice amount. It seems really tricky to have the exact calculation so I suppose that rounding only at the last step of calculation (addition of prices of an invoice) could reduce rounding error ?
It seems most libraries/vendors round to nearest penny in the final calculations so not rounding causes errors. If you have the opposite situation perhaps we need a system preference to control exact vs. rounded prices?
Yes, as Finland and Switserland are other rounding pratices, a syspref could be a solution... Sonia -- 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=18736 --- Comment #13 from Marc Véron <veron@veron.ch> --- Independently of the discussion above: Typo in C4/Budgets.pm line 224 SELECT SUM(ROUD(ecost_tax_included, 2)) FROM aqorders -- 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=18736 Bug 18736 depends on bug 13321, which changed state. Bug 13321 Summary: Fix tax and prices calculation https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13321 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- 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=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff Patch complexity|--- |Medium patch -- 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=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #64061|0 |1 is obsolete| | Attachment #64065|0 |1 is obsolete| | --- Comment #14 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 70187 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70187&action=edit Bug 18736 - Add OrerPriceRounding syspref -- 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=18736 --- Comment #15 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 70188 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70188&action=edit Bug 18736 - Use rounding syspref to determine correct prices in calculations To test: Place an order (no tax just for simplicity) listprice/rrp = 16.99 discount = 42% quantity = 8 estimated calculated at 9.85 but order total is 78.83, but 8 times 9.85 = 78.80 Apply patches, set OrderPriceRounding syspref to 'Nearest cent' Not order total is now as expected View ordered.pl and confirm values are correct Complete order, view invoice and confirm values View spent.pl and confirm values Go through acquisitions module and confirm prices throughout are correct. -- 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=18736 --- Comment #16 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 70189 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70189&action=edit Bug 18736 - Unit tests for rounding Unit tests to highlight the issue To test: Prove t/db_dependent/Budgets.t -- 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=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- 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=18736 --- Comment #17 from Nick Clemens <nick@bywatersolutions.com> --- This is an attempt to repair the calculations here by providing a system preference. I only add a 'nearest_cent' option, but I tried to leave things open for further options to be added later. Please test thouroughly and let me know any feedback. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #18 from M. Tompsett <mtompset@hotmail.com> --- Comment on attachment 70187 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70187 Bug 18736 - Add OrerPriceRounding syspref Review of attachment 70187: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=18736&attachment=70187) ----------------------------------------------------------------- ::: installer/data/mysql/atomicupdate/bug18736_add_rounding_syspref.perl @@ +1,3 @@
+$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + # $dbh->do( "INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OrderPriceRounding',NULL,'Local preference for rounding orders before calculations to ensure correct calculations','|nearest_cent','Choice')" );
This line is commented out. Why? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #19 from M. Tompsett <mtompset@hotmail.com> --- Comment on attachment 70188 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70188 Bug 18736 - Use rounding syspref to determine correct prices in calculations Review of attachment 70188: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=18736&attachment=70188) ----------------------------------------------------------------- ::: C4/Acquisition.pm @@ +2010,5 @@
+ +sub _get_rounding_sql { + my $round_string = @_; + my $rounding_pref = C4::Context->preference('OrderPriceRounding'); + if ( $rounding_pref eq "nearest_cent" ) { return ("ROUND($round_string,2)"); }
ROUND() is not ANSI SQL. CEIL($round_string*100)/100 would be ANSI SQL 2003, I believe. ::: C4/Budgets.pm @@ +1291,5 @@
+ +sub _get_rounding_sql { + my $to_round = shift; + my $rounding_pref = C4::Context->preference('OrderPriceRounding'); + if ($rounding_pref eq 'nearest_cent') { return "ROUND($to_round,2)"; }
Same problem here. Not ANSI SQL. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #20 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 70768 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70768&action=edit Bug 18736: Followup - Fix SQL and uncomment db update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #21 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 71062 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71062&action=edit Bug 18736: (follow-up) fix wrong call to _get_rounding_sql -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #22 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 71063 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71063&action=edit Bug 18736 (follow-up) Use CAST instead of CEIL for appropriate rounding -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #23 from M. Tompsett <mtompset@hotmail.com> --- The only thing lacking is test coverage of C4::Budgets::GetBudgetsPlanCell, where some changes were made. This would be a Failed QA, but I know Nick is creating an improve test coverage bug elsewhere to link here, right? :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #24 from M. Tompsett <mtompset@hotmail.com> --- Rebasing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #70187|0 |1 is obsolete| | --- Comment #25 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 71627 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71627&action=edit Bug 18736 - Add OrerPriceRounding syspref -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #70188|0 |1 is obsolete| | --- Comment #26 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 71628 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71628&action=edit Bug 18736 - Use rounding syspref to determine correct prices in calculations To test: Place an order (no tax just for simplicity) listprice/rrp = 16.99 discount = 42% quantity = 8 estimated calculated at 9.85 but order total is 78.83, but 8 times 9.85 = 78.80 Apply patches, set OrderPriceRounding syspref to 'Nearest cent' Not order total is now as expected View ordered.pl and confirm values are correct Complete order, view invoice and confirm values View spent.pl and confirm values Go through acquisitions module and confirm prices throughout are correct. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #70189|0 |1 is obsolete| | --- Comment #27 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 71629 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71629&action=edit Bug 18736 - Unit tests for rounding Unit tests to highlight the issue To test: Prove t/db_dependent/Budgets.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #70768|0 |1 is obsolete| | --- Comment #28 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 71630 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71630&action=edit Bug 18736: Followup - Fix SQL and uncomment db update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71062|0 |1 is obsolete| | --- Comment #29 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 71631 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71631&action=edit Bug 18736: (follow-up) fix wrong call to _get_rounding_sql -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71063|0 |1 is obsolete| | --- Comment #30 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 71632 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71632&action=edit Bug 18736 (follow-up) Use CAST instead of CEIL for appropriate rounding -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Failed QA --- Comment #31 from M. Tompsett <mtompset@hotmail.com> --- The only thing lacking is test coverage of C4::Budgets::GetBudgetsPlanCell, where some changes were made. As a result, this is Failed QA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #32 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to M. Tompsett from comment #31)
The only thing lacking is test coverage of C4::Budgets::GetBudgetsPlanCell, where some changes were made. As a result, this is Failed QA.
Does it mean you tested everything and it works as you expect? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #33 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Jonathan Druart from comment #32)
Does it mean you tested everything and it works as you expect?
No, that was from an eyeball stance only. I just tested what was there, and my Total tax exc. (USD) column is 8?! Regardless of system preference setting. There is a mistake somewhere. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #34 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- Hello, if someone is OK to work on this before the next hackfest in March, I'm OK to test it during the hackfest. Sonia -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #35 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Should we move this to Needs Sign-off for another round of testing or tests first? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71627|0 |1 is obsolete| | Attachment #71628|0 |1 is obsolete| | Attachment #71629|0 |1 is obsolete| | Attachment #71630|0 |1 is obsolete| | Attachment #71631|0 |1 is obsolete| | Attachment #71632|0 |1 is obsolete| | --- Comment #36 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 74335 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74335&action=edit Bug 18736: Add OrderPriceRounding syspref -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #37 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 74336 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74336&action=edit Bug 18736: Use rounding syspref to determine correct prices in calculations To test: Place an order (no tax just for simplicity) listprice/rrp = 16.99 discount = 42% quantity = 8 estimated calculated at 9.85 but order total is 78.83, but 8 times 9.85 = 78.80 Apply patches, set OrderPriceRounding syspref to 'Nearest cent' Not order total is now as expected View ordered.pl and confirm values are correct Complete order, view invoice and confirm values View spent.pl and confirm values Go through acquisitions module and confirm prices throughout are correct. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #38 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 74337 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74337&action=edit Bug 18736: Unit tests for rounding Unit tests to highlight the issue To test: Prove t/db_dependent/Budgets.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #39 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 74338 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74338&action=edit Bug 18736: (follow-up) - Fix SQL and uncomment db update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #40 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 74339 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74339&action=edit Bug 18736: (follow-up) fix wrong call to _get_rounding_sql -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #41 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 74340 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74340&action=edit Bug 18736: (follow-up) Use CAST instead of CEIL for appropriate rounding -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #42 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 74341 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74341&action=edit Bug 18736: (follow-up) Correctly assign values in subroutines -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #43 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 74342 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74342&action=edit Bug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell prove t/db_dependent/Budgets.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #44 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 74370 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74370&action=edit Bug 18736: Follow to prevent duplicate run noise TEST PLAN --------- update the database twice -- noise apply patch update the database -- no noise -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #45 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 74371 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74371&action=edit Bug 18736: Follow to clean up admin policy preference Two preferences were merged into the same box. This likely was unintended. This reformats them. TEST PLAN --------- Go to Acquisitions tab of the system preference -- in the policy section PurgeSuggestionsOlderThan and OrderPriceRounding are in the same box Apply this patch Refresh the page -- OrderPriceRounding is in its own box, and better formatted. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #46 from M. Tompsett <mtompset@hotmail.com> --- Need test for GetLateOrders with both settings of OrderPriceRounding. Other feedback still may follow. I'll summarize in one final comment afterwards. It would be nice to also trigger the else case for the dbdriver, but that might take some expert mocking, which is low priority as mysql/mariadb are the preferred db drivers. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #47 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 74374 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74374&action=edit Bug 18736: [DO NOT PUSH] C4/Acquisition print scaffolding. Need to trigger all the print STDERR "C4/Acquisition.pm... cases. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #48 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 74397 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74397&action=edit Bug 18736: [DO NOT PUSH] Print scaffolding for C4/Budgets.pm The ELSE case is a pain. Please get it to return something rather than undef. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #49 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 74398 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74398&action=edit Bug 18736: Add missing test cases [BUGGY] The ELSE case is flawed. This needs fixing. The third parameter is budgets, and needs to be valid. It currently is passing, because undef+0= 0, and the expected values are set to zero. They should be non-zero! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #74398|0 |1 is obsolete| | --- Comment #50 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 74422 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74422&action=edit Bug 18736: (follow-up) Add missing test cases We now fully cover GetBudgetsPlanCell in these tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #51 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 74427 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74427&action=edit Bug 18736: (follow-up) Undo changes to GetLateOrders GetLateOrders calculates subtotal based on rrp which is a 2 decimal precision field. If we need more precision here it should be fixed on a separate bug -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #52 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 74438 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74438&action=edit Bug 18736: Follow up tests Test coverage for new C4::Acquisition functions. prove t/Acquisition/_get_rounding_sql.t prove t/Acquisition/get_rounded_price.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #53 from M. Tompsett <mtompset@hotmail.com> --- All Acquisition.pm and Budgets.pm changes are fully covered. Obsoleting the scaffolding. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #74374|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=18736 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #74397|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=18736 --- Comment #54 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to M. Tompsett from comment #52)
prove t/Acquisition/_get_rounding_sql.t prove t/Acquisition/get_rounded_price.t
Create subtests in t/Acquisition.t instead. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #55 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Marc Véron from comment #9)
To make things a little bit more complicated: Switzerland and Finland round to 5 cents. 1,000–1,024 → 1,00 1,025–1,074 → 1,05 1,075–1,099 → 1,10
See: https://de.wikipedia.org/wiki/Rundung ("Rappenrundung": 5 Rappen (cents) is the smallest coin in Switzerland)
Canada has something similar, but only when paying with cash. 1.00-1.02 -> 1.00 1.03-1.07 -> 1.05 1.08-1.12 -> 1.10 But I think improving the rounding for 5 cent issues should be another followup bug on this. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |colin.campbell@ptfs-europe. | |com --- Comment #56 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Need to test with year end process. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 David Roberts <david.roberts@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david.roberts@ptfs-europe.c | |om -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Fiona Borthwick <fiona.borthwick@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fiona.borthwick@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |martin.renvoize@ptfs-europe | |.com --- Comment #57 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Sorry guys, can't get this set to apply right now: Applying: Bug 18736: (follow-up) Undo changes to GetLateOrders error: sha1 information is lacking or useless (C4/Acquisition.pm). error: could not build fake ancestor -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #74335|0 |1 is obsolete| | Attachment #74336|0 |1 is obsolete| | Attachment #74337|0 |1 is obsolete| | Attachment #74338|0 |1 is obsolete| | Attachment #74339|0 |1 is obsolete| | Attachment #74340|0 |1 is obsolete| | Attachment #74341|0 |1 is obsolete| | Attachment #74342|0 |1 is obsolete| | Attachment #74370|0 |1 is obsolete| | Attachment #74371|0 |1 is obsolete| | Attachment #74422|0 |1 is obsolete| | Attachment #74427|0 |1 is obsolete| | Attachment #74438|0 |1 is obsolete| | --- Comment #58 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76979 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76979&action=edit Bug 18736: Add OrderPriceRounding syspref -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #59 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76980 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76980&action=edit Bug 18736: Use rounding syspref to determine correct prices in calculations To test: Place an order (no tax just for simplicity) listprice/rrp = 16.99 discount = 42% quantity = 8 estimated calculated at 9.85 but order total is 78.83, but 8 times 9.85 = 78.80 Apply patches, set OrderPriceRounding syspref to 'Nearest cent' Not order total is now as expected View ordered.pl and confirm values are correct Complete order, view invoice and confirm values View spent.pl and confirm values Go through acquisitions module and confirm prices throughout are correct. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #60 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76981 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76981&action=edit Bug 18736: Unit tests for rounding Unit tests to highlight the issue To test: Prove t/db_dependent/Budgets.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #61 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76982 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76982&action=edit Bug 18736: (follow-up) - Fix SQL and uncomment db update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #62 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76983 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76983&action=edit Bug 18736: (follow-up) fix wrong call to _get_rounding_sql -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #63 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76984 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76984&action=edit Bug 18736: (follow-up) Use CAST instead of CEIL for appropriate rounding -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #64 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76985 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76985&action=edit Bug 18736: (follow-up) Correctly assign values in subroutines -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #65 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76986 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76986&action=edit Bug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell prove t/db_dependent/Budgets.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #66 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76987 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76987&action=edit Bug 18736: Follow to prevent duplicate run noise TEST PLAN --------- update the database twice -- noise apply patch update the database -- no noise -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #67 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76988 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76988&action=edit Bug 18736: Follow to clean up admin policy preference Two preferences were merged into the same box. This likely was unintended. This reformats them. TEST PLAN --------- Go to Acquisitions tab of the system preference -- in the policy section PurgeSuggestionsOlderThan and OrderPriceRounding are in the same box Apply this patch Refresh the page -- OrderPriceRounding is in its own box, and better formatted. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #68 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76989 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76989&action=edit Bug 18736: (follow-up) Add missing test cases We now fully cover GetBudgetsPlanCell in these tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #69 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76990 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76990&action=edit Bug 18736: (follow-up) Undo changes to GetLateOrders GetLateOrders calculates subtotal based on rrp which is a 2 decimal precision field. If we need more precision here it should be fixed on a separate bug -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #70 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 76991 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76991&action=edit Bug 18736: (follow-up) Unit tests Test coverage for new C4::Acquisition functions. prove t/Acquisition.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #71 from Nick Clemens <nick@bywatersolutions.com> --- Applied cleanly on master for me - I moved additional tests to subtest in Acquisition.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff --- Comment #72 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- There is no signoff! Please test! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |julian.maurice@biblibre.com --- Comment #73 from Julian Maurice <julian.maurice@biblibre.com> --- Patches do not apply. Please rebase -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76979|0 |1 is obsolete| | Attachment #76980|0 |1 is obsolete| | Attachment #76981|0 |1 is obsolete| | Attachment #76982|0 |1 is obsolete| | Attachment #76983|0 |1 is obsolete| | Attachment #76984|0 |1 is obsolete| | Attachment #76985|0 |1 is obsolete| | Attachment #76986|0 |1 is obsolete| | Attachment #76987|0 |1 is obsolete| | Attachment #76988|0 |1 is obsolete| | Attachment #76989|0 |1 is obsolete| | Attachment #76990|0 |1 is obsolete| | Attachment #76991|0 |1 is obsolete| | --- Comment #74 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 77614 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77614&action=edit Bug 18736: Add OrderPriceRounding syspref -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #75 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 77615 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77615&action=edit Bug 18736: Use rounding syspref to determine correct prices in calculations To test: Place an order (no tax just for simplicity) listprice/rrp = 16.99 discount = 42% quantity = 8 estimated calculated at 9.85 but order total is 78.83, but 8 times 9.85 = 78.80 Apply patches, set OrderPriceRounding syspref to 'Nearest cent' Not order total is now as expected View ordered.pl and confirm values are correct Complete order, view invoice and confirm values View spent.pl and confirm values Go through acquisitions module and confirm prices throughout are correct. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #76 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 77616 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77616&action=edit Bug 18736: Unit tests for rounding Unit tests to highlight the issue To test: Prove t/db_dependent/Budgets.t prove t/Acquisition.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #77 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 77617 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77617&action=edit Bug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell prove t/db_dependent/Budgets.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #78 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 77618 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77618&action=edit Bug 18736: (follow-up) Add missing test cases We now fully cover GetBudgetsPlanCell in these tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #79 from Julian Maurice <julian.maurice@biblibre.com> --- There are a few problems: - 'use C4::Acquisition' is missing in acqui/spent.pl - acqui/order.pl uses aqorders.ecost, which for me is already rounded in the database ('9.85'), so the amount doesn't change when I change the syspref value (it's like syspref is always "Round") - same for reports/orders_by_fund.pl - In admin/aqbudgets.pl, the amount doesn't change when I change the syspref value (it's like syspref is always "Don't round") - The result of get_rounded_price is often used in multiplication, but this is wrong because get_rounded_price use Koha::Number::Format and this can return strings that are not valid numbers (ex: "1,234.000") -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #80 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 78101 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78101&action=edit Bug 18736: (follow-up) Fix missing rounding and bad formatting This patch: Adds a missing use Uses 'Koha::Number::Price->round()' instead of 'format()' to ensure numeric returns Ensures too big numbers don't crash round() Uses syspref in 'GetBudgetHierarchy' To test: Follow previous test plan Check values on admin/aqbudgets.pl are affected by syspref Ensure values throughout acquisitions are correctly calculated/displayed (even when greater than 1,000) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #81 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Julian Maurice from comment #79)
There are a few problems: - 'use C4::Acquisition' is missing in acqui/spent.pl
Fixed!
- acqui/order.pl uses aqorders.ecost, which for me is already rounded in the database ('9.85'), so the amount doesn't change when I change the syspref value (it's like syspref is always "Round") - same for reports/orders_by_fund.pl
ecost is a 2 decimal precision number - beyond the scope here
- In admin/aqbudgets.pl, the amount doesn't change when I change the syspref value (it's like syspref is always "Don't round")
Fixed
- The result of get_rounded_price is often used in multiplication, but this is wrong because get_rounded_price use Koha::Number::Format and this can return strings that are not valid numbers (ex: "1,234.000")
I switched to round(), this should return numeric values -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #82 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 78120 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78120&action=edit Bug 18736: Unit tests doe GetBudgetHierarchy prove -v t/db_dependent/Budgets.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply CC| |m.de.rooy@rijksmuseum.nl --- Comment #83 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Applying: Bug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell fatal: sha1 information is lacking or useless (C4/Budgets.pm). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #77614|0 |1 is obsolete| | Attachment #77615|0 |1 is obsolete| | Attachment #77616|0 |1 is obsolete| | Attachment #77617|0 |1 is obsolete| | Attachment #77618|0 |1 is obsolete| | Attachment #78101|0 |1 is obsolete| | Attachment #78120|0 |1 is obsolete| | --- Comment #84 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 78981 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78981&action=edit Bug 18736: Add OrderPriceRounding syspref -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #85 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 78982 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78982&action=edit Bug 18736: Use rounding syspref to determine correct prices in calculations To test: Place an order (no tax just for simplicity) listprice/rrp = 16.99 discount = 42% quantity = 8 estimated calculated at 9.85 but order total is 78.83, but 8 times 9.85 = 78.80 Apply patches, set OrderPriceRounding syspref to 'Nearest cent' Not order total is now as expected View ordered.pl and confirm values are correct Complete order, view invoice and confirm values View spent.pl and confirm values Go through acquisitions module and confirm prices throughout are correct. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #86 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 78983 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78983&action=edit Bug 18736: Unit tests for rounding Unit tests to highlight the issue To test: Prove t/db_dependent/Budgets.t prove t/Acquisition.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #87 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 78984 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78984&action=edit Bug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell prove t/db_dependent/Budgets.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #88 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 78985 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78985&action=edit Bug 18736: (follow-up) Add missing test cases We now fully cover GetBudgetsPlanCell in these tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #89 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 78986 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78986&action=edit Bug 18736: (follow-up) Fix missing rounding and bad formatting This patch: Adds a missing use Uses 'Koha::Number::Price->round()' instead of 'format()' to ensure numeric returns Ensures too big numbers don't crash round() Uses syspref in 'GetBudgetHierarchy' To test: Follow previous test plan Check values on admin/aqbudgets.pl are affected by syspref Ensure values throughout acquisitions are correctly calculated/displayed (even when greater than 1,000) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #90 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 78987 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78987&action=edit Bug 18736: Unit tests for GetBudgetHierarchy prove -v t/db_dependent/Budgets.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #91 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 78988 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78988&action=edit Bug 18736: (follow-up) cast as UNSIGNED instead of INTEGER -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #92 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 78986 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78986 Bug 18736: (follow-up) Fix missing rounding and bad formatting Review of attachment 78986: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=18736&attachment=78986) ----------------------------------------------------------------- ::: Koha/Number/Price.pm @@ +19,4 @@
use Modern::Perl;
+use Number::Format qw( format_price round );
As these subs are used as Number::Format object's methods, I don't think importing them is necessary. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #93 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Nick Clemens from comment #91)
Created attachment 78988 [details] [review] Bug 18736: (follow-up) cast as UNSIGNED instead of INTEGER
Can you tell in the commit message why you are doing that ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #78981|0 |1 is obsolete| | Attachment #78982|0 |1 is obsolete| | Attachment #78983|0 |1 is obsolete| | Attachment #78984|0 |1 is obsolete| | Attachment #78985|0 |1 is obsolete| | Attachment #78986|0 |1 is obsolete| | Attachment #78987|0 |1 is obsolete| | Attachment #78988|0 |1 is obsolete| | --- Comment #94 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 79087 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79087&action=edit Bug 18736: Add OrderPriceRounding syspref -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #95 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 79088 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79088&action=edit Bug 18736: Use rounding syspref to determine correct prices in calculations To test: Place an order (no tax just for simplicity) listprice/rrp = 16.99 discount = 42% quantity = 8 estimated calculated at 9.85 but order total is 78.83, but 8 times 9.85 = 78.80 Apply patches, set OrderPriceRounding syspref to 'Nearest cent' Not order total is now as expected View ordered.pl and confirm values are correct Complete order, view invoice and confirm values View spent.pl and confirm values Go through acquisitions module and confirm prices throughout are correct. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #96 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 79089 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79089&action=edit Bug 18736: Unit tests for rounding Unit tests to highlight the issue To test: Prove t/db_dependent/Budgets.t prove t/Acquisition.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #97 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 79090 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79090&action=edit Bug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell prove t/db_dependent/Budgets.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #98 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 79091 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79091&action=edit Bug 18736: (follow-up) Add missing test cases We now fully cover GetBudgetsPlanCell in these tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #99 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 79092 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79092&action=edit Bug 18736: (follow-up) Fix missing rounding and bad formatting This patch: Adds a missing use Uses 'Koha::Number::Price->round()' instead of 'format()' to ensure numeric returns Ensures too big numbers don't crash round() Uses syspref in 'GetBudgetHierarchy' To test: Follow previous test plan Check values on admin/aqbudgets.pl are affected by syspref Ensure values throughout acquisitions are correctly calculated/displayed (even when greater than 1,000) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #100 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 79093 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79093&action=edit Bug 18736: Unit tests for GetBudgetHierarchy prove -v t/db_dependent/Budgets.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #101 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 79094 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79094&action=edit Bug 18736: (follow-up) cast as UNSIGNED instead of INTEGER More recent MySql versions require the use of SIGNED or UNSIGNED rather than INTEGER. UNSIGNED will still work in older installs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #102 from Julian Maurice <julian.maurice@biblibre.com> --- Thanks Nick! Reviewing this patchset once again, for the last time hopefully :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79087|0 |1 is obsolete| | --- Comment #103 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 79098 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79098&action=edit Bug 18736: Add OrderPriceRounding syspref Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79088|0 |1 is obsolete| | --- Comment #104 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 79099 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79099&action=edit Bug 18736: Use rounding syspref to determine correct prices in calculations To test: Place an order (no tax just for simplicity) listprice/rrp = 16.99 discount = 42% quantity = 8 estimated calculated at 9.85 but order total is 78.83, but 8 times 9.85 = 78.80 Apply patches, set OrderPriceRounding syspref to 'Nearest cent' Not order total is now as expected View ordered.pl and confirm values are correct Complete order, view invoice and confirm values View spent.pl and confirm values Go through acquisitions module and confirm prices throughout are correct. Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79089|0 |1 is obsolete| | --- Comment #105 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 79100 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79100&action=edit Bug 18736: Unit tests for rounding Unit tests to highlight the issue To test: Prove t/db_dependent/Budgets.t prove t/Acquisition.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79090|0 |1 is obsolete| | --- Comment #106 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 79101 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79101&action=edit Bug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell prove t/db_dependent/Budgets.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79091|0 |1 is obsolete| | --- Comment #107 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 79102 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79102&action=edit Bug 18736: (follow-up) Add missing test cases We now fully cover GetBudgetsPlanCell in these tests Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79092|0 |1 is obsolete| | --- Comment #108 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 79103 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79103&action=edit Bug 18736: (follow-up) Fix missing rounding and bad formatting This patch: Adds a missing use Uses 'Koha::Number::Price->round()' instead of 'format()' to ensure numeric returns Ensures too big numbers don't crash round() Uses syspref in 'GetBudgetHierarchy' To test: Follow previous test plan Check values on admin/aqbudgets.pl are affected by syspref Ensure values throughout acquisitions are correctly calculated/displayed (even when greater than 1,000) Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79093|0 |1 is obsolete| | --- Comment #109 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 79104 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79104&action=edit Bug 18736: Unit tests for GetBudgetHierarchy prove -v t/db_dependent/Budgets.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79094|0 |1 is obsolete| | --- Comment #110 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 79105 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79105&action=edit Bug 18736: (follow-up) cast as UNSIGNED instead of INTEGER More recent MySql versions require the use of SIGNED or UNSIGNED rather than INTEGER. UNSIGNED will still work in older installs Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #111 from Julian Maurice <julian.maurice@biblibre.com> --- The bug status was 'Signed off' but it looks like it was never signed off... Well, it is now :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #112 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- QA Comment: _get_rounding_sql is present in both C4::Budgets and C4::Acquisitions, should this not be factored out somewhere to prevent it falling out of sync across the two locations? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #113 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 79187 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79187&action=edit Bug 18736: (follow-up) Remove duplicate code -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |BLOCKED QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | --- Comment #114 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- QA: Looking here -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Failed QA --- Comment #115 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- ok 1 - use C4::Acquisition; # Subtest: Tests for _get_rounding_sql 1..2 # No tests run! not ok 2 - No tests run for subtest "Tests for _get_rounding_sql" # Failed test 'No tests run for subtest "Tests for _get_rounding_sql"' # at t/Acquisition.t line 40. Undefined subroutine &C4::Acquisition::_get_rounding_sql called at t/Acquisition.t line 33. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79187|0 |1 is obsolete| | --- Comment #116 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 79223 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79223&action=edit Bug 18736: (follow-up) Remove duplicate code and adjust tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=21427 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |BLOCKED --- Comment #117 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- QA: Giving this another try -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #118 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- No blocker: Koha/Number/Price.pm return $self->value if $self->value > Number::Format::MAX_INT/100; What about self->value < -2**53 ? Big credit note.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #119 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Would have expected a small change in t/Prices.t too btw -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #120 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Got across this internal server error while testing: Undefined subroutine &C4::Acquisition::IsMarcStructureInternal called at /usr/share/koha/devclone/C4/Acquisition.pm line 3209. The famous bug to resolve with C4::Biblio:: Seems strictly unrelated however -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #121 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 79562 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79562&action=edit Bug 18736: (QA follow-up) Cosmetic changes [1] Resolve warnings like: Use of uninitialized value $rounding_pref in string eq at /usr/share/koha/devclone/C4/Acquisition.pm line 2040. [2] Fixing unusual use of whitespace too. [3] Remove list operator from get_rounding_sql return. Only used in scalar context. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #122 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 79563 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79563&action=edit Bug 18736: (QA follow-up) Change to signed, add large int test [1] Add trivial subtest in t/Number/Price.t Checking a negative number and a large number for the MAX_INT change. Note: Confusing to have t/Prices.t too. [2] Change UNSIGNED to SIGNED in get_rounding_sql. Although I did not spot problems with negative prices, we theoretically could while casting. cast(-2 as unsigned) == 18446744073709551614 Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #123 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Unable to finish this one right now, still in interface testing. Leaving it in blocked, hope to return soon.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #124 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #123)
Unable to finish this one right now, still in interface testing. Leaving it in blocked, hope to return soon..
Resuming now -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Failed QA --- Comment #125 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- QA Comment: Kind of walking in a minefield here. So very brave try! Think we are doing fine and we have the pref to control it. One area did not have attention yet: C4/Budgets.pm needs similar adjustments: Look at e.g. SUM( COALESCE(unitprice_tax_included, ecost_tax_included) * quantity ) AS budget_spent or SUM(ecost_tax_included * quantity) AS budget_ordered With the pref to nearest cent, the total ordered drops one cent, while it should drop three cent (using your example where 78,83 becomes 78,80). Another note: I still have the Internal Server Error: Undefined subroutine &C4::Acquisition::IsMarcStructureInternal called at /usr/share/koha/devclone/C4/Acquisition.pm line 3211. I added the C4::Biblio prefix here to resolve it. Please check if you need it too. Changing status. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #126 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Marcel de Rooy from comment #125)
One area did not have attention yet:
C4/Budgets.pm needs similar adjustments: Look at e.g. SUM( COALESCE(unitprice_tax_included, ecost_tax_included) * quantity ) AS budget_spent or SUM(ecost_tax_included * quantity) AS budget_ordered
With the pref to nearest cent, the total ordered drops one cent, while it should drop three cent (using your example where 78,83 becomes 78,80).
Can you point out some line numbers? I don't think I see where you are takling about? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #127 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Look in C4::Budgets not Acquisition GetBudgetsPlanCell line 238, 251 ? GetBudgetSpent line 335 GetBudgetOrdered line 366 ? GetBudgetHierarchy line 560, line 567 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Brian <bklein@dubuque.lib.ia.us> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bklein@dubuque.lib.ia.us --- Comment #128 from Brian <bklein@dubuque.lib.ia.us> --- Whats the status of bug 18736? Carnegie Stout Team -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79098|0 |1 is obsolete| | Attachment #79099|0 |1 is obsolete| | Attachment #79100|0 |1 is obsolete| | Attachment #79101|0 |1 is obsolete| | Attachment #79102|0 |1 is obsolete| | Attachment #79103|0 |1 is obsolete| | Attachment #79104|0 |1 is obsolete| | Attachment #79105|0 |1 is obsolete| | Attachment #79223|0 |1 is obsolete| | Attachment #79562|0 |1 is obsolete| | Attachment #79563|0 |1 is obsolete| | --- Comment #129 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 82967 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82967&action=edit Bug 18736: Add OrderPriceRounding syspref Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #130 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 82968 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82968&action=edit Bug 18736: Use rounding syspref to determine correct prices in calculations To test: Place an order (no tax just for simplicity) listprice/rrp = 16.99 discount = 42% quantity = 8 estimated calculated at 9.85 but order total is 78.83, but 8 times 9.85 = 78.80 Apply patches, set OrderPriceRounding syspref to 'Nearest cent' Not order total is now as expected View ordered.pl and confirm values are correct Complete order, view invoice and confirm values View spent.pl and confirm values Go through acquisitions module and confirm prices throughout are correct. Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #131 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 82969 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82969&action=edit Bug 18736: Unit tests for rounding Unit tests to highlight the issue To test: Prove t/db_dependent/Budgets.t prove t/Acquisition.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #132 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 82970 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82970&action=edit Bug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell prove t/db_dependent/Budgets.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #133 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 82971 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82971&action=edit Bug 18736: (follow-up) Add missing test cases We now fully cover GetBudgetsPlanCell in these tests Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #134 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 82972 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82972&action=edit Bug 18736: (follow-up) Fix missing rounding and bad formatting This patch: Adds a missing use Uses 'Koha::Number::Price->round()' instead of 'format()' to ensure numeric returns Ensures too big numbers don't crash round() Uses syspref in 'GetBudgetHierarchy' To test: Follow previous test plan Check values on admin/aqbudgets.pl are affected by syspref Ensure values throughout acquisitions are correctly calculated/displayed (even when greater than 1,000) Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #135 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 82973 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82973&action=edit Bug 18736: Unit tests for GetBudgetHierarchy prove -v t/db_dependent/Budgets.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #136 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 82974 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82974&action=edit Bug 18736: (follow-up) cast as UNSIGNED instead of INTEGER More recent MySql versions require the use of SIGNED or UNSIGNED rather than INTEGER. UNSIGNED will still work in older installs Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #137 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 82975 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82975&action=edit Bug 18736: (follow-up) Remove duplicate code and adjust tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #138 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 82976 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82976&action=edit Bug 18736: (QA follow-up) Cosmetic changes [1] Resolve warnings like: Use of uninitialized value $rounding_pref in string eq at /usr/share/koha/devclone/C4/Acquisition.pm line 2040. [2] Fixing unusual use of whitespace too. [3] Remove list operator from get_rounding_sql return. Only used in scalar context. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #139 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 82977 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82977&action=edit Bug 18736: (QA follow-up) Change to signed, add large int test [1] Add trivial subtest in t/Number/Price.t Checking a negative number and a large number for the MAX_INT change. Note: Confusing to have t/Prices.t too. [2] Change UNSIGNED to SIGNED in get_rounding_sql. Although I did not spot problems with negative prices, we theoretically could while casting. cast(-2 as unsigned) == 18446744073709551614 Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #140 from Nick Clemens <nick@bywatersolutions.com> --- Rebased on master (In reply to Marcel de Rooy from comment #127)
Look in C4::Budgets not Acquisition
GetBudgetsPlanCell line 238, 251 ? GetBudgetSpent line 335 GetBudgetOrdered line 366 ? GetBudgetHierarchy line 560, line 567
Sorry Marcel, all of the occurrences I see use get_rounding_sql()
With the pref to nearest cent, the total ordered drops one cent, while it should >drop three cent (using your example where 78,83 becomes 78,80).
Can you let me know where you are seeing this? Apologies if I am missing something obvious -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #141 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 83212 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83212&action=edit Bug 18736: (QA follow-up) Resolve uninitialized warn from Biblio.pm L3334 Running t/db/Budgets.t: Use of uninitialized value in join or string at C4/Biblio.pm line 3334. Test plan: Run again. Verify no warnings left. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #142 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 83213 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83213&action=edit Test basket -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #143 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 83214 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83214&action=edit Test budget -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #144 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Nick Clemens from comment #140)
With the pref to nearest cent, the total ordered drops one cent, while it should >drop three cent (using your example where 78,83 becomes 78,80).
Can you let me know where you are seeing this? Apologies if I am missing something obvious
Still seeing this. Best to illustrate by two images (see atts). The basket shows 78,80 and 15,33 tax. (94,13) The budget shows 92,16 (note that includes a -2, so 94,16) Three cents difference. This comes from rounding at different moments. The db shows: +-----------------------+ | tax_value_on_ordering | +-----------------------+ | 15.326600 | +-----------------------+ +--------------------+ | ecost_tax_excluded | +--------------------+ | 9.854200 | +--------------------+ +--------------------+ | ecost_tax_included | +--------------------+ | 11.770842 | +--------------------+ 8 * 11,77 = 94,16 8 * 9,85[rounded] * 1,1945 (tax percentage ) = 94,13 Difference: For 94,16 tax is calculated on not rounded price (9,8542). But for 94,13 tax is based on rounded price (9,85). How much tax do you want to pay ? ;) Not a real blocker for me btw. But this shows that we are not making consistent calculations in Acqui. If we still want to push, we should be aware of it at least. Will ask Joubu to comment on this finding too. Changing status for now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82967|0 |1 is obsolete| | --- Comment #145 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83973 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83973&action=edit Bug 18736: Add OrderPriceRounding syspref Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82968|0 |1 is obsolete| | --- Comment #146 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83974 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83974&action=edit Bug 18736: Use rounding syspref to determine correct prices in calculations To test: Place an order (no tax just for simplicity) listprice/rrp = 16.99 discount = 42% quantity = 8 estimated calculated at 9.85 but order total is 78.83, but 8 times 9.85 = 78.80 Apply patches, set OrderPriceRounding syspref to 'Nearest cent' Not order total is now as expected View ordered.pl and confirm values are correct Complete order, view invoice and confirm values View spent.pl and confirm values Go through acquisitions module and confirm prices throughout are correct. Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82969|0 |1 is obsolete| | --- Comment #147 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83975 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83975&action=edit Bug 18736: Unit tests for rounding Unit tests to highlight the issue To test: Prove t/db_dependent/Budgets.t prove t/Acquisition.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82970|0 |1 is obsolete| | --- Comment #148 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83976 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83976&action=edit Bug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell prove t/db_dependent/Budgets.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82971|0 |1 is obsolete| | --- Comment #149 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83977 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83977&action=edit Bug 18736: (follow-up) Add missing test cases We now fully cover GetBudgetsPlanCell in these tests Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82972|0 |1 is obsolete| | --- Comment #150 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83978 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83978&action=edit Bug 18736: (follow-up) Fix missing rounding and bad formatting This patch: Adds a missing use Uses 'Koha::Number::Price->round()' instead of 'format()' to ensure numeric returns Ensures too big numbers don't crash round() Uses syspref in 'GetBudgetHierarchy' To test: Follow previous test plan Check values on admin/aqbudgets.pl are affected by syspref Ensure values throughout acquisitions are correctly calculated/displayed (even when greater than 1,000) Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82973|0 |1 is obsolete| | --- Comment #151 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83979 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83979&action=edit Bug 18736: Unit tests for GetBudgetHierarchy prove -v t/db_dependent/Budgets.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82974|0 |1 is obsolete| | --- Comment #152 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83980 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83980&action=edit Bug 18736: (follow-up) cast as UNSIGNED instead of INTEGER More recent MySql versions require the use of SIGNED or UNSIGNED rather than INTEGER. UNSIGNED will still work in older installs Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82975|0 |1 is obsolete| | --- Comment #153 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83981 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83981&action=edit Bug 18736: (follow-up) Remove duplicate code and adjust tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82976|0 |1 is obsolete| | --- Comment #154 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83982 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83982&action=edit Bug 18736: (QA follow-up) Cosmetic changes [1] Resolve warnings like: Use of uninitialized value $rounding_pref in string eq at /usr/share/koha/devclone/C4/Acquisition.pm line 2040. [2] Fixing unusual use of whitespace too. [3] Remove list operator from get_rounding_sql return. Only used in scalar context. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82977|0 |1 is obsolete| | --- Comment #155 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83983 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83983&action=edit Bug 18736: (QA follow-up) Change to signed, add large int test [1] Add trivial subtest in t/Number/Price.t Checking a negative number and a large number for the MAX_INT change. Note: Confusing to have t/Prices.t too. [2] Change UNSIGNED to SIGNED in get_rounding_sql. Although I did not spot problems with negative prices, we theoretically could while casting. cast(-2 as unsigned) == 18446744073709551614 Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83212|0 |1 is obsolete| | --- Comment #156 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83984 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83984&action=edit Bug 18736: (QA follow-up) Resolve uninitialized warn from Biblio.pm L3334 Running t/db/Budgets.t: Use of uninitialized value in join or string at C4/Biblio.pm line 3334. Test plan: Run again. Verify no warnings left. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #157 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 83985 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83985&action=edit Bug 18736: Calculate tax depending on rounding Marcel's comments pointed out that while I tried to avoid storing rounded values it is required for tax generation. This patch makes that change and adds test coverage and POD for populate_order_with_prices To test: Follow plan on other patches, ensure that orders and totals match on the basket, invoice, and budget pages prove -v t/db_dependent/Acquisition/populate_order_with_prices.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #158 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Marcel de Rooy from comment #144)
(In reply to Nick Clemens from comment #140)
Ah, okay, I understand now - it seems we cannot leave the tax values untouched when enabling rounding, I added a followup for this. Let me know if the new calculations and tests match your expectations. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |BLOCKED --- Comment #159 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Spending a bit of time here now -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #160 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Small textual problems: + receiving => 1 # boolean representing order stage, should pass only this or ordering + ordering => 1 # boolean representing order stage except fot -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Failed QA --- Comment #161 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Test pass. QA pass. Hmm. Not wanting to be too precise, but we still have some subtle differences in some lines of the last patch. The first line rounds at the unit; with a whole quantity, it will be rounded. The second line is not rounded since you multiply with tax rate. The algorithm of tax = incl - excl is only used in the first line. The third line shows rounding at final stage. + $order->{tax_value_on_ordering} = ( get_rounded_price($order->{ecost_tax_included}) - get_rounded_price($order->{ecost_tax_excluded}) ) * $order->{quantity}; + $order->{tax_value_on_ordering} = $order->{quantity} * get_rounded_price($order->{ecost_tax_excluded}) * $order->{tax_rate_on_ordering}; + my $subtotal = get_rounded_price( $left * $data->{'ecost_tax_included'} ); Please explain why you do what you do. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |In Discussion --- Comment #162 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Marcel de Rooy from comment #161)
Test pass. QA pass. Hmm. Not wanting to be too precise, but we still have some subtle differences in some lines of the last patch. The first line rounds at the unit; with a whole quantity, it will be rounded. The second line is not rounded since you multiply with tax rate. The algorithm of tax = incl - excl is only used in the first line. The third line shows rounding at final stage. + $order->{tax_value_on_ordering} = ( get_rounded_price($order->{ecost_tax_included}) - get_rounded_price($order->{ecost_tax_excluded}) ) * $order->{quantity}; + $order->{tax_value_on_ordering} = $order->{quantity} * get_rounded_price($order->{ecost_tax_excluded}) * $order->{tax_rate_on_ordering};
+ my $subtotal = get_rounded_price( $left * $data->{'ecost_tax_included'} );
Please explain why you do what you do.
The first line is when the user entered prices including tax - so we have to calculate excluding tax(In reply to Marcel de Rooy from comment #161)
Test pass. QA pass. Hmm. Not wanting to be too precise, but we still have some subtle differences in some lines of the last patch. The first line rounds at the unit; with a whole quantity, it will be rounded. The second line is not rounded since you multiply with tax rate. The algorithm of tax = incl - excl is only used in the first line. The third line shows rounding at final stage. + $order->{tax_value_on_ordering} = ( get_rounded_price($order->{ecost_tax_included}) - get_rounded_price($order->{ecost_tax_excluded}) ) * $order->{quantity}; + $order->{tax_value_on_ordering} = $order->{quantity} * get_rounded_price($order->{ecost_tax_excluded}) * $order->{tax_rate_on_ordering};
+ my $subtotal = get_rounded_price( $left * $data->{'ecost_tax_included'} );
Please explain why you do what you do.
In the first line we are looking at prices supplied including tax - I assumed we get a rounded number from the vendor - I also assume they charge the tax to a single item then round - so we need to back calculate the tax, not knowing the unrounded end product - then charge this same amount per item In the second case (lines 2 and 3) we are given prices without tax, so we can calculate it on our own - and I assume they would perform the same caulcation - round discounted price, apply quantity and tax The issue is really that when getting a price including tax I assume we don't have full info, so do my best to calculate what I expect. Can you explain how you would expect to calculate that and what numbers you would expect to see? The tests illustrate that I do expect different numbers in the different scenarios, I honestly don't know what the vendors or librarians expect and would accept any quidance -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #163 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I think I'm happy with Nicks logic here.. Unfortunately, as we store calculated values we're open to having issues like this. EDI for example can often give you both tax inclusive and tax exclusive values and pretty often the rounding math at their end will be different from at our end and so yield different results. I think this patch improves the situation a fair amount and is a good compromise given our existing codebase.. perhaps it's the foundations for more work in a followup bug but I don't think that should hold up this work any longer really.. Did you have any more specific issues Marcel, that Nick could go on for keeping this moving? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #164 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Martin Renvoize from comment #163)
I think I'm happy with Nicks logic here..
Unfortunately, as we store calculated values we're open to having issues like this. EDI for example can often give you both tax inclusive and tax exclusive values and pretty often the rounding math at their end will be different from at our end and so yield different results.
I think this patch improves the situation a fair amount and is a good compromise given our existing codebase.. perhaps it's the foundations for more work in a followup bug but I don't think that should hold up this work any longer really..
Did you have any more specific issues Marcel, that Nick could go on for keeping this moving?
Will have a look this week -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |BLOCKED --- Comment #165 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Back here again ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83973|0 |1 is obsolete| | --- Comment #166 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86646 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86646&action=edit Bug 18736: Add OrderPriceRounding syspref Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83974|0 |1 is obsolete| | --- Comment #167 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86647 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86647&action=edit Bug 18736: Use rounding syspref to determine correct prices in calculations To test: Place an order (no tax just for simplicity) listprice/rrp = 16.99 discount = 42% quantity = 8 estimated calculated at 9.85 but order total is 78.83, but 8 times 9.85 = 78.80 Apply patches, set OrderPriceRounding syspref to 'Nearest cent' Not order total is now as expected View ordered.pl and confirm values are correct Complete order, view invoice and confirm values View spent.pl and confirm values Go through acquisitions module and confirm prices throughout are correct. Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83975|0 |1 is obsolete| | --- Comment #168 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86648 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86648&action=edit Bug 18736: Unit tests for rounding Unit tests to highlight the issue To test: Prove t/db_dependent/Budgets.t prove t/Acquisition.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83976|0 |1 is obsolete| | --- Comment #169 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86649 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86649&action=edit Bug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell prove t/db_dependent/Budgets.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83977|0 |1 is obsolete| | --- Comment #170 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86650 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86650&action=edit Bug 18736: (follow-up) Add missing test cases We now fully cover GetBudgetsPlanCell in these tests Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83978|0 |1 is obsolete| | --- Comment #171 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86651 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86651&action=edit Bug 18736: (follow-up) Fix missing rounding and bad formatting This patch: Adds a missing use Uses 'Koha::Number::Price->round()' instead of 'format()' to ensure numeric returns Ensures too big numbers don't crash round() Uses syspref in 'GetBudgetHierarchy' To test: Follow previous test plan Check values on admin/aqbudgets.pl are affected by syspref Ensure values throughout acquisitions are correctly calculated/displayed (even when greater than 1,000) Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83979|0 |1 is obsolete| | --- Comment #172 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86652 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86652&action=edit Bug 18736: Unit tests for GetBudgetHierarchy prove -v t/db_dependent/Budgets.t Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83980|0 |1 is obsolete| | --- Comment #173 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86653 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86653&action=edit Bug 18736: (follow-up) cast as UNSIGNED instead of INTEGER More recent MySql versions require the use of SIGNED or UNSIGNED rather than INTEGER. UNSIGNED will still work in older installs Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83981|0 |1 is obsolete| | --- Comment #174 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86654 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86654&action=edit Bug 18736: (follow-up) Remove duplicate code and adjust tests Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83982|0 |1 is obsolete| | --- Comment #175 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86655 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86655&action=edit Bug 18736: (QA follow-up) Cosmetic changes [1] Resolve warnings like: Use of uninitialized value $rounding_pref in string eq at /usr/share/koha/devclone/C4/Acquisition.pm line 2040. [2] Fixing unusual use of whitespace too. [3] Remove list operator from get_rounding_sql return. Only used in scalar context. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83983|0 |1 is obsolete| | --- Comment #176 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86656 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86656&action=edit Bug 18736: (QA follow-up) Change to signed, add large int test [1] Add trivial subtest in t/Number/Price.t Checking a negative number and a large number for the MAX_INT change. Note: Confusing to have t/Prices.t too. [2] Change UNSIGNED to SIGNED in get_rounding_sql. Although I did not spot problems with negative prices, we theoretically could while casting. cast(-2 as unsigned) == 18446744073709551614 Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83984|0 |1 is obsolete| | --- Comment #177 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86657 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86657&action=edit Bug 18736: (QA follow-up) Resolve uninitialized warn from Biblio.pm L3334 Running t/db/Budgets.t: Use of uninitialized value in join or string at C4/Biblio.pm line 3334. Test plan: Run again. Verify no warnings left. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83985|0 |1 is obsolete| | --- Comment #178 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 86658 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86658&action=edit Bug 18736: Calculate tax depending on rounding Marcel's comments pointed out that while I tried to avoid storing rounded values it is required for tax generation. This patch makes that change and adds test coverage and POD for populate_order_with_prices To test: Follow plan on other patches, ensure that orders and totals match on the basket, invoice, and budget pages prove -v t/db_dependent/Acquisition/populate_order_with_prices.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Passed QA --- Comment #179 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- QA Comment: I re-entered the example with 8 * 16,99 and 42% discount, 19.45% tax. With the following results when patches applied: OrderPriceRounding=Dont Basket page 78,83 + 15,33 tax. == 94,16 Fund page 94,17 => No match between basket and fund ! OrderPriceRounding=Nearest cent Basket page: 78,80 + 15,33 tax == 94,13 Fund page: 94,16 => No match either between basket and fund ! And without these patches: Basket page 78,83 + 15,33 tax. == 94,16 Fund page: 94,17 => No match either. Conclusion: Please see also my previous comments. I am not repeating them here. With the default setting of Don't round we make no difference in this example; so no behavior change.. The Nearest cent choice does not resolve the discrepancy between basket and fund, as noted before. As already mentioned, I do not object to push this patch set. But this simple exercise already shows that we did not solve the rounding issues. Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #180 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 --- Comment #181 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Marcel de Rooy from comment #179)
QA Comment: I re-entered the example with 8 * 16,99 and 42% discount, 19.45% tax.
With the following results when patches applied: OrderPriceRounding=Dont Basket page 78,83 + 15,33 tax. == 94,16 Fund page 94,17 => No match between basket and fund !
OrderPriceRounding=Nearest cent Basket page: 78,80 + 15,33 tax == 94,13 Fund page: 94,16 => No match either between basket and fund !
And without these patches: Basket page 78,83 + 15,33 tax. == 94,16 Fund page: 94,17 => No match either.
Conclusion: Please see also my previous comments. I am not repeating them here. With the default setting of Don't round we make no difference in this example; so no behavior change.. The Nearest cent choice does not resolve the discrepancy between basket and fund, as noted before.
As already mentioned, I do not object to push this patch set. But this simple exercise already shows that we did not solve the rounding issues.
Passed QA
You are right :-) I talked to others though and general consensus was this is a big change and should tackle issues raised on follow-ups. I think this does some good things and paves the way for more work forward so pushed. Thanks Marcel -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #182 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pushed to 18.11.x for 18.11.04! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Manual -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This patch introduces to release notes| |new system preference to | |govern how rounding is | |applied to values in | |acquisitions. It defaults | |to the american practice of | |rounding to the nearest | |'cent' but future options | |should become available as | |we start to understand how | |other nations round for | |accounting purposes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #183 from Lucas Gass <lucas@bywatersolutions.com> --- not backporting enhancement to 18.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |22618 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22618 [Bug 22618] Tests in t/Acquisition.t are actually database dependent -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |22791 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22791 [Bug 22791] Calculation differs on aqui-home/spent and ordered.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |19.05.00, 18.11.04 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18736 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org