fixed some syntax errors. repaired descendent org fetching
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Jan 2008 15:34:36 +0000 (15:34 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Jan 2008 15:34:36 +0000 (15:34 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8364 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Acq.pm
Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm
Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm

index aecdba8..2048e16 100644 (file)
@@ -3,12 +3,9 @@ use base qw/OpenILS::Application/;
 use strict; use warnings;
 
 use OpenSRF::Utils::Logger qw(:logger);
-use OpenILS::Utils::Fieldmapper;
 use OpenILS::Utils::CStoreEditor q/:funcs/;
-use OpenILS::Const qw/:const/;
-use OpenSRF::Utils::SettingsClient;
-use OpenILS::Event;
 
 use OpenILS::Application::Acq::Picklist;
 use OpenILS::Application::Acq::Financials;
 
+1;
index 68f5f86..8103f3e 100644 (file)
@@ -8,6 +8,8 @@ use OpenILS::Utils::CStoreEditor q/:funcs/;
 use OpenILS::Const qw/:const/;
 use OpenSRF::Utils::SettingsClient;
 use OpenILS::Event;
+use OpenILS::Application::AppUtils;
+my $U = 'OpenILS::Application::AppUtils';
 
 my $BAD_PARAMS = OpenILS::Event->new('BAD_PARAMS');
 
@@ -63,7 +65,7 @@ __PACKAGE__->register_method(
        /
 );
 
-sub retrieve_org_fund {
+sub retrieve_org_funds {
     my($self, $conn, $auth, $org_id, $options) = @_;
     my $e = new_editor(authtoken=>$auth);
     return $e->event unless $e->checkauth;
@@ -72,12 +74,13 @@ sub retrieve_org_fund {
     my $search = {owner => $org_id};
 
     if($$options{children}) {
-        $org_list = $e->search_actor_org_unit([
-            {id => $org_id}, {
-                flesh => -1,
-                flesh_fields => {aou => ['children']}
-            }
-        ]);
+        # grab the descendent orgs
+        my $org = $e->retrieve_actor_org_unit(
+            [$org_id, {flesh=>1, flesh_fields=>{aou=>['ou_type']}}]) or return $e->event;
+        my $org_list = $U->simplereq(
+            'open-ils.storage',
+            'open-ils.storage.actor.org_unit.descendants.atomic',
+            $org_id, $org->ou_type->depth);
 
         my $org_ids = [];
         push(@$org_ids, $_->id) for @$org_list;
@@ -89,4 +92,4 @@ sub retrieve_org_fund {
 }
 
 
-
+1;