notes => <<" NOTES");
Returns a list of billable transaction ids for a user that have a balance, optionally by type
NOTES
+__PACKAGE__->register_method(
+ method => "user_transaction_history",
+ api_name => "open-ils.actor.user.transactions.history.still_open",
+ argc => 1,
+ notes => <<" NOTES");
+ Returns a list of billable transaction ids for a user that are not finished
+ NOTES
+
=head old
sub _user_transaction_history {
my @xact = (xact_type => $type) if(defined($type));
my @balance = (balance_owed => { "!=" => 0}) if($api =~ /have_balance/);
my @charge = (last_billing_ts => { "!=" => undef }) if $api =~ /have_charge/;
+ my @xact_finish = (xact_finish => undef ) if $api =~ /still_open/;
return $e->search_money_billable_transaction_summary(
[
- { usr => $userid, @xact, @charge, @balance },
+ { usr => $userid, @xact, @charge, @balance, @xact_finish },
{ order_by => 'xact_start DESC' }
], {idlist => 1});
}
'FM_MBTS_IDS_RETRIEVE_ALL' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.history' },
'FM_MBTS_IDS_RETRIEVE_ALL_HAVING_CHARGE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.history.have_charge' },
'FM_MBTS_IDS_RETRIEVE_ALL_HAVING_BALANCE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.history.have_balance' },
+ 'FM_MBTS_IDS_RETRIEVE_ALL_STILL_OPEN' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.history.still_open' },
'FM_MP_RETRIEVE_VIA_MBTS_ID' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.money.payment.retrieve.all' },
'FM_MG_CREATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.money.grocery.create' },
'FM_MG_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.money.grocery.retrieve' },
'current_payments' : [],
- 'SHOW_ME_THE_BILLS' : 'FM_MOBTS_HAVING_BALANCE',
+ 'SHOW_ME_THE_BILLS' : 'FM_MBTS_IDS_RETRIEVE_ALL_HAVING_BALANCE',
+ //'SHOW_ME_THE_BILLS' : 'FM_MBTS_IDS_RETRIEVE_ALL_STILL_OPEN',
+ //'SHOW_ME_THE_BILLS' : 'FM_MOBTS_HAVING_BALANCE',
/*'SHOW_ME_THE_BILLS' : 'FM_MOBTS_OPEN',*/
'refresh' : function(dont_show_me_the_money) {
obj.SHOW_ME_THE_BILLS,
[ ses(), obj.patron_id ]
);
+ //alert('obj.bills = ' + js2JSON(obj.bills));
for (var i = 0; i < obj.bills.length; i++) {
+ /*
if (instanceOf(obj.bills[i],mobts)) {
obj.bills[i] = { 'transaction' : obj.bills[i] }
} else if (instanceOf(obj.bills[i],mbts)) {
obj.bills[i] = { 'transaction' : obj.bills[i] }
+ } else {
+ */
+ var robj = obj.network.simple_request('FM_MBTS_RETRIEVE',[ses(),obj.bills[i]]);
+ //alert('refresh robj = ' + js2JSON(robj));
+ obj.bills[i] = { 'transaction' : robj }
+ /*
}
+ */
}
if (!dont_show_me_the_money) {
[ ses(), obj.patron_id ]
);
for (var i = 0; i < obj.bills.length; i++) {
+ /*
if (instanceOf(obj.bills[i],mobts)) {
obj.bills[i] = { 'transaction' : obj.bills[i] }
+ } else {
+ */
+ var robj = obj.network.simple_request('FM_MBTS_RETRIEVE',[ses(),obj.bills[i]]);
+ //alert('robj = ' + js2JSON(robj));
+ obj.bills[i] = { 'transaction' : robj }
+ /*
}
+ */
}
}
} catch(E) {