[Koha-patches] [PATCH 2/4] future hold request followup 2 - fix queries

Galen Charlton gmcharlt at gmail.com
Wed Aug 12 01:23:25 CEST 2009


Clarify when it is necessary to add a
'reservedate <= CURRENT_DATE()' clause.
---
 C4/Reserves.pm |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/C4/Reserves.pm b/C4/Reserves.pm
index ad345ca..9ee753c 100644
--- a/C4/Reserves.pm
+++ b/C4/Reserves.pm
@@ -610,11 +610,11 @@ sub CheckReserves {
     ";
 
     if ($item) {
-        $sth = $dbh->prepare("$select WHERE reservedate <= CURRENT_DATE() AND itemnumber = ?");
+        $sth = $dbh->prepare("$select WHERE itemnumber = ?");
         $sth->execute($item);
     }
     else {
-        $sth = $dbh->prepare("$select WHERE reservedate <= CURRENT_DATE() AND barcode = ?");
+        $sth = $dbh->prepare("$select WHERE barcode = ?");
         $sth->execute($barcode);
     }
     # note: we get the itemnumber because we might have started w/ just the barcode.  Now we know for sure we have it.
@@ -1351,7 +1351,7 @@ sub _Findgroupreserve {
           AND reserves.reservedate    = reserveconstraints.reservedate )
           OR  reserves.constrainttype='a' )
           AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?)
-          AND reservedate <= CURRENT_DATE()
+          AND reserves.reservedate <= CURRENT_DATE()
     /;
     $sth = $dbh->prepare($query);
     $sth->execute( $biblio, $bibitem, $itemnumber );
-- 
1.5.6.5



More information about the Koha-patches mailing list