From c0d2db7781e24ca00691620733072b3c0573fb35 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Mon, 3 Dec 2012 10:12:42 +0100 Subject: [PATCH] Bug 9104: country in CSV in overdue_notices.pl Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer Output of of the overdues script with -csv now contains country from the first address in the patron account. I checked output for 2 patrons, one with and one without country in the patron's address. All tests pass. Perlcritic fails before and after: "require" statement with library name as string at line 29, column 12. Use a bareword instead. (Severity: 5) Signed-off-by: Jared Camins-Esakov --- misc/cronjobs/overdue_notices.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index e83bd39bd2..737fa34b4b 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -442,7 +442,7 @@ END_SQL # this text contains fields that are replaced by their value. Those fields must be written between brackets # The following fields are available : # itemcount is interpreted here as the number of items in the overdue range defined by the current notice or all overdues < max if(-list-all). - # + # my $borrower_sql = <<'END_SQL'; SELECT distinct(issues.borrowernumber), firstname, surname, address, address2, city, zipcode, country, email @@ -551,6 +551,7 @@ END_SQL address2 => $address2, city => $city, postcode => $postcode, + country => $country, email => $email, itemcount => $itemcount, titles => $titles, @@ -579,6 +580,7 @@ END_SQL address2 => $address2, city => $city, postcode => $postcode, + country => $country, email => $email, itemcount => $itemcount, titles => $titles, @@ -604,7 +606,7 @@ END_SQL 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"; + my $content = join(";", qw(title name surname address1 address2 zipcode city country email itemcount itemsinfo due_date issue_date)) . "\n"; $content .= join( "\n", @output_chunks ); my $attachment = { @@ -744,7 +746,7 @@ sub prepare_letter_for_printing { if ( exists $params->{'outputformat'} && $params->{'outputformat'} eq 'csv' ) { if ($csv->combine( $params->{'firstname'}, $params->{'lastname'}, $params->{'address1'}, $params->{'address2'}, $params->{'postcode'}, - $params->{'city'}, $params->{'email'}, $params->{'itemcount'}, $params->{'titles'} + $params->{'city'}, $params->{'country'}, $params->{'email'}, $params->{'itemcount'}, $params->{'titles'} ) ) { return $csv->string, "\n"; -- 2.39.5