From bf3797d12c8e3f8c5b1710103f00c43e323e7849 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 5 Jan 2011 15:35:51 +0100 Subject: [PATCH] Bug 6097: overdue_notices.pl: when 'no notice' debarred action not done When 'No notice' in overduerules, if action is debarr then the member would not be debarred. This patch fixes that. --- misc/cronjobs/overdue_notices.pl | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 5896abd..e482cf0 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -459,23 +459,20 @@ END_SQL ) = $sth->fetchrow ) { $verbose and warn "borrower $firstname, $lastname ($borrowernumber) has items triggering level $i."; + + if ( $overdue_rules->{"debarred$i"} ) { + #action taken is debarring + C4::Members::DebarMember($borrowernumber, '9999-12-31'); + $verbose and warn "debarring $borrowernumber $firstname $lastname\n"; + } my $letter = C4::Letters::getletter( 'circulation', $overdue_rules->{"letter$i"} ); unless ($letter) { $verbose and warn "Message '$overdue_rules->{letter$i}' content not found"; - - # might as well skip while PERIOD, no other borrowers are going to work. - # FIXME : Does this mean a letter must be defined in order to trigger a debar ? next PERIOD; } - if ( $overdue_rules->{"debarred$i"} ) { - - #action taken is debarring - C4::Members::DebarMember($borrowernumber, '9999-12-31'); - $verbose and warn "debarring $borrowernumber $firstname $lastname\n"; - } my @params = ($listall ? ( $borrowernumber , 1 , $MAX ) : ( $borrowernumber, $mindays, $maxdays )); $verbose and warn "STH2 PARAMS: borrowernumber = $borrowernumber, mindays = $mindays, maxdays = $maxdays"; $sth2->execute(@params); -- 1.7.9.1