From 1244a386977ff65263bb2789857ca62c45bd0854 Mon Sep 17 00:00:00 2001
From: miker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Thu, 9 Sep 2010 16:30:01 +0000
Subject: [PATCH] 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
---
 .../OpenILS/Application/Actor/UserGroups.pm        | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

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;
 }
 
 
-- 
2.11.0