From: Jason Stephenson Date: Tue, 15 Jul 2014 21:06:50 +0000 (-0400) Subject: Search for asset stat cat entries by owner in Evergreen driver _init. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=961d2805949f998c912ece344556dcedc192a0fc;p=working%2FNCIPServer.git Search for asset stat cat entries by owner in Evergreen driver _init. Signed-off-by: Jason Stephenson --- diff --git a/lib/NCIP/ILS/Evergreen.pm b/lib/NCIP/ILS/Evergreen.pm index 41ac7fc..952b2bf 100644 --- a/lib/NCIP/ILS/Evergreen.pm +++ b/lib/NCIP/ILS/Evergreen.pm @@ -310,13 +310,14 @@ sub _init { my $asce = $e->retrieve_asset_stat_cat_entry($_->{id}); push(@{$self->{asces}}, $asce) if ($asce); } elsif ($_->{asc} && $_->{name}) { - # We may actually want to retrieve the ancestor tree - # beginning with $self->{config}->{work_ou} and limit the - # next search where the owner is one of those org units. + # We want to limit the search to the work org and its + # ancestors. + my $ancestors = $U->get_org_ancestors($self->{config}->{work_ou}); my $result = $e->search_asset_stat_cat_entry( { stat_cat => $_->{asc}, - value => $_->{name} + value => $_->{name}, + owner => $ancestors } ); if ($result && @$result) {