Expand NCIP::ILS::Evergreen->_call_number_search to include descendants.
authorJason Stephenson <jstephenson@mvlc.org>
Mon, 5 Oct 2015 19:30:48 +0000 (15:30 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Mon, 5 Oct 2015 19:30:48 +0000 (15:30 -0400)
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
lib/NCIP/ILS/Evergreen.pm

index 6ebeeec..65712bc 100644 (file)
@@ -2743,7 +2743,19 @@ sub _call_number_search {
 
     my $search = {record => $bibid, deleted => 'f'};
     if ($location) {
-        $search->{owning_lib} = $location->id();
+        $search->{owning_lib} = {
+            in => {
+                select => {
+                    aou => [{
+                        column => 'id',
+                        transform => 'actor.org_unit_descendants',
+                        result_field => 'id'
+                    }]
+                },
+                from => 'aou',
+                where => {id => $location->id()}
+            }
+        };
     }
 
     # If flesh is passed a true value, we flesh copies, copy status,