From 6af71eb13a7bd32b115bdae3cbdddd7315cb0c3c Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Sat, 1 May 2010 00:19:47 +0200 Subject: [PATCH] MT3346 : overdue_notices -csv was not working as advertised. This feature is now working as it is forecast Signed-off-by: Henri-Damien LAURENT Signed-off-by: Galen Charlton --- misc/cronjobs/overdue_notices.pl | 53 +++++++++++++++----------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 04a5a0fa97..4de6cdd0a4 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -566,39 +566,34 @@ END_SQL } if (@output_chunks) { - if ($nomail) { - if ( defined $csvfilename ) { - print $csv_fh @output_chunks; - } elsif ( defined $htmlfilename ) { - print $html_fh @output_chunks; - } else { - local $, = "\f"; # pagebreak - print @output_chunks; - } - } + if ( defined $csvfilename ) { + print $csv_fh @output_chunks; + } elsif ( defined $htmlfilename ) { print $html_fh @output_chunks; } - else { - my $attachment = { - filename => defined $csvfilename ? 'attachment.csv' : 'attachment.txt', - type => 'text/plain', - content => join( "\n", @output_chunks ) - }; - - my $letter = { - title => 'Overdue Notices', - content => 'These messages were not sent directly to the patrons.', - }; - C4::Letters::EnqueueLetter( - { letter => $letter, - borrowernumber => undef, - message_transport_type => 'email', - attachments => [$attachment], - to_address => $admin_email_address, - } - ); + elsif ($nomail){ + local $, = "\f"; # pagebreak + print @output_chunks; } + my $attachment = { + filename => defined $csvfilename ? 'attachment.csv' : 'attachment.txt', + type => 'text/plain', + content => join( "\n", @output_chunks ) + }; + + my $letter = { + title => 'Overdue Notices', + content => 'These messages were not sent directly to the patrons.', + }; + C4::Letters::EnqueueLetter( + { letter => $letter, + borrowernumber => undef, + message_transport_type => 'email', + attachments => [$attachment], + to_address => $admin_email_address, + } + ); } } -- 2.39.5