Bug 16610 - Regression in SIP2 user password handling
[koha.git] / offline_circ / download.pl
index 95c2aea..713057c 100755 (executable)
@@ -19,7 +19,7 @@
 #
 
 use Modern::Perl;
-use CGI;
+use CGI qw ( -utf8 );
 use JSON;
 use C4::Auth;
 use C4::Output;
@@ -39,7 +39,8 @@ my $patrons_query = q{SELECT
     borrowers.borrowernumber, cardnumber, surname, firstname, title,
     othernames, initials, streetnumber, streettype, address, address2, city,
     state, zipcode, country, email, phone, mobile, fax, dateofbirth, branchcode,
-    categorycode, dateenrolled, dateexpiry, gonenoaddress, lost, debarred,
+    categorycode, dateenrolled, dateexpiry, COALESCE(gonenoaddress, 0) AS gonenoaddress,
+    COALESCE(lost, 0) AS lost, debarred,
     debarredcomment, SUM(accountlines.amountoutstanding) AS fine
     FROM borrowers
     LEFT JOIN accountlines ON borrowers.borrowernumber=accountlines.borrowernumber