[Bug 18900] New: Receiving order with unitprice multiples by 1000
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Bug ID: 18900 Summary: Receiving order with unitprice multiples by 1000 Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: fridolin.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org Bug 18471 added number formating in order receive. I found a bug generated by this. Koha::Number::Price defines methods to (un)format price depending on CurrencyFormat syspref. The bug is that for CurrencyFormat US, some params are not defined in this module so there are retrieved from system locale. If system locale is not en_US, the params will be wrong. For example fr_FR will define , as decimal and so multiple price value by 1000. -- 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=18900 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |18471 --- Comment #1 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- 18471 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18471 [Bug 18471] Receiving order with unitprice greater than 1000 processing incorrectly -- 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=18900 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |fridolin.somers@biblibre.co |ity.org |m -- 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=18900 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 --- Comment #2 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- I have a UT that reproduces the bug. For testing in acquisition, one must use Plack mode, I don't understand why. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 --- Comment #3 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 64838 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64838&action=edit Bug 18900 - add UT to Number/Price.t This patch adds unit tests to t/Number/Price.t in order to valid the problem. It sets in the script locale "en_US.UTF-8" by default so that those tests can be run with any system locale. And adds a test dedicated to this bug. (cherry picked from commit 20b3141bdf750bebb50e837771724324f7a67c1b) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #64838|0 |1 is obsolete| | --- Comment #4 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 64839 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64839&action=edit Bug 18900 - add UT to Number/Price.t This patch adds unit tests to t/Number/Price.t in order to valid the problem. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Receiving order with |wrong number format in |unitprice multiples by 1000 |receiving order -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 --- Comment #5 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 64840 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64840&action=edit Bug 18900 - wrong number format in receiving order Bug 18471 added number formating in order receive. I found a bug generated by this. Koha::Number::Price defines methods to (un)format price depending on CurrencyFormat syspref. The bug is that for CurrencyFormat US, some params are not defined in this module so there are retrieved from system locale. If system locale is not en_US, the params will be wrong. For example fr_FR will define ',' as decimal and so saved unit price is divided by 1000. To recreate: - On a server with locale 'fr_FR' - With Plack mode - Set CurrencyFormat on 'US' - Open a basket - Place an order for an item - Close basket - Receive order with changing 'Actual Cost' to '1,234' - Note the 'Actual Cost' is now '1.23' - Run unit test t/Number/Price.t without and with patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Fridolin, we also had some bad luck with Plack and amounts - see bug 18186! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Baptiste <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18186 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #64839|0 |1 is obsolete| | Attachment #64840|0 |1 is obsolete| | --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 65627 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65627&action=edit [SIGNED OFF] Bug 18900 - add UT to Number/Price.t This patch adds unit tests to t/Number/Price.t in order to valid the problem. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 65628 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65628&action=edit [SIGNED OFF] Bug 18900 - wrong number format in receiving order Bug 18471 added number formating in order receive. I found a bug generated by this. Koha::Number::Price defines methods to (un)format price depending on CurrencyFormat syspref. The bug is that for CurrencyFormat US, some params are not defined in this module so there are retrieved from system locale. If system locale is not en_US, the params will be wrong. For example fr_FR will define ',' as decimal and so saved unit price is divided by 1000. To recreate: - On a server with locale 'fr_FR' - With Plack mode - Set CurrencyFormat on 'US' - Open a basket - Place an order for an item - Close basket - Receive order with changing 'Actual Cost' to '1,234' - Note the 'Actual Cost' is now '1.23' - Run unit test t/Number/Price.t without and with patch Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Tests pass ok, no regressions found. We also have seen some strange phenomenons with prices and Plack, this might help in other cases too. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #65627|0 |1 is obsolete| | --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 65759 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65759&action=edit Bug 18900: add UT to Number/Price.t This patch adds unit tests to t/Number/Price.t in order to valid the problem. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 65760 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65760&action=edit Bug 18900: (QA followup) Make tests conditional to locale existence It is important to highlight that tests have been skipped instead of having them pass on the absence of the required fr_FR.UTF-8 locale installed on the system. This patch does that check and effectively skips them. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #65628|0 |1 is obsolete| | --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 65761 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65761&action=edit Bug 18900: wrong number format in receiving order Bug 18471 added number formating in order receive. I found a bug generated by this. Koha::Number::Price defines methods to (un)format price depending on CurrencyFormat syspref. The bug is that for CurrencyFormat US, some params are not defined in this module so there are retrieved from system locale. If system locale is not en_US, the params will be wrong. For example fr_FR will define ',' as decimal and so saved unit price is divided by 1000. To recreate: - On a server with locale 'fr_FR' - With Plack mode - Set CurrencyFormat on 'US' - Open a basket - Place an order for an item - Close basket - Receive order with changing 'Actual Cost' to '1,234' - Note the 'Actual Cost' is now '1.23' - Run unit test t/Number/Price.t without and with patch Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 17.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #14 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.05.x, will be in 17.05.04. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- These patches have been pushed to 16.11.x and will be in 16.11.12. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #16 from Mason James <mtj@kohaaloha.com> --- Pushed to 16.05.x, for 16.05.17 release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|wrong number format in |Wrong number format in |receiving order |receiving order -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor.grousset@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Bug 18900 depends on bug 18471, which changed state. Bug 18471 Summary: Receiving order with unitprice greater than 1000 processing incorrectly https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18471 What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |REOPENED Resolution|FIXED |--- -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18900 Bug 18900 depends on bug 18471, which changed state. Bug 18471 Summary: Receiving order with unitprice greater than 1000 processing incorrectly https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18471 What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org