[Bug 28482] New: Floating point math prevents items from being returned
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 Bug ID: 28482 Summary: Floating point math prevents items from being returned Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org We have seen this before, cropping up again. To recreate: 1 - Add a processing fee of 15 to an itemtype 2 - Add an item of that type, set the replacement fee to 12.63 3 - Set MarkLostItemsAsReturned to 'On payment' only 4 - Set WhenLostChargeReplacementFee to 'Charge' 5 - Checkout the item to a patron 6 - Mark the item lost 7 - Reload patron and confirm they are charged 27.63 8 - Go to accounting, pay amount, pay 27.63 9 - Item is still lost and not returned -- 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=28482 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 121476 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121476&action=edit Bug 28482: Unit test -- 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=28482 --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 121477 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121477&action=edit Bug 28482: Refresh line from DB to get stored value Before checking if the amount is 0 we get the stored value from the DB. This ensures any amounts beyond the 6 digit precision we store will be removed. To test: 1 - Add a processing fee of 15 to an itemtype 2 - Add an item of that type, set the replacement fee to 12.63 3 - Set MarkLostItemsAsReturned to 'On payment' only 4 - Set WhenLostChargeReplacementFee to 'Charge' 5 - Checkout the item to a patron 6 - Mark the item lost 7 - Reload patron and confirm they are charged 27.63 8 - Go to accounting, pay amount, pay 27.63 9 - Item is still lost and not returned 10 - Apply patch 11 - Checkin the item 12 - Checkout to another patron 13 - Mark lost 14 - Patron charged 27.63 15 - Pay amount, 27.63 16 - Item returned! -- 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=28482 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=28482 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121476|0 |1 is obsolete| | --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 121479 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121479&action=edit Bug 28482: Unit test Signed-off-by: Martin Renvoize <martin.renvoize@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=28482 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121477|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 121480 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121480&action=edit Bug 28482: Refresh line from DB to get stored value Before checking if the amount is 0 we get the stored value from the DB. This ensures any amounts beyond the 6 digit precision we store will be removed. To test: 1 - Add a processing fee of 15 to an itemtype 2 - Add an item of that type, set the replacement fee to 12.63 3 - Set MarkLostItemsAsReturned to 'On payment' only 4 - Set WhenLostChargeReplacementFee to 'Charge' 5 - Checkout the item to a patron 6 - Mark the item lost 7 - Reload patron and confirm they are charged 27.63 8 - Go to accounting, pay amount, pay 27.63 9 - Item is still lost and not returned 10 - Apply patch 11 - Checkin the item 12 - Checkout to another patron 13 - Mark lost 14 - Patron charged 27.63 15 - Pay amount, 27.63 16 - Item returned! Signed-off-by: Martin Renvoize <martin.renvoize@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=28482 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Needs Signoff |Signed Off --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- We could have used the compare technique as used in bug 27079 here too, but I think we're OK doing a fetch from the DB for now. I'd really like to treat floating point more widely with the Koha::Money or whatever class I hoped to introduce in bug 17138 at some point but I've not managed to find the time to work on that bug again of late :( In short.. signing off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #6 from Victor Grousset/tuxayo <victor@tuxayo.net> ---
16 - Item returned!
Still marked as lost, is that expected? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch 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=28482 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121479|0 |1 is obsolete| | --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 121586 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121586&action=edit Bug 28482: Unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> 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=28482 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121480|0 |1 is obsolete| | --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 121587 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121587&action=edit Bug 28482: Refresh line from DB to get stored value Before checking if the amount is 0 we get the stored value from the DB. This ensures any amounts beyond the 6 digit precision we store will be removed. To test: 1 - Add a processing fee of 15 to an itemtype 2 - Add an item of that type, set the replacement fee to 12.63 3 - Set MarkLostItemsAsReturned to 'On payment' only 4 - Set WhenLostChargeReplacementFee to 'Charge' 5 - Checkout the item to a patron 6 - Mark the item lost 7 - Reload patron and confirm they are charged 27.63 8 - Go to accounting, pay amount, pay 27.63 9 - Item is still lost and not returned 10 - Apply patch 11 - Checkin the item 12 - Checkout to another patron 13 - Mark lost 14 - Patron charged 27.63 15 - Pay amount, 27.63 16 - Item returned! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> 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=28482 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=24855 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 --- Comment #9 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- *** Bug 24855 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 Lisette Scheer <lisetteslatah@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisetteslatah@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.05, 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=28482 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.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=28482 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Version(s)|21.11.00 |21.11.00,21.05.01 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable --- Comment #12 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.05.x for 21.05.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable CC| |fridolin.somers@biblibre.co | |m Version(s)|21.11.00,21.05.01 |21.11.00,21.05.01,20.11.07 released in| | --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.07 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Pushed to oldoldstable Version(s)|21.11.00,21.05.01,20.11.07 |21.11.00,21.05.01,20.11.07, released in| |20.05.13 --- Comment #14 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Backported: Pushed to 20.05.x branch for 20.05.13 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #15 from wainuiwitikapark@catalyst.net.nz --- Should this be backported to 19.11.x? For 19.11.19? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 --- Comment #16 from wainuiwitikapark@catalyst.net.nz --- Should this be backported to 19.11.x? For 19.11.20? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.11.00,21.05.01,20.11.07, |21.11.00,21.05.01,20.11.07, released in|20.05.13 |20.05.13,19.11.20 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 --- Comment #17 from wainuiwitikapark@catalyst.net.nz --- Backported to 19.11.x for 19.11.20 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldoldstable |Pushed to oldoldoldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 --- Comment #18 from wainuiwitikapark@catalyst.net.nz --- Sorry this, hasn't actually been backported to 19.11.x yet I made an error I was meant to be updating Bug 28487 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldoldoldstable |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=28482 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.11.00,21.05.01,20.11.07, |21.11.00,21.05.01,20.11.07, released in|20.05.13,19.11.20 |20.05.13 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 --- Comment #19 from wainuiwitikapark@catalyst.net.nz --- There are conflicts when trying to backport this to 19.11.x. Is this needed for 19.11.x? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 --- Comment #20 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122646 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122646&action=edit Bug 28482: [19.11.x] Unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Fix test rebase -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 --- Comment #21 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122647 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122647&action=edit Bug 28482: [19.11.x] Refresh line from DB to get stored value Before checking if the amount is 0 we get the stored value from the DB. This ensures any amounts beyond the 6 digit precision we store will be removed. To test: 1 - Add a processing fee of 15 to an itemtype 2 - Add an item of that type, set the replacement fee to 12.63 3 - Set MarkLostItemsAsReturned to 'On payment' only 4 - Set WhenLostChargeReplacementFee to 'Charge' 5 - Checkout the item to a patron 6 - Mark the item lost 7 - Reload patron and confirm they are charged 27.63 8 - Go to accounting, pay amount, pay 27.63 9 - Item is still lost and not returned 10 - Apply patch 11 - Checkin the item 12 - Checkout to another patron 13 - Mark lost 14 - Patron charged 27.63 15 - Pay amount, 27.63 16 - Item returned! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> 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=28482 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122646|0 |1 is obsolete| | --- Comment #22 from wainuiwitikapark@catalyst.net.nz --- Created attachment 122659 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122659&action=edit Bug 28482: [19.11.x] Unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Fix test rebase Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122647|0 |1 is obsolete| | --- Comment #23 from wainuiwitikapark@catalyst.net.nz --- Created attachment 122660 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122660&action=edit Bug 28482: [19.11.x] Refresh line from DB to get stored value Before checking if the amount is 0 we get the stored value from the DB. This ensures any amounts beyond the 6 digit precision we store will be removed. To test: 1 - Add a processing fee of 15 to an itemtype 2 - Add an item of that type, set the replacement fee to 12.63 3 - Set MarkLostItemsAsReturned to 'On payment' only 4 - Set WhenLostChargeReplacementFee to 'Charge' 5 - Checkout the item to a patron 6 - Mark the item lost 7 - Reload patron and confirm they are charged 27.63 8 - Go to accounting, pay amount, pay 27.63 9 - Item is still lost and not returned 10 - Apply patch 11 - Checkin the item 12 - Checkout to another patron 13 - Mark lost 14 - Patron charged 27.63 15 - Pay amount, 27.63 16 - Item returned! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.11.00,21.05.01,20.11.07, |21.11.00,21.05.01,20.11.07, released in|20.05.13 |20.05.13,19.11.20 --- Comment #24 from wainuiwitikapark@catalyst.net.nz --- Backported to 19.11.x for 19.11.20 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org