Bug 38477 - Regression: new overdue fine applied incorrectly when using "Refund Lost Item Charge and Charge New Overdue Fine" option in circ rules
Summary: Regression: new overdue fine applied incorrectly when using "Refund Lost Item...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords: regression, RM_priority
Depends on: 30254
Blocks:
  Show dependency treegraph
 
Reported: 2024-11-18 20:10 UTC by Andrew Fuerste-Henry
Modified: 2024-11-19 15:22 UTC (History)
2 users (show)

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 Andrew Fuerste-Henry 2024-11-18 20:10:10 UTC
Bug 30254 fixed this something like this previously. We're seeing erroneous fines created for patrons who previously returned something on time. In production, this occurs when an item is marked lost while not checked out to a patron. When that item is later found and checked in, Koha finds the most recent checkout and generates an overdue fine using the current date as the return date of the item (even though the item was returned at some point in the past).

Set these sysprefs:
- FinesMode: Calculate and Charge
- WhenLostForgiveFine: Forgive
- WhenLostChargeReplacementFee: Charge

In circ rules:
- Have a rule that charges fines
- Set Refund lost item replacement fee to "Refund lost item charge and charge new overdue fine"

1 - Have/create item with replacement price
2 - Check item out to patron 1, due date in past
3 - Run fines.pl
4 - confirm fines on patron 1
5 - mark item lost
6 - confirm replacement cost generated and fine forgiven on patron 1
7 - check item in 
8 - confirm replacement cost forgiven and new fine generated on patron 1
9 - check item out to patron 2, due date in future
10 - check item in
11 - mark item lost (no replacement fee generated because item is not checked out)
12 - in database, update date_due for checkout to patron 2, set to a date in the past
13 - check item in
14 - confirm patron 2 now has a fine

At step 12 we're pushing the date_due of the old issue into the past to make date_due<curdate(). In production, this comes up when there are days between steps 10 and 13.