From 3b303882d058f8aaf5ade56aa17b38910b81fb69 Mon Sep 17 00:00:00 2001 From: Liam Whalen Date: Fri, 6 Nov 2015 10:43:37 -0800 Subject: [PATCH] LP#1175400 Reset fields.amount in various places fields.amount needs to be reset to 0 after assigning values to a fund. Otherwise, the amounts add together. This may be me not seeing a refresh. Signed-off-by: Liam Whalen --- Open-ILS/web/js/ui/default/acq/financial/view_funding_source.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/acq/financial/view_funding_source.js b/Open-ILS/web/js/ui/default/acq/financial/view_funding_source.js index e9be908609..bdede7309e 100644 --- a/Open-ILS/web/js/ui/default/acq/financial/view_funding_source.js +++ b/Open-ILS/web/js/ui/default/acq/financial/view_funding_source.js @@ -15,6 +15,8 @@ dojo.require('openils.widget.AutoGrid'); var ses = new OpenSRF.ClientSession('open-ils.acq'); var fundingSource = null; +var FSOverAllocateDialogsInit = false; +var doAllocation = 0; function resetPage(also_load_grid) { fundingSource = null; @@ -57,9 +59,11 @@ function applyFSAllocation(fields) { if(isNaN(fields.amount)) fields.amount = null; + //connect dialogs if necessary dojo.connect(oilsFSOverAllocateContinue, 'onClick', function() { oilsFSOverAllocateDialog.hide(); + fields.amount = 0; } ); @@ -75,12 +79,11 @@ function applyFSAllocation(fields) { ['open-ils.actor', 'open-ils.actor.user.perm.check'], { params : [openils.User.authtoken, staff.id(), ou, [permission] ] } ); - if(!resp[0]) { + if(!resp[0]) { doAllocation(fields); } else { oilsFSNoPermDialog.show(); } - } ); @@ -100,6 +103,7 @@ function applyFSAllocation(fields) { openils.acq.Fund.createAllocation( fields, function() { resetPage(loadAllocationGrid); } ); + fields.amount = 0; } } -- 2.11.0