ffzg/recall_notices.pl: added --interval and --dedup
[koha.git] / offline_circ / download.pl
index 95c2aea..2b6c67e 100755 (executable)
@@ -19,7 +19,7 @@
 #
 
 use Modern::Perl;
-use CGI;
+use CGI qw ( -utf8 );
 use JSON;
 use C4::Auth;
 use C4::Output;
@@ -27,8 +27,7 @@ use C4::Context;
 use C4::Koha;
 
 my $query = new CGI;
-my ( $template, $loggedinuser, $cookie, $flags ) =
-  checkauth( $query, undef, { circulate => "circulate_remaining_permissions" },
+checkauth( $query, undef, { circulate => "circulate_remaining_permissions" },
     "intranet" );
 
 my $page     = $query->param('page') || 0;
@@ -39,7 +38,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