Allow staff search to find bibs sans copies
authorThomas Berezansky <tsbere@mvlc.org>
Wed, 6 Jul 2011 16:54:03 +0000 (12:54 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 7 Jul 2011 17:02:06 +0000 (13:02 -0400)
AKA, no call number OR no call numbers with copies

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/300.schema.staged_search.sql

index 79de913..ebea8cd 100644 (file)
@@ -283,7 +283,9 @@ BEGIN
 
                     PERFORM 1
                       FROM  asset.call_number cn
+                            JOIN asset.copy cp ON (cp.call_number = cn.id)
                       WHERE cn.record IN ( SELECT * FROM unnest( core_result.records ) )
+                            AND NOT cp.deleted
                       LIMIT 1;
 
                     IF FOUND THEN