X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=misc%2Fcronjobs%2Foverdue_notices.pl;h=37774b523ec26903e1e110487543b4de2800158e;hb=624b1562d8567dabd23cb4e1ac7e34615e604edc;hp=bc97ecb5d5589bfc326e4c8851d2768e880f3444;hpb=97446f86ced2c2d6d4d7a11b97ed81a5a0a25d95;p=koha_fer diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index bc97ecb5d5..37774b523e 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -584,10 +584,14 @@ END_SQL local $, = "\f"; # pagebreak print @output_chunks; } + # Generate the content of the csv with headers + my $content = join(";", qw(title name surname address1 address2 zipcode city email itemcount itemsinfo due_date issue_date)) . "\n"; + $content .= join( "\n", @output_chunks ); + my $attachment = { filename => defined $csvfilename ? 'attachment.csv' : 'attachment.txt', type => 'text/plain', - content => join( "\n", @output_chunks ) + content => $content, }; my $letter = { @@ -644,6 +648,9 @@ sub parse_letter { # FIXME: this code should probably be moved to C4::Letters:pa return unless exists $params->{$required}; } + my $todaysdate = C4::Dates->new()->output("syspref"); + $params->{'letter'}->{title} =~ s/<>/$todaysdate/g; + $params->{'letter'}->{content} =~ s/<>/$todaysdate/g; if ( $params->{'substitute'} ) { while ( my ( $key, $replacedby ) = each %{ $params->{'substitute'} } ) {