[Bug 34279] New: overduefinescap of 0 is ignored, but overduefinescap of 0.00 is enforced
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Bug ID: 34279 Summary: overduefinescap of 0 is ignored, but overduefinescap of 0.00 is enforced Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When creating a circ rule, we can set overduefinescap to blank or 0 and no cap is enforced. If we edit that rule, the blank/0 is converted to "0.00" which perl considers true, thus zero-ing out any calculated fine. Considering we've always ignored an overdue fines cap of 0, we should also ignore 0.00. However, perl is evaluating it as a string which makes it true instead of false as 0 is. -- 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=34279 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=34279 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 153471 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153471&action=edit Bug 34279: Unit tests -- 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=34279 --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 153472 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153472&action=edit Bug 34279: Don't enforce overduefinescap unless it is greater than 0 -- 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=34279 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@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=34279 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Testing... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |RESOLVED Resolution|--- |DUPLICATE --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think this is an indirect duplicate of bug 32271. The difference between 0 and 0.00 is hard to understand. It used to be you could leave it empty and it would count as unlimited - the same behaviour we have for checkouts. I still see this behaviour in 20.11 (don't have the versions in between to test). I think it would be better than relying on 0 vs. 0.00 - what do you think? *** This bug has been marked as a duplicate of bug 32271 *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- To make sure I didn't misunderstand, I tested the patch and it dosn't work: * Apply patch * restart_all * Add a circulation rule, set Overdue fines cap to 0, save: It still shows as 0.00 * Edit a circulation rule, set Overdue fines cap to empty, save: It still shows as 0.00 I think the duplicates could also be the other way around, but neither patch works. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|DUPLICATE |--- Status|RESOLVED |REOPENED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153471|0 |1 is obsolete| | Attachment #153472|0 |1 is obsolete| | --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 153475 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153475&action=edit Bug 34279: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 153476 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153476&action=edit Bug 34279: Don't enforce overduefinescap unless it is greater than 0 When creating a circ rule, we can set overduefinescap to blank or 0 and no cap is enforced. If we edit that rule, the blank/0 is converted to "0.00" which perl considers true, thus zero-ing out any calculated fine. Considering we've always ignored an overdue fines cap of 0, we should also ignore 0.00. However, perl is evaluating it as a string which makes it true instead of false as 0 is. Test Plan: 1) Apply the first patch ( unit tests ) 2) prove t/db_dependent/Circulation/CalcFine.t 3) Note the test fails 4) Apply the second patch as well 5) prove t/db_dependent/Circulation/CalcFine.t 6) Note the test passes Test Plan 2: 1) Create an all/all/all rule with an overduefinescap of 0.00, with a daily fine. Enable CalculateFinesOnReturn 2) Backdate a checkout so it is overdue 3) Return this item, note the lack of a fine 4) Apply this patch set 5) Backdate a checkout and return it again 6) Note the fine is generated! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off 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=34279 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153476|0 |1 is obsolete| | --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 153483 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153483&action=edit Bug 34279: Don't enforce overduefinescap unless it is greater than 0 When creating a circ rule, we can set overduefinescap to blank or 0 and no cap is enforced. If we edit that rule, the blank/0 is converted to "0.00" which perl considers true, thus zero-ing out any calculated fine. Considering we've always ignored an overdue fines cap of 0, we should also ignore 0.00. However, perl is evaluating it as a string which makes it true instead of false as 0 is. Test Plan: 1) Apply the first patch ( unit tests ) 2) prove t/db_dependent/Circulation/CalcFine.t 3) Note the test fails 4) Apply the second patch as well 5) prove t/db_dependent/Circulation/CalcFine.t 6) Note the test passes Test Plan 2: 1) Create an all/all/all rule with an overduefinescap of 0.00, with a daily fine. Enable CalculateFinesOnReturn 2) Backdate a checkout so it is overdue 3) Return this item, note the lack of a fine 4) Apply this patch set 5) Backdate a checkout and return it again 6) Note the fine is generated! Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Kyle and I discussed this and bug 32271 on IRC. This fixes a regression and somewhat helps with bug 32271 as editing a rule with empty changed to 0.00 will no longer turn off your fine calculation. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153475|0 |1 is obsolete| | --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 153484 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153484&action=edit Bug 34279: Unit tests Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153483|0 |1 is obsolete| | --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 153485 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153485&action=edit Bug 34279: Don't enforce overduefinescap unless it is greater than 0 When creating a circ rule, we can set overduefinescap to blank or 0 and no cap is enforced. If we edit that rule, the blank/0 is converted to "0.00" which perl considers true, thus zero-ing out any calculated fine. Considering we've always ignored an overdue fines cap of 0, we should also ignore 0.00. However, perl is evaluating it as a string which makes it true instead of false as 0 is. Test Plan: 1) Apply the first patch ( unit tests ) 2) prove t/db_dependent/Circulation/CalcFine.t 3) Note the test fails 4) Apply the second patch as well 5) prove t/db_dependent/Circulation/CalcFine.t 6) Note the test passes Test Plan 2: 1) Create an all/all/all rule with an overduefinescap of 0.00, with a daily fine. Enable CalculateFinesOnReturn 2) Backdate a checkout so it is overdue 3) Return this item, note the lack of a fine 4) Apply this patch set 5) Backdate a checkout and return it again 6) Note the fine is generated! Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=32271 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153484|0 |1 is obsolete| | --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 153648 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153648&action=edit Bug 34279: Unit tests Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> 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=34279 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153485|0 |1 is obsolete| | --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 153649 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153649&action=edit Bug 34279: Don't enforce overduefinescap unless it is greater than 0 When creating a circ rule, we can set overduefinescap to blank or 0 and no cap is enforced. If we edit that rule, the blank/0 is converted to "0.00" which perl considers true, thus zero-ing out any calculated fine. Considering we've always ignored an overdue fines cap of 0, we should also ignore 0.00. However, perl is evaluating it as a string which makes it true instead of false as 0 is. Test Plan: 1) Apply the first patch ( unit tests ) 2) prove t/db_dependent/Circulation/CalcFine.t 3) Note the test fails 4) Apply the second patch as well 5) prove t/db_dependent/Circulation/CalcFine.t 6) Note the test passes Test Plan 2: 1) Create an all/all/all rule with an overduefinescap of 0.00, with a daily fine. Enable CalculateFinesOnReturn 2) Backdate a checkout so it is overdue 3) Return this item, note the lack of a fine 4) Apply this patch set 5) Backdate a checkout and return it again 6) Note the fine is generated! Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> 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=34279 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- All works as expected, tests included and QA script happy.. no regressions spotted. Passing QA. I tested this on top of bugs 33028 and 32271 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.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=34279 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=33028 CC| |fridolin.somers@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=34279 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.11.00 |23.11.00,23.05.03 released in| | --- Comment #16 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00,23.05.03 |23.11.00,23.05.03,22.11.09 released in| | Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 --- Comment #17 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Nice work everyone! Pushed to 22.11.x for next release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Version(s)|23.11.00,23.05.03,22.11.09 |23.11.00,23.05.03,22.11.09, released in| |22.05.16 Status|Pushed to oldstable |Pushed to oldoldstable --- Comment #18 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for upcoming 22.05.16 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org