From fbefa35a51627f953e3e6669186cc39e4d9afe2b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 16 Dec 2014 17:15:58 +0000 Subject: [PATCH] BUG 13468: Overdue notice lists all checked out books This patch should fix the issue when running under 'triggered' mode To test: 1) Run overdue_notices.pl -t -n [to output notices to command line] 2) Note that the notices output, list ALL checked out items 3) Apply Patch 4) Run again 5) Note the difference --- misc/cronjobs/overdue_notices.pl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 4e58e8a..28eaea3 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -615,14 +615,24 @@ END_SQL dt_from_string( $item_info->{date_due} ) ); } $days_between = $days_between->in_units('days'); - if ($listall){ - unless ($days_between >= 1 and $days_between <= $MAX){ + if ($listall) { + unless ( $days_between >= 1 and $days_between <= $MAX ) + { next; } } else { - unless ($days_between >=$mindays && $days_between <= $maxdays){ - next; + if ($triggered) { + if ( $mindays != $days_between ) { + next; + } + } + else { + unless ( $days_between >= $mindays + && $days_between <= $maxdays ) + { + next; + } } } -- 1.7.10.4