[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
Fri Nov 19 11:03:49 CET 2021


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

--- Comment #6 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 127851
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127851&action=edit
Bug 18855: Don't create duplicate overdue fines if an issue is returned

If cronjobs/fines.pl is running during circulation hours, then an issue may
be considered for having it's overdue fine updated after the issue has been
returned and it's fine status flipped from 'UNRETURNED' to 'RETURNED'.  In
this case UpdateFine will create a duplicate fine because it can't find the
specific accountline for the overdue and unreturned fine.

This changes UpdateFine to not care about status, so the accountline will be
found, until it comes to adjusting the fine.  At this point if the fine is
'UNRETURNED' or 'CalculateFinesOnReturn' is off (the book was returned and
it's overdue fine status flipped, but the amount wasn't updated), then go
ahead and adjust the fine amount.

Test plan:
1. find an overdue fine near the end of the list of overdue fines that
   cronjobs/fines.pl will be considering.
2. start cronjobs/fines.pl.
3. immediately check in the overdue book.
4. once fines.pl is finished observe that a duplicate overdue fine has been
   created on the patrons account.

5. apply patch.
6. repeat 1 - 4 and observe that the duplicate fine was not created.

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

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


More information about the Koha-bugs mailing list