SQL thinko causing over-zealous reshelving of copies not yet out of their delay time...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 23 Sep 2009 16:46:32 +0000 (16:46 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 23 Sep 2009 16:46:32 +0000 (16:46 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14124 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm

index bb8ba73..0d28e6a 100644 (file)
@@ -152,8 +152,8 @@ sub complete_reshelving {
                           FROM $cp cp 
                     LEFT JOIN $setting setting
                         ON (cp.circ_lib = setting.org_unit AND setting.name = 'circ.reshelving_complete.interval')
-                    LEFT JOIN $circ circ ON (circ.target_copy = cp.id AND circ.id IS NULL)
-              WHERE cp.status = 7
+                    LEFT JOIN $circ circ ON (circ.target_copy = cp.id)
+              WHERE cp.status = 7 AND circ.id IS NULL
                     AND cp.create_date < NOW() - CAST( COALESCE( BTRIM( setting.value,'"' ), ? )  AS INTERVAL)
           )
        SQL