[Koha-patches] [PATCH] Bug 4257: Make advance notices actually go out by avoiding null selects

J. David Bavousett dbavousett at ptfs.com
Tue Feb 23 21:47:56 CET 2010


The wrong variable was used to select the number of days-until-due; this fixes it to use
the borrower's preference setting.
---
 misc/cronjobs/advance_notices.pl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl
index e365b61..4f085c1 100755
--- a/misc/cronjobs/advance_notices.pl
+++ b/misc/cronjobs/advance_notices.pl
@@ -185,7 +185,7 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) {
             my $letter_type = 'PREDUE';
             $letter = C4::Letters::getletter( 'circulation', $letter_type );
             die "no letter of type '$letter_type' found. Please see sample_notices.sql" unless $letter;
-            $sth->execute($upcoming->{'borrowernumber'},$upcoming->{'itemnumber'},$maxdays);
+            $sth->execute($upcoming->{'borrowernumber'},$upcoming->{'itemnumber'},$borrower_preferences->{'days_in_advance'});
             my $titles = "";
             while ( my $item_info = $sth->fetchrow_hashref()) {
               my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
@@ -241,7 +241,7 @@ PATRON: while ( my ( $borrowernumber, $count ) = each %$upcoming_digest ) {
     my $letter_type = 'PREDUEDGST';
     my $letter = C4::Letters::getletter( 'circulation', $letter_type );
     die "no letter of type '$letter_type' found. Please see sample_notices.sql" unless $letter;
-    $sth->execute($borrowernumber,$maxdays);
+    $sth->execute($borrowernumber,$borrower_preferences->{'days_in_advance'});
     my $titles = "";
     while ( my $item_info = $sth->fetchrow_hashref()) {
       my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
-- 
1.5.6.5




More information about the Koha-patches mailing list