LP#1115599: Ignore canceled lineitems during batch cancel
authorBill Erickson <berick@esilibrary.com>
Sat, 22 Mar 2014 01:05:14 +0000 (21:05 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 9 Apr 2014 14:13:12 +0000 (07:13 -0700)
Continue ignoring already-canceled lineitems during batch cancel so that
a) no unnecessary calls are made and b) staff can be alerted when no
viable lineitems were selected for the requested action.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/web/js/ui/default/acq/common/li_table.js

index 2263534..384607a 100644 (file)
@@ -2918,8 +2918,13 @@ function AcqLiTable() {
     };
 
     this._cancelLineitems = function(reason) {
-        var id_list = this.getSelected(
-            null, null, true, li_active_states);
+
+        // ignore canceled lineitems during batch lineitem cancel
+        var states = li_active_states.filter(
+            function(s) { return s != 'cancelled' });
+
+        var id_list = this.getSelected(null, null, true, states);
+
         if (!id_list.length) {
             alert(localeStrings.NO_LI_GENERAL);
             return;