From 45944c575b7cb69d8099f8b87dfe81347a104932 Mon Sep 17 00:00:00 2001 From: pines Date: Tue, 5 Sep 2006 10:20:09 +0000 Subject: [PATCH] fixing money git-svn-id: svn://svn.open-ils.org/ILS/trunk@5956 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Actor.pm | 11 ++++++++++- .../staff_client/chrome/content/main/constants.js | 1 + Open-ILS/xul/staff_client/server/patron/bills.js | 21 ++++++++++++++++++++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index 69579eaa4d..ffc48190b8 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -1759,6 +1759,14 @@ __PACKAGE__->register_method( 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 { @@ -1799,10 +1807,11 @@ 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}); } diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index 1d4bf08d4d..a9c531a7b2 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -128,6 +128,7 @@ const api = { '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' }, diff --git a/Open-ILS/xul/staff_client/server/patron/bills.js b/Open-ILS/xul/staff_client/server/patron/bills.js index 7f6801da84..d19c0da45f 100644 --- a/Open-ILS/xul/staff_client/server/patron/bills.js +++ b/Open-ILS/xul/staff_client/server/patron/bills.js @@ -21,7 +21,9 @@ patron.bills.prototype = { '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) { @@ -31,13 +33,22 @@ patron.bills.prototype = { 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) { @@ -632,9 +643,17 @@ patron.bills.prototype = { [ 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) { -- 2.11.0