[Koha-bugs] [Bug 18855] Fines cronjob can cause duplicate fines if run during active circulation

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Mar 2 02:20:15 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18855

--- Comment #15 from Michael Hafen <michael.hafen at washk12.org> ---
I think I figured out why the code here was the way it was.  It has to do with
the possibility of a book being renewed and then becoming overdue again.  The
way the code was there would be a second overdue fine added to the account
lines for this second instance of the issue becoming overdue.
With the patches to dropping the status check the second overdue fine would
never get entered since the previous overdue fine would be found instead.  And
the table locking patch doesn't lock the table soon enough to fix the
duplication problem.  (Which is besides the fact that locking in a long running
process would totally kill the circulation desk.)
Which brings me back to using accountlines_id to find the overdue fine instead
of issue_id.  We need to either make sure the fines cron job doesn't run during
circulation hours, or find and use the accountlines_id when pulling the list of
overdues.  Those are the best solutions I can think of, either run the script
when things aren't going to change, or make sure the script can find the right
account line in case things change so we don't have a duplicate.

So, I need to either patch cronjobs/fines.pl and C4/Overdues.pm to use
accountlines_id, or patch the cron files to specify when the fines cron job
runs (move some jobs from cron.daily to cron.d).

I prefer patching fines.pl and C4/Overdues.pm, since I can't be sure how long
the cron jobs would run, and some should finish before others start.

Options and alternate solutions welcome.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list