From 1e02a2a4d1094703334b0dec7588da6b0dd7a51c 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 Signed-off-by: Chris Cormack --- 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 700cca5252..76f20d3a58 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -436,7 +436,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 @@ -544,6 +544,7 @@ END_SQL address2 => $address2, city => $city, postcode => $postcode, + country => $country, email => $email, itemcount => $itemcount, titles => $titles, @@ -572,6 +573,7 @@ END_SQL address2 => $address2, city => $city, postcode => $postcode, + country => $country, email => $email, itemcount => $itemcount, titles => $titles, @@ -597,7 +599,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 = { @@ -737,7 +739,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