From eb4e3109a00c768fd89cdc1696f703b089e1f6b7 Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 9 Dec 2009 22:14:39 +0000 Subject: [PATCH] date filter for payment history git-svn-id: svn://svn.open-ils.org/ILS/trunk@15130 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 6 +++++ .../xul/staff_client/server/patron/bill_history.js | 27 +++++++++++++++++-- .../staff_client/server/patron/bill_history.xul | 30 +++++++++++++++++++--- 3 files changed, 58 insertions(+), 5 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 3284d8b4dc..dc73b7e377 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2536,6 +2536,12 @@ + + + + + + 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 8d499ef1a5..5e59df68ef 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_history.js +++ b/Open-ILS/xul/staff_client/server/patron/bill_history.js @@ -300,14 +300,37 @@ function payment_history_init() { try { if (payment_history_fetched) { return; } else { payment_history_fetched = true; } + $('payments_date1').year = $('payments_date1').year - 1; + + retrieve_payments(); + + } catch(E) { + alert('Error in bill_history.js, payment_history_init(): ' + E); + } +} + +function retrieve_payments() { + try { + g.payments_list.clear(); $('payments_meter').hidden = false; + var filters = { + 'where' : { + 'payment_ts' : { + 'between' : [ + $('payments_date1').value, + $('payments_date2').value == util.date.formatted_date(new Date(),'%F') ? 'now' : $('payments_date2').value + ] + } + } + }; + fieldmapper.standardRequest( [ api.FM_MP_RETRIEVE_VIA_USER.app, api.FM_MP_RETRIEVE_VIA_USER.method ], { async: true, - params: [ses(), g.patron_id], + params: [ses(), g.patron_id, filters], onresponse: function(r) { try { var result = r.recv().content(); @@ -341,6 +364,6 @@ function payment_history_init() { ); } catch(E) { - alert('Error in bill_history.js, payment_history_init(): ' + E); + alert('Error in bill_history.js, retrieve_payments(): ' + E); } } 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 0b10f0cba3..b64a29a030 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_history.xul +++ b/Open-ILS/xul/staff_client/server/patron/bill_history.xul @@ -63,9 +63,33 @@ - - -- 2.11.0