[Bug 29800] New: Add option to calculate fines when an item is marked lost
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29800 Bug ID: 29800 Summary: Add option to calculate fines when an item is marked lost Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com We have the system preferences CalculateFinesOnReturn and CalculateFinesOnBackdate to make Koha calculate overdue fines as an item is returned, either in place of or in addition to the fines cron. However, if one marks an item as lost and has MarkLostItemAsReturned enabled, the issue will be ended without an overdue fine being calculated. We should add the option to calculate an overdue fine at the moment of marking an item lost. -- 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=29800 --- Comment #1 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 191937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191937&action=edit Bug 29800: Add new system preference WhenLostUpdateFine -- 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=29800 --- Comment #2 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 191938 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191938&action=edit Bug 29800: Add calculation and update of fine to LostItem This patch adds a call to 'CalculateAndUpdateFine' to LostItem, checking if the new syspref WhenLostUpdateFine is enabled -- 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=29800 --- Comment #3 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Test plan: 1 - define a circ rule with an overdue fine, confirm FinesMode is set to "Calculate and charge." 2 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 3 - edit your item to apply a lost status, 4 - confirm no fine is generated 5 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 6 - mark your item lost via the longoverdue cron 7 - confirm no fine is generated 8 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 9 - run fines.pl, confirm an accruing fine has been generated 10 - edit your circ rule to change the fine amount 11 - edit your item to apply a lost status 12 - confirm your fine is now marked "Lost" rather than "Accruing" but the amount has not updated to reflect your changes from step 10 13 - apply patch, updatedatabse, restart_all 14 - confirm new system preference WhenLostUpdateFine is set to No 15 - repeat steps 2 - 12, confirm no change in behavior 16 - set WhenLostUpdateFine to Yes 17 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 18 - edit your item to apply a lost status, 19 - confirm a fine is generated 20 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 21 - mark your item lost via the longoverdue cron 22 - confirm a fine is generated 23 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 24 - run fines.pl, confirm an accruing fine has been generated 25 - edit your circ rule to change the fine amount 26 - edit your item to apply a lost status 27 - confirm your fine is now marked "Lost" rather than "Accruing" and the amount has updated to reflect your changes from step 25 -- 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=29800 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191937|0 |1 is obsolete| | Attachment #191938|0 |1 is obsolete| | --- Comment #4 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 191968 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191968&action=edit Bug 29800: Add new system preference WhenLostUpdateFine -- 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=29800 --- Comment #5 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 191969 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191969&action=edit Bug 29800: Add calculation and update of fine to LostItem This patch adds a call to 'CalculateAndUpdateFine' to LostItem, checking if the new syspref WhenLostUpdateFine is enabled Test plan: 1 - define a circ rule with an overdue fine, confirm FinesMode is set to "Calculate and charge." 2 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 3 - edit your item to apply a lost status, 4 - confirm no fine is generated 5 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 6 - mark your item lost via the longoverdue cron 7 - confirm no fine is generated 8 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 9 - run fines.pl, confirm an accruing fine has been generated 10 - edit your circ rule to change the fine amount 11 - edit your item to apply a lost status 12 - confirm your fine is now marked "Lost" rather than "Accruing" but the amount has not updated to reflect your changes from step 10 13 - apply patch, updatedatabse, restart_all 14 - confirm new system preference WhenLostUpdateFine is set to No 15 - repeat steps 2 - 12, confirm no change in behavior 16 - set WhenLostUpdateFine to Yes 17 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 18 - edit your item to apply a lost status, 19 - confirm a fine is generated 20 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 21 - mark your item lost via the longoverdue cron 22 - confirm a fine is generated 23 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 24 - run fines.pl, confirm an accruing fine has been generated 25 - edit your circ rule to change the fine amount 26 - edit your item to apply a lost status 27 - confirm your fine is now marked "Lost" rather than "Accruing" and the amount has updated to reflect your changes from step 25 -- 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=29800 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |nick@bywatersolutions.com Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- 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=29800 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |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=29800 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191968|0 |1 is obsolete| | Attachment #191969|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=29800 --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197915 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197915&action=edit Bug 29800: Add new system preference WhenLostUpdateFine Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29800 --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197916 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197916&action=edit Bug 29800: Add calculation and update of fine to LostItem This patch adds a call to 'CalculateAndUpdateFine' to LostItem, checking if the new syspref WhenLostUpdateFine is enabled Test plan: 1 - define a circ rule with an overdue fine, confirm FinesMode is set to "Calculate and charge." 2 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 3 - edit your item to apply a lost status, 4 - confirm no fine is generated 5 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 6 - mark your item lost via the longoverdue cron 7 - confirm no fine is generated 8 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 9 - run fines.pl, confirm an accruing fine has been generated 10 - edit your circ rule to change the fine amount 11 - edit your item to apply a lost status 12 - confirm your fine is now marked "Lost" rather than "Accruing" but the amount has not updated to reflect your changes from step 10 13 - apply patch, updatedatabse, restart_all 14 - confirm new system preference WhenLostUpdateFine is set to No 15 - repeat steps 2 - 12, confirm no change in behavior 16 - set WhenLostUpdateFine to Yes 17 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 18 - edit your item to apply a lost status, 19 - confirm a fine is generated 20 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 21 - mark your item lost via the longoverdue cron 22 - confirm a fine is generated 23 - check out an item with a due date in the past such that it would incur an overdue fine if checked in 24 - run fines.pl, confirm an accruing fine has been generated 25 - edit your circ rule to change the fine amount 26 - edit your item to apply a lost status 27 - confirm your fine is now marked "Lost" rather than "Accruing" and the amount has updated to reflect your changes from step 25 Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29800 --- Comment #8 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197917 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197917&action=edit Bug 29800: (QA follow-up) Fix sysprefs.sql ordering The previous patch inserted WhenLostUpdateFine between WhenLostChargeReplacementFee and WhenLostForgiveFine, breaking the alphabetical ordering of sysprefs.sql (bug 10610). Move it below WhenLostForgiveFine so the file remains sorted. Test plan: 1 - Open installer/data/mysql/mandatory/sysprefs.sql 2 - Confirm the WhenLost* entries now appear in alphabetical order: WhenLostChargeReplacementFee, WhenLostForgiveFine, WhenLostUpdateFine 3 - Run /kohadevbox/qa-test-tools/koha-qa.pl -c 3 -v 2 and confirm the sysprefs_order warning is gone. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29800 --- Comment #9 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197918 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197918&action=edit Bug 29800: (QA follow-up) Coordinate WhenLostUpdateFine with WhenLostForgiveFine Both preferences act on the overdue fine when an item is marked lost: WhenLostUpdateFine recalculates and persists it, WhenLostForgiveFine zeroes it. If both are enabled, we used to compute the updated fine and then immediately wipe it a few lines later in _FixOverduesOnReturn. Make WhenLostForgiveFine take precedence: when it is on, skip the recalculation entirely so we don't do wasted DB writes. Document the precedence in the admin UI text. Test plan: 1 - Define a circ rule with an overdue fine, FinesMode = production. 2 - Check out an item with a due date in the past. 3 - Run fines.pl so an accruing fine exists. 4 - Edit the circ rule to change the fine amount. 5 - Enable WhenLostUpdateFine and WhenLostForgiveFine. 6 - Mark the item lost. 7 - Confirm the fine on the patron is 0 (forgiven), no accounting churn in the intervening step. 8 - Confirm the circulation admin page shows the precedence note on WhenLostUpdateFine. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29800 --- Comment #10 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197919 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197919&action=edit Bug 29800: (QA follow-up) Document LostItem behaviour in POD LostItem's POD only described the skip_record_index parameter. Expand it to cover what the function actually does and the system preferences that drive its behaviour (WhenLostUpdateFine, WhenLostForgiveFine, WhenLostChargeReplacementFee, MarkLostItemsAsReturned), including the precedence between the update and forgive preferences. Test plan: 1 - perldoc C4/Circulation.pm 2 - Confirm the LostItem section now documents the sysprefs that influence its behaviour and the update/forgive precedence. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29800 --- Comment #11 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197920 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197920&action=edit Bug 29800: (QA follow-up) Add unit tests for WhenLostUpdateFine Add a subtest to t/db_dependent/Circulation/Returns.t exercising the new behaviour introduced by Bug 29800: * With WhenLostUpdateFine disabled, LostItem does not persist a new overdue fine. * With WhenLostUpdateFine enabled, LostItem calculates and persists the overdue fine (new checkout path). * With both WhenLostUpdateFine and WhenLostForgiveFine enabled, the forgive preference takes precedence and no overdue fine remains, confirming the coordination added earlier. * With WhenLostUpdateFine enabled and an existing accruing fine, LostItem updates the fine amount to reflect the current circulation rule (the original motivation for the preference). Test plan: 1 - Apply this patch. 2 - prove t/db_dependent/Circulation/Returns.t 3 - Confirm the new subtest 'LostItem | WhenLostUpdateFine' reports 6 passing assertions and the suite is green. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29800 Jackie U <jackie.usher@westsussex.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jackie.usher@westsussex.gov | |.uk -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org