notes => <<" NOTES");
Returns a list of billable transaction ids for a user that have an initial charge, optionally by type
NOTES
+__PACKAGE__->register_method(
+ method => "user_transaction_history",
+ api_name => "open-ils.actor.user.transactions.history.have_balance",
+ argc => 1,
+ notes => <<" NOTES");
+ Returns a list of billable transaction ids for a user that have a balance, optionally by type
+ NOTES
sub user_transaction_history {
my( $self, $client, $login_session, $user_id, $type ) = @_;
my $api = $self->api_name();
my @xact;
my @charge;
+ my @balance;
@xact = (xact_type => $type) if(defined($type));
@charge = (total_owed => { ">" => 0}) if($api =~ /have_charge/);
+ @balance = (balance_owed => { "!=" => 0}) if($api =~ /have_balance/);
my $trans = $apputils->simple_scalar_request(
"open-ils.storage",
"open-ils.storage.direct.money.billable_transaction_summary.search_where.atomic",
- { usr => $user_id, @xact, @charge }, { order_by => 'xact_start DESC' });
+ { usr => $user_id, @xact, @charge, @balance }, { order_by => 'xact_start DESC' });
return [ map { $_->id } @$trans ];
}