[Koha-patches] [PATCH] preliminary patch: restore wildcard lookup when checking number of renewals

Galen Charlton gmcharlt at gmail.com
Thu Apr 29 00:24:15 CEST 2010


Feedback requested - patch adds ability to take wildcard patron category
and item type rows in the circulation rules into account when
checking to see how many renewals are permitted for a loan.  Prior to this
patch, if there wasn't a rule matching exactly on patron category and item type,
no renewals were permitted.
---
 C4/Circulation.pm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index 00b11ef..dfcb1ef 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -2062,9 +2062,9 @@ sub CanBookBeRenewed {
                    LEFT JOIN biblioitems USING (biblioitemnumber)
                    
                    WHERE
-                    issuingrules.categorycode = borrowers.categorycode
+                    (issuingrules.categorycode = borrowers.categorycode OR issuingrules.categorycode = '*')
                    AND
-                    issuingrules.itemtype = $itype
+                    (issuingrules.itemtype = $itype OR issuingrules.itemtype = '*')
                    AND
                     (issuingrules.branchcode = $controlbranch OR issuingrules.branchcode = '*') 
                    AND 
-- 
1.7.0




More information about the Koha-patches mailing list