From 94d9eb9ad1bd72f85272bee9a2b6bd81d2a90759 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 4 Apr 2011 16:52:03 +0200 Subject: [PATCH] Bug 5098: Add csv headers in overdues Signed-off-by: Paul Poulain Signed-off-by: Chris Cormack (cherry picked from commit a3e55473555ee4b3a3dd4af81f1b163519278775) Signed-off-by: Chris Nighswonger --- misc/cronjobs/overdue_notices.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index bc97ecb5d5..698b87822f 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 = { -- 2.39.5