'FM_MBTS_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.money.billable_xact_summary.retrieve' },
'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_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_MOBTS_HAVING_BALANCE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.have_balance' },
}
- function retrieve_all_mbts_for_list() {
- g.mbts_ids = g.network.simple_request('FM_MBTS_IDS_RETRIEVE_ALL_HAVING_CHARGE',[ses(),g.patron_id]);
+ function retrieve_mbts_for_list() {
+ var method = 'FM_MBTS_IDS_RETRIEVE_ALL_HAVING_CHARGE';
+ if (g.cgi.param('current')) method = 'FM_MBTS_IDS_RETRIEVE_ALL_HAVING_BALANCE';
+ g.mbts_ids = g.network.simple_request(method,[ses(),g.patron_id]);
if (g.mbts_ids.ilsevent) {
switch(g.mbts_ids.ilsevent) {
case -1: g.error.standard_network_error_alert('Please close this window and try again.'); break;
} else if (g.mbts_ids == null) {
g.error.standard_unexpected_error_alert('Please close this window and try again.',null);
} else {
+ g.mbts_ids.reverse();
var funcs = [];
function gen_func(r) {
init_lists();
- retrieve_all_mbts_for_list();
+ retrieve_mbts_for_list();
$('details').addEventListener(
'command',
false
);
- document.title = 'Bill History';
+ if (g.cgi.param('current')) {
+ $('caption').setAttribute('label','Current Bills');
+ document.title = 'Current Bills';
+ } else {
+ $('caption').setAttribute('label','Bill History');
+ document.title = 'Bill History';
+ }
} catch(E) {
var err_msg = "!! This software has encountered an error. Please tell your friendly " +
'billwizard',
'chrome,resizable,modal'
);
- //dump('pause\n');alert('pause');
g.bill_list.clear();
- //dump('pause\n');alert('pause');
- retrieve_all_mbts_for_list();
- //dump('pause\n');alert('pause');
+ retrieve_mbts_for_list();
g.data.temp = 'refresh'; g.data.stash('temp');
- //dump('pause\n');alert('pause');
}
}
<splitter><grippy/></splitter>
<groupbox orient="vertical" flex="3">
- <caption label="Bill History"/>
+ <caption id="caption" label="Bill History"/>
<tree id="bill_tree" flex="1" enableColumnDrag="true" seltype="single"/>
<hbox>
<spacer flex="1"/>
}
}
],
+ 'cmd_alternate_view' : [
+ ['command'],
+ function() {
+ try {
+ JSAN.use('util.window');
+ var win = new util.window();
+ obj.OpenILS.data.init({'via':'stash'}); obj.OpenILS.data.temp = ''; obj.OpenILS.data.stash('temp');
+ var w = win.open(
+ urls.XUL_PATRON_BILL_HISTORY
+ + '?current=1&patron_id=' + window.escape(obj.patron_id),
+ 'billhistory',
+ 'chrome,resizable,modal'
+ );
+ obj.OpenILS.data.init({'via':'stash'}); if (obj.OpenILS.data.temp == 'refresh') { obj.refresh(); }
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('bills -> cmd_alternate_view',E);
+ }
+ }
+ ],
+
'cmd_change_to_credit' : [
['command'],