From: Bill Erickson Date: Wed, 7 Aug 2013 13:41:56 +0000 (-0400) Subject: more xact protections X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5986f9b9035c9337b0272b9bd2393939189a20cd;p=evergreen%2Fequinox.git more xact protections Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Collections.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Collections.pm index 550c75da56..23eccf5090 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Collections.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Collections.pm @@ -937,8 +937,9 @@ sub user_balance_summary { ); my $balance = '0'; + my @xact_ids = (@$circ_ids, @$groc_ids, @$res_ids); - if (@$circ_ids or @$groc_ids or @$res_ids) { + if (@xact_ids) { # get the sum owed an all transactions my $balance_obj = $e->json_query({ @@ -949,7 +950,7 @@ sub user_balance_summary { } ]}, from => 'mbts', - where => {id => [@$circ_ids, @$groc_ids, @$res_ids]} + where => {id => \@xact_ids} })->[0]; $balance = $balance_obj ? $balance_obj->{balance_owed} : '0'; @@ -961,9 +962,9 @@ sub user_balance_summary { $xacts_node->appendChild($balance_node); $root->appendChild($xacts_node); - if ($$args{include_xacts}) { + if ($$args{include_xacts} and @xact_ids) { my $xacts = $e->search_money_billable_transaction_summary( - {id => [@$circ_ids, @$groc_ids, @$res_ids]}, + {id => \@xact_ids}, {substream => 1} );