lp1494544 Remove void options from bills UI user/kmlussier/lp1494544-remove-void-balance-references-from-bills-ui
authorKathy Lussier <klussier@masslnc.org>
Fri, 11 Sep 2015 00:56:31 +0000 (20:56 -0400)
committerKathy Lussier <klussier@masslnc.org>
Fri, 11 Sep 2015 00:56:31 +0000 (20:56 -0400)
Removes manual void options from patron bills UI since using this option
can produce a negative balance for sites that are configured to prohibit them.
Also adds the adjust to zero option to the Actions for Selected Transactions
menu.

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/xul/staff_client/server/patron/bill2.js
Open-ILS/xul/staff_client/server/patron/bill2.xul

index 3db87f9..5201eba 100644 (file)
@@ -96,12 +96,6 @@ function event_listeners() {
             false
         );
 
-        window.bill_event_listeners.add($('voidall'), 
-            'command',
-            handle_void_all,
-            false
-        );
-
         window.bill_event_listeners.add($('refund'), 
             'command',
             handle_refund,
@@ -571,7 +565,6 @@ function init_lists() {
             //tally_selected();
             $('details').setAttribute('disabled', g.bill_list_selection.length == 0);
             $('add').setAttribute('disabled', g.bill_list_selection.length == 0);
-            $('voidall').setAttribute('disabled', g.bill_list_selection.length == 0);
             $('adjust_to_zero').setAttribute('disabled', g.bill_list_selection.length == 0);
             $('refund').setAttribute('disabled', g.bill_list_selection.length == 0);
             $('opac').setAttribute('disabled', g.bill_list_selection.length == 0);
@@ -717,28 +710,6 @@ function handle_add() {
     }
 }
 
-function handle_void_all() {
-    if(g.bill_list_selection.length > 1) {
-        var msg = $("patronStrings").getFormattedString('staff.patron.bill_history.handle_void.message_plural', [g.bill_list_selection]);
-    } else {
-        var msg = $("patronStrings").getFormattedString('staff.patron.bill_history.handle_void.message_singular', [g.bill_list_selection]);
-    }
-        
-    var r = g.error.yns_alert(msg,
-        $("patronStrings").getString('staff.patron.bill_history.handle_void.title'),
-        $("patronStrings").getString('staff.patron.bill_history.handle_void.btn_yes'),
-        $("patronStrings").getString('staff.patron.bill_history.handle_void.btn_no'),null,
-        $("patronStrings").getString('staff.patron.bill_history.handle_void.confirm_message'));
-    if (r == 0) {
-        for (var i = 0; i < g.bill_list_selection.length; i++) {
-            void_all_billings( g.bill_list_selection[i] );
-        }
-        refresh();
-        if (typeof window.xulG == 'object' && typeof window.xulG.refresh == 'function') window.xulG.refresh();
-        if (typeof window.xulG == 'object' && typeof window.xulG.on_money_change == 'function') window.xulG.on_money_change();
-    }
-}
-
 function handle_opac() {
     try {
         var ids = [];
index 6fbd90d..11a8a26 100644 (file)
@@ -40,7 +40,6 @@
     <commandset>
         <command id="opac" label="&staff.patron.bill_interface.show_in_catalog.label;" accesskey="&staff.patron.bill_interface.show_in_catalog.accesskey;" disabled="true"/>
         <command id="copy_details" label="&staff.patron.items_overlay.sel_copy_details.label;" accesskey="&staff.patron.items_overlay.sel_copy_details.accesskey;" disabled="true"/>
-        <command id="voidall" label="&staff.patron.bill_interface.void_all_billings.label;" accesskey="&staff.patron.bill_interface.void_all_billings.accesskey;" disabled="true"/>
         <command id="adjust_to_zero" label="&staff.patron.bill_interface.adjust_to_zero.label;" accesskey="&staff.patron.bill_interface.adjust_to_zero.accesskey;" disabled="true"/>
         <command id="refund" label="&staff.patron.bill_interface.refund.label;" accesskey="&staff.patron.bill_interface.refund.accesskey;" disabled="true"/>
         <command id="add" label="&staff.patron.bill_interface.add_billing.label;" accesskey="&staff.patron.bill_interface.add_billing.accesskey;" disabled="true"/>
@@ -51,7 +50,6 @@
         <menupopup id="actions_popup">
             <menuitem command="opac" />
             <menuitem command="copy_details" />
-            <menuitem command="voidall" />
             <menuitem command="adjust_to_zero" />
             <menuitem command="refund" />
             <menuitem command="add" />
                             <menupopup>
                                 <menuitem command="opac" />
                                 <menuitem command="copy_details" />
-                                <menuitem command="voidall" />
+                                <menuitem command="adjust_to_zero" />
                                 <menuitem command="refund" />
                                 <menuitem command="add" />
                                 <menuitem command="details" />