From: Bill Erickson Date: Sat, 22 Mar 2014 01:05:14 +0000 (-0400) Subject: LP#1115599: Ignore canceled lineitems during batch cancel X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ee08716d5e5db5da88bd2f2fb764832e9f6a4945;p=evergreen%2Fpines.git LP#1115599: Ignore canceled lineitems during batch cancel 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 Signed-off-by: Kathy Lussier Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js index 226353470d..384607ac00 100644 --- a/Open-ILS/web/js/ui/default/acq/common/li_table.js +++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js @@ -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;