From: erickson Date: Wed, 16 Dec 2009 22:34:24 +0000 (+0000) Subject: added a balance owed summary call for group members X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7bab96cca862985bf49b1367cfc4a62e2bcde8cd;p=evergreen%2Fbjwebb.git added a balance owed summary call for group members git-svn-id: svn://svn.open-ils.org/ILS/trunk@15177 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 4ffb30cf8..0d2305d2a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor/UserGroups.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor/UserGroups.pm @@ -10,6 +10,38 @@ my $U = "OpenILS::Application::AppUtils"; sub initialize { return 1; } + +__PACKAGE__->register_method( + method => 'group_money_summary', + api_name => 'open-ils.actor.usergroup.members.balance_owed', + authoritative => 1, + signature => q/ + / +); + +sub group_money_summary { + my($self, $conn, $auth, $group_id) = @_; + 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} + } + } + } + } + ); +} + + __PACKAGE__->register_method( method => 'get_users_from_usergroup', api_name => 'open-ils.actor.usergroup.members.retrieve',