date filters for default bill history interface; corrected date filters for payment...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 10 Dec 2009 17:50:36 +0000 (17:50 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 10 Dec 2009 17:50:36 +0000 (17:50 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15134 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
Open-ILS/xul/staff_client/server/patron/bill_history.js
Open-ILS/xul/staff_client/server/patron/bill_history.xul

index dc73b7e..e45233b 100644 (file)
 <!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_history.bills.start_date.label "Start Date">
+<!ENTITY staff.patron.bill_history.bills.start_date.accesskey "S">
+<!ENTITY staff.patron.bill_history.bills.end_date.label "End Date">
+<!ENTITY staff.patron.bill_history.bills.end_date.accesskey "">
+<!ENTITY staff.patron.bill_history.bills.retrieve.label "Retrieve Transactions">
+<!ENTITY staff.patron.bill_history.bills.retrieve.accesskey "R">
 
 <!ENTITY staff.patron.bill_interface.total_owed "Total Owed:">
 <!ENTITY staff.patron.bill_interface.total_checked "Total Checked:">
index 0286f9d..7c91b49 100644 (file)
@@ -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
index 5e59df6..039a590 100644 (file)
@@ -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
                                         } 
                                     } 
                                 } 
index b64a29a..e374e36 100644 (file)
                 <tabpanels flex="1">
                     <tabpanel orient="vertical">
                         <hbox>
-                            <label value='&staff.patron.bill_history.selected_billed.label;' style='font-weight: bold;'/>
-                            <label id="billed_tally" />
-                            <label value='&staff.patron.bill_history.selected_paid.label;' style='font-weight: bold;'/>
-                            <label id="paid_tally" />
+                            <toolbox flex="1">
+                                <toolbar>
+                                    <toolbaritem pack="center">
+                                        <hbox>
+                                            <label value='&staff.patron.bill_history.selected_billed.label;' style='font-weight: bold;'/>
+                                            <label id="billed_tally" />
+                                            <label value='&staff.patron.bill_history.selected_paid.label;' style='font-weight: bold;'/>
+                                            <label id="paid_tally" />
+                                        </hbox>
+                                    </toolbaritem>
+                                    <toolbarspring/>
+                                    <toolbaritem>
+                                        <progressmeter id="bills_meter" flex="1" hidden="true" mode="undetermined"/>
+                                    </toolbaritem>
+                                    <toolbaritem> 
+                                        <vbox pack="center">
+                                            <label control="bills_date1"
+                                                value="&staff.patron.bill_history.bills.start_date.label;" 
+                                                accesskey="&staff.patron.bill_history.bills.start_date.accesskey;" />
+                                        </vbox>
+                                        <datepicker id="bills_date1" type="popup" />
+                                        <vbox pack="center">
+                                            <label control="bills_date2"
+                                                value="&staff.patron.bill_history.bills.end_date.label;" 
+                                                accesskey="&staff.patron.bill_history.bills.end_date.accesskey;" />
+                                        </vbox>
+                                        <datepicker id="bills_date2" type="popup" />
+                                    </toolbaritem>
+                                    <toolbarbutton id="bills_retrieve_btn"
+                                        label="&staff.patron.bill_history.bills.retrieve.label;"
+                                        accesskey="&staff.patron.bill_history.bills.retrieve.accesskey;"
+                                        oncommand="retrieve_mbts_for_list();"
+                                        style="-moz-user-focus: normal" />
+                                </toolbar>
+                            </toolbox>
                         </hbox>
                         <tree id="bill_tree" flex="1" enableColumnDrag="true" seltype="multiple"/>
                         <hbox>