From ee08716d5e5db5da88bd2f2fb764832e9f6a4945 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 21 Mar 2014 21:05:14 -0400 Subject: [PATCH] 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 --- Open-ILS/web/js/ui/default/acq/common/li_table.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; -- 2.43.2