From: miker Date: Thu, 9 Sep 2010 16:30:01 +0000 (+0000) Subject: loop over users in a group, as the plan for usrgroup+mous is terrible X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1244a386977ff65263bb2789857ca62c45bd0854;p=evergreen%2Fmasslnc.git loop over users in a group, as the plan for usrgroup+mous is terrible git-svn-id: svn://svn.open-ils.org/ILS/trunk@17545 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor/UserGroups.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor/UserGroups.pm index 0d2305d2af..7691fe5c94 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor/UserGroups.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor/UserGroups.pm @@ -24,21 +24,21 @@ sub group_money_summary { my $e = new_editor(authtoken=>$auth); return $e->event unless $e->checkauth; return $e->event unless $e->allowed('VIEW_USER'); - return $e->json_query( - { - select => {mous => ['usr', 'balance_owed']}, - from => 'mous', - where => { - usr => { - in => { - select => {au => ['id']}, - from => 'au', - where => {usrgroup => $group_id} - } - } + + my $users = $e->search_actor_user({usrgroup => $group_id}, {idlist => 1}); + my @mous; + + for my $uid ( @$users ) { + push @mous, @{$e->json_query( + { + select => {mous => ['usr', 'balance_owed']}, + from => 'mous', + where => { usr => $uid } } - } - ); + )}; + } + + return \@mous; }