Fixed the holds queue job so that it correctly
ignores hold requests that are not yet scheduled
to be filled.
---
 misc/cronjobs/holds/build_holds_queue.pl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/misc/cronjobs/holds/build_holds_queue.pl 
b/misc/cronjobs/holds/build_holds_queue.pl
index 4aca28d..4f9549f 100755
--- a/misc/cronjobs/holds/build_holds_queue.pl
+++ b/misc/cronjobs/holds/build_holds_queue.pl
@@ -83,7 +83,8 @@ sub GetBibsWithPendingHoldRequests {
     my $bib_query = "SELECT DISTINCT biblionumber
                      FROM reserves
                      WHERE found IS NULL
-                     AND priority > 0";
+                     AND priority > 0
+                     AND reservedate <= CURRENT_DATE()";
     my $sth = $dbh->prepare($bib_query);
 
     $sth->execute();
@@ -129,6 +130,7 @@ sub GetPendingHoldRequestsForBib {
                          WHERE biblionumber = ?
                          AND found IS NULL
                          AND priority > 0
+                         AND reservedate <= CURRENT_DATE()
                          ORDER BY priority";
     my $sth = $dbh->prepare($request_query);
     $sth->execute($biblionumber);
-- 
1.5.6.5

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to