From fc53d0d98209baa62629b9817595994c67e00854 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 5 Dec 2017 10:23:45 -0500 Subject: [PATCH] Bug 19750: Overdues without a fine rule add warnings to log MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When running fines.pl, any overdue items that have no corresponding circulation rule will generate the following warning: Use of uninitialized value $amount in numeric gt (>) at /usr/share/koha/bin/cronjobs/fines.pl line 133. Test Plan: 1) Create a single circ rule 2) Backdate a checkout so it is overdue 3) Delete the circ rule 4) Run fines.pl, note the warning 5) Apply this patch 6) Run fines.pl, note the warning is gone Signed-off-by: Dilan Johnpullé Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens --- misc/cronjobs/fines.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl index 6c3f830e30..87c732e27a 100755 --- a/misc/cronjobs/fines.pl +++ b/misc/cronjobs/fines.pl @@ -130,7 +130,7 @@ for my $overdue ( @{$overdues} ) { # Don't update the fine if today is a holiday. # This ensures that dropbox mode will remove the correct amount of fine. if ( $mode eq 'production' && !$is_holiday{$branchcode} ) { - if ( $amount > 0 ) { + if ( $amount && $amount > 0 ) { UpdateFine( { issue_id => $overdue->{issue_id}, -- 2.39.5