From: Liam Whalen Date: Fri, 6 Nov 2015 18:43:37 +0000 (-0800) Subject: LP#1175400 Reset fields.amount in various places X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=58201b788093e0630c3eecf233180d2fa9baff4b;p=working%2FEvergreen.git 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 --- 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; } }