From 101b6c30d8a8c767e01b86d598930de03e44cdfd Mon Sep 17 00:00:00 2001
From: Fridolyn SOMERS <fridolyn.somers@biblibre.com>
Date: Mon, 3 Dec 2012 10:12:42 +0100
Subject: [PATCH] Bug 9104: country in CSV in overdue_notices.pl
---
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 e83bd39..737fa34 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).
- # <date> <itemcount> <firstname> <lastname> <address1> <address2> <address3> <city> <postcode>
+ # <date> <itemcount> <firstname> <lastname> <address1> <address2> <address3> <city> <postcode> <country>
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";
--
1.7.9.5