Bug 10832: (follow-up) fix case where some print overdue notices were not being sent
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 13 Feb 2014 13:54:45 +0000 (14:54 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 2 May 2014 20:29:20 +0000 (20:29 +0000)
If overdues should be sent to some patron (on the same branch), only the
first one was notified.

This patch fixes this issue.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
misc/cronjobs/overdue_notices.pl

index 3778a82..855558d 100755 (executable)
@@ -454,8 +454,6 @@ END_SQL
     # my $outfile = 'overdues_' . ( $mybranch || $branchcode || 'default' );
     while ( my $overdue_rules = $rqoverduerules->fetchrow_hashref ) {
       PERIOD: foreach my $i ( 1 .. 3 ) {
-            my $print_sent = 0; # We never sent a print notice
-
             $verbose and warn "branch '$branchcode', pass $i\n";
             my $mindays = $overdue_rules->{"delay$i"};    # the notice will be sent after mindays days (grace period)
             my $maxdays = (
@@ -576,6 +574,8 @@ END_SQL
                 @message_transport_types = @{ GetOverdueMessageTransportTypes( q{}, $overdue_rules->{categorycode}, $i) }
                     unless @message_transport_types;
 
+
+                my $print_sent = 0; # A print notice is not yet sent for this patron
                 for my $mtt ( @message_transport_types ) {
 
                     my $letter = parse_letter(