Bug 30254: Don't charge overdue fines unless some fine exists
authorNick Clemens <nick@bywatersolutions.com>
Mon, 31 Oct 2022 18:38:04 +0000 (18:38 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 30 Jan 2023 13:36:30 +0000 (10:36 -0300)
commit9f569f97d27481d78f3703251cc0583a07bb49f1
treea0c17dac08844c997e059a9c698eaad5edf2b0c2
parentba6b380d9180f9a2cfc622bc644b069018196c2b
Bug 30254: Don't charge overdue fines unless some fine exists

We need to determine if a book was lost by a patron, the clues we have
are previous charges. If we don't find any, we shouldn't charge a new fine

To test:
 1 - set Lost item fee refund on return policy to "Refund lost item charge and charge new overdue fine", turn on FinesMode, make sure your circ rules charge fines
 2 - have an itemtype / patron combo that charges an overdue fine
 3 - check item out (with a due date in the future) and then right back in again
 4 - confirm patron doesn't have a fine because the item was not late
 5 - set the item to Lost
 6 - in the database, edit the date_due of your checkout to a date in the past
 7 - check the item in, it is marked found
 8 - confirm your patron now has a fine
 9 - Apply patch
10 - Repeat with a new item and patron
11 - Confirm no charges

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/Item.pm