When grace period specified in a circulation rule is greater than one day (fines charged daily) and a user returns an item (matching the circ rule) within the grace period, the fine is charged rather than ignored (zero). In one example, with a 14-day grace period, the fines log produced nightly by fines.pl shows: 22903 STU [snipped] 122222 2012-09-29 23:59:00 2 4 22951 STU [snipped] 125741 2012-10-11 23:59:00 -10 1 22965 STU [snipped] 77536 2012-10-14 23:59:00 -13 0.25 The negative numbers indicate how many days of grace period remain (-10 means the item is 4 days overdue); positive numbers shows how many days is overdue after the grace period. The negative values should result in no processing. There appears to be an error in the if condition that determines whether to process/charge a fine on an overdue (negative values result in a TRUE as well as positive values): if ($data->{'chargeperiod'} && $units_minus_grace ) { would work as expected if the second condition is changed: if ($data->{'chargeperiod'} && ($units_minus_grace > 0) ) { I've tested on 3.8.3 (Debian package installation) and the change works for daily accruing fines. I have not yet tested using an hourly fine rule, but after a quick glance it seems it should work as well. I'll try (I'm new to Git) to add/submit a patch next.
Created attachment 12893 [details] [review] Fine calculation condition update Proposed fix for errant grace period fine calculation.
Created attachment 12894 [details] [review] Bug 8939 : Fines being charged during the grace period Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Hi Robert Next time, can you make your patch using git format-patch This one had no commit message, or authorship details, I fixed that when signing off.
Thanks, Chris. I think I see what I did wrong now. I'll give it a better go next time.
QA comment: tiny patch, very good test plan, obviously fixing a problem. passed QA Robert, welcome as a contributor, you're 194th !
Patch pushed to master
Pushed to 3.8.x will be in 3.8.7