[Bug 24186] New: maxFine can break fine reductions in updateFine
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24186 Bug ID: 24186 Summary: maxFine can break fine reductions in updateFine Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org If maxFine is enabled and the user has hit their maxFine limit, then in a backdated return situation where a fine may need discounting via updateFine, the discount will not be applied as the current code will short circuit before calling adjust due it assuming all calls to updateFine are increases. -- 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=24186 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |24146 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24146 [Bug 24146] Paying Accruing Fines prior to return causes another accruing fine when 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=24186 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24186 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 96073 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96073&action=edit Bug 24186: Add Tests -- 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=24186 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 96074 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96074&action=edit Add Debugging -- 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=24186 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Ping? -- 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=24186 --- Comment #4 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 212184 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212184&action=edit Bug 24186: Let UpdateFine lower a fine when the patron is at MaxFine Bug 24186: Let UpdateFine lower a fine when the patron is at MaxFine UpdateFine returned early whenever the patron's outstanding overdue fines had reached MaxFine, before looking at the new amount. A fine that has to go down (a backdated return, a corrected rate) was therefore left at the higher amount. MaxFine is a cap on increases, so it is now only applied when the fine would grow. Test plan: 1. prove t/db_dependent/Overdues.t The new subtest "UpdateFine() lowers a fine when the patron is at MaxFine" fails without the patch (the fine stays at 60, not 30). 2. Apply the patch, prove t/db_dependent/Overdues.t t/db_dependent/Circulation.t t/db_dependent/Fines.t: all pass. 3. In the staff interface: MaxFine = 10, finesMode = Calculate and charge, a rule with a fine of 1 a day. A patron with two items, each 10 days overdue; run misc/cronjobs/fines.pl: the fines are capped, total 10. Check one item in with a return date 3 days after its due date (SpecifyReturnDate). Without the patch its fine stays as it was; with the patch it is recalculated to 3. Sponsored-by: Koha Solutions -- 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=24186 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |babarjunaid1122@gmail.com |ity.org | 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=24186 --- Comment #5 from babar junaid <babarjunaid1122@gmail.com> --- I have attached a fix, with a new test. Martin's test patch (attachment 96073) no longer applies: the UpdateFine tests in t/db_dependent/Overdues.t have been rewritten since 2019. The new subtest covers the same case (a fine recalculated lower, e.g. after a backdated return, while the patron is at MaxFine): on main the fine stays at 60 instead of going down to 30. The fix applies MaxFine only when the fine would grow. Attachment 96074 only adds debugging output and can be obsoleted. Tested on main (6ff8078): Overdues.t, Circulation.t and Fines.t pass; QA tools pass. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24186 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96073|0 |1 is obsolete| | Attachment #96074|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=24186 --- Comment #6 from babar junaid <babarjunaid1122@gmail.com> --- Obsoleted attachment 96073 (no longer applies; its case is covered by the new subtest in attachment 212184) and 96074 (debugging output only), so a tester only needs the one live patch. Thanks Martin for the original tests. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org