Bug 29800 - Add option to calculate fines when an item is marked lost
Summary: Add option to calculate fines when an item is marked lost
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-05 16:37 UTC by Andrew Fuerste-Henry
Modified: 2026-01-27 15:40 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 29800: Add new system preference WhenLostUpdateFine (2.48 KB, patch)
2026-01-23 13:53 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 29800: Add calculation and update of fine to LostItem (3.09 KB, patch)
2026-01-23 13:53 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 29800: Add new system preference WhenLostUpdateFine (3.39 KB, patch)
2026-01-23 17:27 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 29800: Add calculation and update of fine to LostItem (4.89 KB, patch)
2026-01-23 17:27 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2022-01-05 16:37:44 UTC
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.
Comment 1 Nick Clemens (kidclamp) 2026-01-23 13:53:32 UTC Comment hidden (obsolete)
Comment 2 Nick Clemens (kidclamp) 2026-01-23 13:53:35 UTC Comment hidden (obsolete)
Comment 3 Andrew Fuerste-Henry 2026-01-23 14:40:54 UTC Comment hidden (obsolete)
Comment 4 Nick Clemens (kidclamp) 2026-01-23 17:27:03 UTC
Created attachment 191968 [details] [review]
Bug 29800: Add new system preference WhenLostUpdateFine
Comment 5 Nick Clemens (kidclamp) 2026-01-23 17:27:05 UTC
Created attachment 191969 [details] [review]
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