From: phasefx Date: Thu, 10 Dec 2009 17:50:36 +0000 (+0000) Subject: date filters for default bill history interface; corrected date filters for payment... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a7ab81b4b61088c46ec75c88c71b69b579497d68;p=evergreen%2Fpines.git date filters for default bill history interface; corrected date filters for payment history interface; extra columns (title, etc.) for payment history interface git-svn-id: svn://svn.open-ils.org/ILS/trunk@15134 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index dc73b7e377..e45233ba9b 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2542,6 +2542,12 @@ + + + + + + diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties index 0286f9da7f..7c91b49cdd 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties @@ -43,6 +43,10 @@ staff.patron.bill_history.handle_void.btn_yes=Yes staff.patron.bill_history.handle_void.btn_no=No staff.patron.bill_history.handle_void.confirm_message=Check here to confirm this message staff.patron.bill_history.print_bills.print_error=printing bills +staff.patron.bill_history.column.xact_type.label=Transaction Type +staff.patron.bill_history.column.last_billing_type.label=Last Billing Type +staff.patron.bill_history.column.title.label=Last Billing Type + staff.patron.bills.init_controller.money_summary_label=Money Summary staff.patron.bills.bill_payment_amount.credit_amount=Patron only has %1$s in credit. staff.patron.bills.bill_change_amount.greedy=Someone wanted more money than they deserved diff --git a/Open-ILS/xul/staff_client/server/patron/bill_history.js b/Open-ILS/xul/staff_client/server/patron/bill_history.js index 5e59df68ef..039a5908b6 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_history.js +++ b/Open-ILS/xul/staff_client/server/patron/bill_history.js @@ -30,7 +30,18 @@ function retrieve_mbts_for_list() { //var method = 'FM_MBTS_IDS_RETRIEVE_ALL_HAVING_CHARGE'; var method = 'FM_MBTS_IDS_RETRIEVE_FOR_HISTORY.authoritative'; if (xul_param('current')) method = 'FM_MBTS_IDS_RETRIEVE_ALL_HAVING_BALANCE.authoritative'; - g.mbts_ids = g.network.simple_request(method,[ses(),g.patron_id]); + var date2 = $('bills_date2').dateValue; + date2.setHours(23); date2.setMinutes(59); date2.setSeconds(59); + var filter = { + 'xact_start' : { + 'between' : [ + $('bills_date1').value, + $('bills_date2').value == util.date.formatted_date(new Date(),'%F') ? + 'now' : util.date.formatted_date( date2 ,'%{iso8601}') + ] + } + } + g.mbts_ids = g.network.simple_request(method,[ses(),g.patron_id, null, filter]); if (g.mbts_ids.ilsevent) { switch(Number(g.mbts_ids.ilsevent)) { case -1: g.error.standard_network_error_alert($("patronStrings").getString('staff.patron.bill_history.retrieve_mbts_for_list.close_win_try_again')); break; @@ -67,10 +78,12 @@ function retrieve_mbts_for_list() { } } + g.bill_list.clear(); $('bills_meter').hidden = false; for (var i = 0; i < g.mbts_ids.length; i++) { dump('i = ' + i + ' g.mbts_ids[i] = ' + g.mbts_ids[i] + '\n'); g.funcs.push( gen_func(g.mbts_ids[i]) ); } + g.funcs.push( function() { $('bills_meter').hidden = true; } ); } } @@ -142,7 +155,23 @@ function init_payments_list() { g.payments_list = new util.list('payments_tree'); g.payments_list.init( { - 'columns' : g.payments_list.fm_columns('mp'), + 'columns' : g.payments_list.fm_columns('mp').concat( [ + { + 'id' : 'payments_blob_xact_type', 'flex' : 0, + 'label' : $('patronStrings').getString('staff.patron.bill_history.column.xact_type.label'), + 'render' : function(my) { return my.xact_type; } + }, + { + 'id' : 'payments_blob_last_billing_type', 'flex' : 0, + 'label' : $('patronStrings').getString('staff.patron.bill_history.column.last_billing_type.label'), + 'render' : function(my) { return my.last_billing_type; } + }, + { + 'id' : 'payments_blob_title', 'flex' : 1, + 'label' : $('patronStrings').getString('staff.patron.bill_history.column.title.label'), + 'render' : function(my) { return my.title; } + } + ] ), 'on_select' : function(ev) { JSAN.use('util.functional'); g.payments_list_selection = util.functional.map_list( @@ -196,6 +225,8 @@ function my_init() { init_lists(); + $('bills_date1').year = $('bills_date1').year - 1; + retrieve_mbts_for_list(); $('details').addEventListener( @@ -316,12 +347,15 @@ function retrieve_payments() { $('payments_meter').hidden = false; + var date2 = $('payments_date2').dateValue; + date2.setHours(23); date2.setMinutes(59); date2.setSeconds(59); var filters = { 'where' : { 'payment_ts' : { 'between' : [ $('payments_date1').value, - $('payments_date2').value == util.date.formatted_date(new Date(),'%F') ? 'now' : $('payments_date2').value + $('payments_date2').value == util.date.formatted_date(new Date(),'%F') ? + 'now' : util.date.formatted_date( date2 ,'%{iso8601}') ] } } @@ -338,10 +372,13 @@ function retrieve_payments() { if (result && typeof result.ilsevent == 'undefined') { g.payments_list.append( { - 'retrieve_id' : js2JSON( { 'id' : result.id(), 'xact' : result.xact() } ), + 'retrieve_id' : js2JSON( { 'id' : result.mp.id(), 'xact' : result.mp.xact() } ), 'row' : { 'my' : { - 'mp' : result + 'mp' : result.mp, + 'xact_type' : result.xact_type, + 'last_billing_type' : result.last_billing_type, + 'title' : result.title } } } diff --git a/Open-ILS/xul/staff_client/server/patron/bill_history.xul b/Open-ILS/xul/staff_client/server/patron/bill_history.xul index b64a29a030..e374e36b6b 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_history.xul +++ b/Open-ILS/xul/staff_client/server/patron/bill_history.xul @@ -46,10 +46,41 @@ -