[open-ils-commits] r15144 - trunk/Open-ILS/xul/staff_client/server/patron (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Dec 11 13:48:50 EST 2009
Author: phasefx
Date: 2009-12-11 13:48:46 -0500 (Fri, 11 Dec 2009)
New Revision: 15144
Modified:
trunk/Open-ILS/xul/staff_client/server/patron/bill_history.js
trunk/Open-ILS/xul/staff_client/server/patron/bill_history.xul
Log:
tally amounts for selected payments in payment history interface
Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill_history.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill_history.js 2009-12-11 17:20:56 UTC (rev 15143)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill_history.js 2009-12-11 18:48:46 UTC (rev 15144)
@@ -19,13 +19,34 @@
selected_billed += to;
selected_paid += tp;
}
- $('billed_tally').setAttribute('value', '$' + util.money.cents_as_dollars( selected_billed ) );
- $('paid_tally').setAttribute('value', '$' + util.money.cents_as_dollars( selected_paid ) );
+ $('billed_tally').setAttribute('value', util.money.cents_as_dollars( selected_billed ) );
+ $('paid_tally').setAttribute('value', util.money.cents_as_dollars( selected_paid ) );
} catch(E) {
alert('Error in bill_history.js, tally_selected(): ' + E);
}
}
+function payments_tally_selected() {
+ try {
+ JSAN.use('util.money');
+ var selected_paid = 0;
+
+ for (var i = 0; i < g.payments_list_selection.length; i++) {
+ var payment = g.payments_map[g.payments_list_selection[i].id];
+ if (!payment) {
+ $('payments_paid_tally').setAttribute('value', '???');
+ return;
+ }
+ var amount = util.money.dollars_float_to_cents_integer( payment.amount() );
+ selected_paid += amount;
+ }
+ $('payments_paid_tally').setAttribute('value', util.money.cents_as_dollars( selected_paid ) );
+ } catch(E) {
+ alert('Error in bill_history.js, payments_tally_selected(): ' + E);
+ }
+}
+
+
function retrieve_mbts_for_list() {
//var method = 'FM_MBTS_IDS_RETRIEVE_ALL_HAVING_CHARGE';
var method = 'FM_MBTS_IDS_RETRIEVE_FOR_HISTORY.authoritative';
@@ -178,6 +199,7 @@
g.payments_list.retrieve_selection(),
function(o) { return JSON2js( o.getAttribute('retrieve_id') ); }
);
+ payments_tally_selected();
$('payments_details').disabled = g.payments_list_selection.length == 0;
},
'retrieve_row' : function(params) {
@@ -219,7 +241,7 @@
document.title = $("patronStrings").getString('staff.patron.bill_history.my_init.bill_history');
}
- g.funcs = []; g.bill_map = {};
+ g.funcs = []; g.bill_map = {}; g.payments_map = {};
g.patron_id = xul_param('patron_id');
@@ -383,6 +405,7 @@
}
}
);
+ g.payments_map[ result.mp.id() ] = result.mp;
} else {
throw( js2JSON(result) );
}
Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill_history.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill_history.xul 2009-12-11 17:20:56 UTC (rev 15143)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill_history.xul 2009-12-11 18:48:46 UTC (rev 15144)
@@ -96,6 +96,12 @@
<hbox>
<toolbox flex="1">
<toolbar>
+ <toolbaritem pack="center">
+ <hbox>
+ <label value='&staff.patron.bill_history.selected_paid.label;' style='font-weight: bold;'/>
+ <label id="payments_paid_tally" />
+ </hbox>
+ </toolbaritem>
<toolbarspring/>
<toolbaritem>
<progressmeter id="payments_meter" flex="1" hidden="true" mode="undetermined"/>
More information about the open-ils-commits
mailing list