[Patches] [PATCH] Bug 7266: filter on "Patron flags" in overdue.pl

koha-patchbot at kohaaloha.com koha-patchbot at kohaaloha.com
Fri Nov 25 23:55:02 NZDT 2011


From: Adrien Saurat <adrien.saurat at biblibre.com>
Date: Fri, 25 Nov 2011 11:50:55 +0100
Subject: [PATCH] Bug 7266: filter on "Patron flags" in overdue.pl

Patron flags listbox now filter the results, depending
on values found in gonenoaddress, debarred and lost fields
in the borrowers table.
---
 circ/overdue.pl |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/circ/overdue.pl b/circ/overdue.pl
index 2bdafe1..acbdaa7 100755
--- a/circ/overdue.pl
+++ b/circ/overdue.pl
@@ -266,7 +266,15 @@ if ($noreport) {
     $strsth.=" AND (borrowers.firstname like '".$bornamefilter."%' or borrowers.surname like '".$bornamefilter."%' or borrowers.cardnumber like '".$bornamefilter."%')" if($bornamefilter) ;
     $strsth.=" AND borrowers.categorycode = '" . $borcatfilter   . "' " if $borcatfilter;
     $strsth.=" AND biblioitems.itemtype   = '" . $itemtypefilter . "' " if $itemtypefilter;
-    $strsth.=" AND borrowers.flags        = '" . $borflagsfilter . "' " if $borflagsfilter;
+    if ( $borflagsfilter eq 'gonenoaddress' ) {
+        $strsth .= " AND borrowers.gonenoaddress <> 0";
+    }
+    elsif ( $borflagsfilter eq 'debarred' ) {
+        $strsth .= " AND borrowers.debarred >=  CURDATE()" ;
+    }
+    elsif ( $borflagsfilter eq 'lost') {
+        $strsth .= " AND borrowers.debarred <> 0";
+    }
     $strsth.=" AND borrowers.branchcode   = '" . $branchfilter   . "' " if $branchfilter;
     $strsth.=" AND date_due < '" . $datedueto . "' "  if $datedueto;
     $strsth.=" AND date_due > '" . $dateduefrom . "' " if $dateduefrom;
-- 
1.7.4.1




More information about the Patches mailing list