Fixing bug with CanBookBeReserved ... rules for default borrower codes were being...
authorChris Cormack <chrisc@catalyst.net.nz>
Mon, 14 Dec 2009 01:07:21 +0000 (14:07 +1300)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Sun, 20 Dec 2009 13:31:37 +0000 (14:31 +0100)
C4/Reserves.pm

index 031ca32..d98b838 100644 (file)
@@ -352,7 +352,7 @@ sub CanBookBeReserved{
     my @args;
     my $rightsquery = "SELECT categorycode, itemtype, branchcode, reservesallowed 
                        FROM issuingrules 
-                       WHERE categorycode = ?";
+                       WHERE categorycode IN (?, '*')";
     push @args,$borrower->{categorycode};
 
     if($controlbranch eq "ItemHomeLibrary"){
@@ -370,7 +370,6 @@ sub CanBookBeReserved{
     }
     
     $rightsquery .= " ORDER BY categorycode DESC, itemtype DESC, branchcode DESC";
-    
     my $sthrights = $dbh->prepare($rightsquery);
     $sthrights->execute(@args);
     
@@ -405,7 +404,6 @@ sub CanBookBeReserved{
     if(my $row = $sthcount->fetchrow_hashref()){
        $reservescount = $row->{count};
     }
-    
     if($reservescount < $reservesrights){
         return 1;
     }else{