date filter for payment history
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Dec 2009 22:14:39 +0000 (22:14 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Dec 2009 22:14:39 +0000 (22:14 +0000)
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
Open-ILS/xul/staff_client/server/patron/bill_history.js
Open-ILS/xul/staff_client/server/patron/bill_history.xul

index 3284d8b..dc73b7e 100644 (file)
 <!ENTITY staff.patron.bill_history.tab.transactions.accesskey "T">
 <!ENTITY staff.patron.bill_history.tab.payments.label "Payments">
 <!ENTITY staff.patron.bill_history.tab.payments.accesskey "y">
+<!ENTITY staff.patron.bill_history.payments.start_date.label "Start Date">
+<!ENTITY staff.patron.bill_history.payments.start_date.accesskey "S">
+<!ENTITY staff.patron.bill_history.payments.end_date.label "End Date">
+<!ENTITY staff.patron.bill_history.payments.end_date.accesskey "">
+<!ENTITY staff.patron.bill_history.payments.retrieve.label "Retrieve Payments">
+<!ENTITY staff.patron.bill_history.payments.retrieve.accesskey "R">
 
 <!ENTITY staff.patron.bill_interface.total_owed "Total Owed:">
 <!ENTITY staff.patron.bill_interface.total_checked "Total Checked:">
index 8d499ef..5e59df6 100644 (file)
@@ -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);
     }
 }
index 0b10f0c..b64a29a 100644 (file)
                     </tabpanel>
                     <tabpanel orient="vertical">
                         <hbox>
-                            <spacer flex="1"/>
-                            <progressmeter id ="payments_meter" mode="undetermined" hidden="true"/>
-                            <spacer flex="1"/>
+                            <toolbox flex="1">
+                                <toolbar>
+                                    <toolbarspring/>
+                                    <toolbaritem>
+                                        <progressmeter id="payments_meter" flex="1" hidden="true" mode="undetermined"/>
+                                    </toolbaritem>
+                                    <toolbaritem>
+                                        <vbox pack="center">
+                                            <label control="payments_date1"
+                                                value="&staff.patron.bill_history.payments.start_date.label;" 
+                                                accesskey="&staff.patron.bill_history.payments.start_date.accesskey;" />
+                                        </vbox>
+                                        <datepicker id="payments_date1" type="popup" />
+                                        <vbox pack="center">
+                                            <label control="payments_date2"
+                                                value="&staff.patron.bill_history.payments.end_date.label;" 
+                                                accesskey="&staff.patron.bill_history.payments.end_date.accesskey;" />
+                                        </vbox>
+                                        <datepicker id="payments_date2" type="popup" />
+                                    </toolbaritem>
+                                    <toolbarbutton id="payments_retrieve_btn"
+                                        label="&staff.patron.bill_history.payments.retrieve.label;"
+                                        accesskey="&staff.patron.bill_history.payments.retrieve.accesskey;"
+                                        oncommand="retrieve_payments();"
+                                        style="-moz-user-focus: normal" />
+                                </toolbar>
+                            </toolbox>
                         </hbox>
                         <tree id="payments_tree" flex="1" enableColumnDrag="true" seltype="multiple"/>
                         <hbox>