Bug 37942 - Problematic calculation of overdue recall fine (overrides regular overdue fine)
Summary: Problematic calculation of overdue recall fine (overrides regular overdue fine)
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 19532
Blocks:
  Show dependency treegraph
 
Reported: 2024-09-17 12:14 UTC by Janusz Kaczmarek
Modified: 2024-09-17 12:14 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janusz Kaczmarek 2024-09-17 12:14:02 UTC
There is an issue with calculating fines when two conditions occur simultaneously: a regular overdue and a overdue recall.  Overdue recall fine always replaces the regular overdue fine which can lead to significant reduce or increase of previously calculated fine. 

To see the problem:

1. Set finesMode to 'Calculate and charge' and UseRecalls to 'Use'.
2. In 'Circulation and fine rules' set: 
   'Fine amount' = 1
   'Fine charging interval' = 1
   'Recalls allowed (total)' = 1
   'Recalls per record (count)' = 1
   'Recall due date interval (day)' = 7
   'Recall overdue fine amount' = 0.10
3. Checkout an item to a patron.
4. Manually, in the database, shift the due date to one year ago to create 'heavy' overdue (i.e. update issues set date_due = 'YYYY-MM-DD 23:59:00' where issue_id = N).
5. Execute the ./misc/cronjobs/fines.pl script; note the fine amount in the patron's account.  It should be about $365. 
6. From another patron's account make a recall on the issued item.
7. Manually, in the database, shift the created_date to a month ago (i.e. update recalls set created_date = 'YYYY-MM-DD HH:MM:SS' where recall_id = N).
8. Execute the ./misc/cronjobs/recalls/overdue_recalls.pl script.
9. Execute the ./misc/cronjobs/fines.pl script. Note that the fine amount in the first patron's account has decreased substantially.  It will be now about $36.50. 
(10. With 'Recall overdue fine amount' = 10 the new fine would be about $3,650 !).

This seems to be an unintended consequence of the changes C4::Overdues::CalcFine made by bug 19532 and quite a serious bug.