From 4e2949962bda24d9f5cdef8b9a2288d195ae8afa Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 23 Oct 2014 12:17:58 -0700 Subject: [PATCH] LP#1384868: limit fund drop-downs on the invoice page to only active funds This patch fixes the fund selectors for adding extra copies and charges to invoices to only active funds (in addition to the existing restriction to funds visible to the user). Signed-off-by: Galen Charlton Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/acq/invoice/view.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Open-ILS/web/js/ui/default/acq/invoice/view.js b/Open-ILS/web/js/ui/default/acq/invoice/view.js index 3d42e4359f..d5cf6f1c35 100644 --- a/Open-ILS/web/js/ui/default/acq/invoice/view.js +++ b/Open-ILS/web/js/ui/default/acq/invoice/view.js @@ -20,7 +20,7 @@ var localeStrings = dojo.i18n.getLocalization('openils.acq', 'acq'); var fundLabelFormat = ['${0} (${1})', 'code', 'year']; var fundSearchFormat = ['${0} (${1})', 'code', 'year']; -var fundSearchFilter = {}; +var fundSearchFilter = {active : 't'}; var cgi = new openils.CGI(); var pcrud = new openils.PermaCrud(); @@ -112,7 +112,6 @@ function init2() { extraCopiesFund = new openils.widget.AutoFieldWidget({ fmField : 'fund', fmClass : 'acqlid', - searchFilter : {active : 't'}, labelFormat : fundLabelFormat, searchFormat : fundSearchFormat, searchFilter : fundSearchFilter, @@ -635,9 +634,8 @@ function addInvoiceItem(item) { } if(item.fund_debit()) { - fundArgs.searchFilter = {'-or' : [{active : 't'}, {id : item.fund()}]}; + fundArgs.searchFilter = {'-or' : [{ "-and": fundSearchFilter }, {id : item.fund()}]}; } else { - fundArgs.searchFilter = {active : 't'} if(itemType && openils.Util.isTrue(itemType.prorate())) fundArgs.dijitArgs = {disabled : true}; } -- 2.43.2