From: erickson Date: Fri, 26 Mar 2010 21:09:09 +0000 (+0000) Subject: show fiscal rollover summary; insert newly created funds into the fund grid for displ... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5c285800b5e7f0c13212392e5001ad140484d584;p=evergreen%2Fmasslnc.git show fiscal rollover summary; insert newly created funds into the fund grid for display; TODO: plug in grid paging handlers for paging through dry-run propagate results; finish up css and move to css file git-svn-id: svn://svn.open-ils.org/ILS/trunk@16018 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js index 3d6bac28e7..739b6c1544 100644 --- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js +++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js @@ -43,5 +43,8 @@ 'FUND_NOT_YET_LOADED': "Fund not yet loaded. Try coming back to this display later.", 'CONFIRM_DELETE_MAPPING': "Are you sure you want to remove this tag from this fund?", 'COULD_NOT_CREATE_MAPPING': "Error tagging fund.", - 'COULD_NOT_DELETE_MAPPING': "Error removing tag from fund." + 'COULD_NOT_DELETE_MAPPING': "Error removing tag from fund.", + 'FUND_LIST_ROLLOVER_SUMMARY' : 'Fund Propagation & Rollover Summary for Fiscal Year ${0}', + 'FUND_LIST_ROLLOVER_SUMMARY_FUNDS' : '${1} funds propagated for fiscal year ${0} for the selected locations', + 'FUND_LIST_ROLLOVER_SUMMARY_ROLLOVER_AMOUNT' : '$${1} unspent money rolled over to fiscal year ${0} for the selected locations' } diff --git a/Open-ILS/web/js/ui/default/acq/financial/list_funds.js b/Open-ILS/web/js/ui/default/acq/financial/list_funds.js index c078bcb5c7..73ee432356 100644 --- a/Open-ILS/web/js/ui/default/acq/financial/list_funds.js +++ b/Open-ILS/web/js/ui/default/acq/financial/list_funds.js @@ -14,6 +14,8 @@ dojo.require('openils.User'); dojo.require('openils.acq.Fund'); dojo.require('openils.widget.AutoGrid'); dojo.require('openils.widget.ProgressDialog'); +dojo.requireLocalization('openils.acq', 'acq'); +var localeStrings = dojo.i18n.getLocalization('openils.acq', 'acq'); var contextOrg; @@ -49,6 +51,7 @@ function initPage() { function loadFundGrid(year) { + openils.Util.hide('acq-fund-list-rollover-summary'); lfGrid.resetStore(); year = year || new Date().getFullYear().toString(); lfGrid.dataLoader = function() { loadFundGrid(year); }; @@ -116,6 +119,8 @@ function loadYearSelector() { } function performRollover(args) { + + lfGrid.resetStore(); progressDialog.show(true, "Processing..."); var method = 'open-ils.acq.fiscal_rollover'; @@ -129,7 +134,9 @@ function performRollover(args) { if(args.dry_run[0] == 'on') method += '.dry_run'; - var responses = []; + var count = 0; + var amount_rolled = 0; + var year = fundFilterYearSelect.attr('value'); // TODO alternate selector? fieldmapper.standardRequest( ['open-ils.acq', method], { @@ -137,18 +144,46 @@ function performRollover(args) { params : [ openils.User.authtoken, - fundFilterYearSelect.attr('value'), + year, contextOrg, false, // TODO: checkbox in dialog ], onresponse : function(r) { var resp = openils.Util.readResponse(r); - responses.push(resp); + count += 1; + amount_rolled += resp.rollover_amount; + lfGrid.store.newItem(fieldmapper.acqf.toStoreItem(resp.fund)); }, oncomplete : function() { - alert(responses.length); + + var nextYear = Number(year) + 1; + + dojo.byId('acq-fund-list-rollover-summary-header').innerHTML = + dojo.string.substitute( + localeStrings.FUND_LIST_ROLLOVER_SUMMARY, + [nextYear] + ); + + dojo.byId('acq-fund-list-rollover-summary-funds').innerHTML = + dojo.string.substitute( + localeStrings.FUND_LIST_ROLLOVER_SUMMARY_FUNDS, + [nextYear, count] + ); + + dojo.byId('acq-fund-list-rollover-summary-rollover-amount').innerHTML = + dojo.string.substitute( + localeStrings.FUND_LIST_ROLLOVER_SUMMARY_ROLLOVER_AMOUNT, + [nextYear, amount_rolled] + ); + + if(!args.dry_run) { + openils.Util.hide('acq-fund-list-rollover-summary-dry-run'); + } + openils.Util.show('acq-fund-list-rollover-summary'); + + progressDialog.hide(); } } diff --git a/Open-ILS/web/templates/default/acq/financial/list_funds.tt2 b/Open-ILS/web/templates/default/acq/financial/list_funds.tt2 index c8cdbd50e2..536d77e5ac 100644 --- a/Open-ILS/web/templates/default/acq/financial/list_funds.tt2 +++ b/Open-ILS/web/templates/default/acq/financial/list_funds.tt2 @@ -110,6 +110,19 @@
+
+ +
+
+ +