);
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({
}
]},
from => 'mbts',
- where => {id => [@$circ_ids, @$groc_ids, @$res_ids]}
+ where => {id => \@xact_ids}
})->[0];
$balance = $balance_obj ? $balance_obj->{balance_owed} : '0';
$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}
);