[Bug 11644] New: Cannot update fund if total is equal to amount unallocated
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Bug ID: 11644 Summary: Cannot update fund if total is equal to amount unallocated Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org When attempting to update a fund, if the amount unalloccated for the fund is equal to the total, you can be prevented from saving. This is due to imprecise floating point number comparison in check_parent_total.pl -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | Severity|enhancement |normal -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 24900 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24900&action=edit Bug 11644 - Cannot update fund if total is equal to amount unallocated When attempting to update a fund, if the amount unalloccated for the fund is equal to the total, you can be prevented from saving. This is due to imprecise floating point number comparison in check_parent_total.pl Test Plan: 1) Create a fund where the amount unallocated is equal to the amount unallocated for the budget period 2) Edit the fund, attempt to change the name of the fund 3) Note you recieve an error and cannot save 4) Apply this patch 5) Repeat step 2 6) Note you can now update the fund -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Sean McGarvey <smcgarvey@pascocountyfl.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |smcgarvey@pascocountyfl.net --- Comment #2 from Sean McGarvey <smcgarvey@pascocountyfl.net> --- Tested on pasco county production server, our acquisitions team says fix worked perfectly! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24900|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 24954 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24954&action=edit Bug 11644 - Cannot update fund if total is equal to amount unallocated When attempting to update a fund, if the amount unalloccated for the fund is equal to the total, you can be prevented from saving. This is due to imprecise floating point number comparison in check_parent_total.pl Test Plan: 1) Create a fund where the amount unallocated is equal to the amount unallocated for the budget period 2) Edit the fund, attempt to change the name of the fund 3) Note you recieve an error and cannot save 4) Apply this patch 5) Repeat step 2 6) Note you can now update the fund Signed-off-by: Sean McGarvey <smcgarvey@pascocountyfl.net> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am failing to reproduce the problem, here is what I did: - My budget had 200,00 unallocated - I created a new fund with 200,00, it saved correctly - I tried editing the newly created fund, it also saved correctly Quite sure I am missing something - any hints? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #4)
I am failing to reproduce the problem, here is what I did: - My budget had 200,00 unallocated - I created a new fund with 200,00, it saved correctly - I tried editing the newly created fund, it also saved correctly
Quite sure I am missing something - any hints?
I wish I had some hints to give you! I had to debug this on a production system. I tried to come up with the best way to reproduce the issue I could. It may even be that you'd be unable to reproduce the error on a different system, as this may have something to do with Perl versions. Can you at least verify the patch does not cause any regressions? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Ok, I can do regression testing, it might take a bit - busy week. If someone else beats me to it that's ok of course :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- What is the error and what was the amount used? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=11675 --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- I found bug 11675 on testing this patch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Barton Chittenden <bartonski@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bartonski@gmail.com --- Comment #9 from Barton Chittenden <bartonski@gmail.com> --- To re-create the bug: 1) Create a budget of 732214.84 2) Create Fund 1 of amount 651162.37 3) Create Fund 2 of amount 81052.46 Note that the sum of these amounts is 732214.83: One cent less than the budget amount of 732214.84. 4) Edit Fund 2, change the amount to 81052.47 This will generate the following warning: Form not submitted because of the following problem(s) ------------------------------------------------------------------------------------ - Fund amount exceeds period allocation -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 --- Comment #10 from Barton Chittenden <bartonski@gmail.com> --- To re-create the bug: 1) Create a budget of 732214.84 2) Create Fund 1 of amount 651162.37 3) Create Fund 2 of amount 81052.46 Note that the sum of these amounts is 732214.83: One cent less than the budget amount of 732214.84. 4) Edit Fund 2, change the amount to 81052.47 This will generate the following warning: Form not submitted because of the following problem(s) ------------------------------------------------------------------------------------ - Fund amount exceeds period allocation -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24954|0 |1 is obsolete| | --- Comment #11 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 25348 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25348&action=edit Bug 11644 - Cannot update fund if total is equal to amount unallocated When attempting to update a fund, if the amount unalloccated for the fund is equal to the total, you can be prevented from saving. This is due to imprecise floating point number comparison in check_parent_total.pl Test Plan: 1) Create a fund where the amount unallocated is equal to the amount unallocated for the budget period 2) Edit the fund, attempt to change the name of the fund 3) Note you recieve an error and cannot save 4) Apply this patch 5) Repeat step 2 6) Note you can now update the fund Signed-off-by: Sean McGarvey <smcgarvey@pascocountyfl.net> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 --- Comment #12 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 25349 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25349&action=edit Bug 11644: (follow-up) Add a FIXME for the precision value Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 --- Comment #13 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Barton Chittenden from comment #10)
To re-create the bug:
Thank you for that! I am able to reproduce the issue and confirm the patch fixes it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #14 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Kyle! However, I have declined to push Jonathan's follow-up, and instead have pushed one of my own with the following FIXME (which to be clear, is NOT directed at Kyle's patch in particular): +# FIXME - we really need a better way to do this consistently +# and across the board, be it bigints, Math::FixedPoint, a +# modernized version of Math::Curency that isn't tied to the system +# locale, or something else. The problem with Jonathan's suggestion of using a system preference to specify the number of decimal places for a currency is that such a thing is not actually a global attribute -- it's more properly an attribute of the currency. Hard-coding the number of decimal places to 2, while not ideal, won't break things for folks who use JPY. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolyn.somers@biblibre.co | |m Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #15 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Pushed to 3.14.x, will be in 3.14.07 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11644 --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 3.12.x will be in 3.12.13 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org