From 718c2b466f1124bc22b5a091998acb7f8ce8edc5 Mon Sep 17 00:00:00 2001 From: miker Date: Mon, 30 Oct 2006 23:53:20 +0000 Subject: [PATCH] reshelving for items just out of in-process git-svn-id: svn://svn.open-ils.org/ILS/trunk@6530 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Storage/Publisher/action.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm index 610b4c4ddf..1a27fa0800 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -135,12 +135,19 @@ sub complete_reshelving { AND cp.status = 7 GROUP BY 1 HAVING MAX(circ.checkin_time) < NOW() - CAST(? AS INTERVAL) - ) AS foo - ) + ) AS foo + ) + OR id IN + ( SELECT cp.id + FROM $cp cp + LEFT JOIN $circ circ ON (circ.target_copy = cp.id AND circ.id IS NULL) + WHERE cp.status = 7 + AND cp.create_date > NOW() - CAST(? AS INTERVAL) + ) SQL my $sth = action::circulation->db_Main->prepare_cached($sql); - $sth->execute($window); + $sth->execute($window, $window); return $sth->rows; -- 2.11.0