From fbdc953fecbcc97070ddf95125f0ca6fd61a1da4 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 12 Mar 2010 05:03:02 +0000 Subject: [PATCH] initial fiscall rollover processor UI. still needs to handle the response data in a more useful way git-svn-id: svn://svn.open-ils.org/ILS/trunk@15820 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../web/js/ui/default/acq/financial/list_funds.js | 72 ++++++++++++++++++++-- .../templates/default/acq/financial/list_funds.tt2 | 69 +++++++++++++++++++++ 2 files changed, 135 insertions(+), 6 deletions(-) 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 e44d7477a1..c57b062963 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 @@ -1,20 +1,21 @@ dojo.require("dijit.Dialog"); dojo.require("dijit.form.FilteringSelect"); dojo.require('dijit.form.Button'); +dojo.require('dijit.TooltipDialog'); +dojo.require('dijit.form.DropDownButton'); +dojo.require('dijit.form.CheckBox'); dojo.require('dojox.grid.DataGrid'); dojo.require('dojo.data.ItemFileWriteStore'); dojo.require('openils.widget.OrgUnitFilteringSelect'); dojo.require('openils.acq.CurrencyType'); dojo.require('openils.Event'); dojo.require('openils.Util'); +dojo.require('openils.User'); dojo.require('openils.acq.Fund'); dojo.require('openils.widget.AutoGrid'); +dojo.require('openils.widget.ProgressDialog'); -function getOrgInfo(rowIndex, item) { - if(!item) return ''; - var owner = this.grid.store.getValue(item, 'org'); - return fieldmapper.aou.findOrgUnit(owner).shortname(); -} +var contextOrg; function getBalanceInfo(rowIndex, item) { if(!item) return ''; @@ -26,6 +27,20 @@ function getBalanceInfo(rowIndex, item) { } function initPage() { + + var connect = function() { + dojo.connect(contextOrgSelector, 'onChange', + function() { + contextOrg = this.attr('value'); + lfGrid.resetStore(); + loadFundGrid(fundFilterYearSelect.attr('value')); + } + ); + }; + + new openils.User().buildPermOrgSelector( + 'ADMIN_ACQ_FUND', contextOrgSelector, null, connect); + loadYearSelector(); loadFundGrid(); } @@ -36,13 +51,16 @@ function loadFundGrid(year) { year = year || new Date().getFullYear().toString(); lfGrid.dataLoader = function() { loadFundGrid(year); }; + if(contextOrg == null) + contextOrg = openils.User.user.ws_ou(); + fieldmapper.standardRequest( [ 'open-ils.acq', 'open-ils.acq.fund.org.retrieve'], { async: true, params: [ openils.User.authtoken, - {year:year}, + {year : year, org : fieldmapper.aou.descendantNodeList(contextOrg, true)}, { flesh_summary:1, limit: lfGrid.displayLimit, @@ -95,5 +113,47 @@ function loadYearSelector() { ); } +<<<<<<< HEAD:Open-ILS/web/js/ui/default/acq/financial/list_funds.js +======= +function performRollover(args) { + progressDialog.show(true, "Processing..."); + + var method = 'open-ils.acq.fiscal_rollover'; + + if(args.rollover[0] == 'on') { + method += '.combined'; + } else { + method += '.propagate'; + } + + if(args.dry_run[0] == 'on') + method += '.dry_run'; + + var responses = []; + fieldmapper.standardRequest( + ['open-ils.acq', method], + { + async : true, + + params : [ + openils.User.authtoken, + fundFilterYearSelect.attr('value'), + contextOrg, + false, // TODO: checkbox in dialog + ], + + onresponse : function(r) { + var resp = openils.Util.readResponse(r); + responses.push(resp); + }, + + oncomplete : function() { + alert(responses.length); + progressDialog.hide(); + } + } + ); +} + openils.Util.addOnLoad(initPage); 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 bdad202d3d..2eba411afa 100644 --- a/Open-ILS/web/templates/default/acq/financial/list_funds.tt2 +++ b/Open-ILS/web/templates/default/acq/financial/list_funds.tt2 @@ -9,10 +9,77 @@ Funds + + + Context Org Unit + + + Year + + +
+ Fund Propagation & Rollover +
+ + + + + + + + + + + + + + + + + + + + + +
+
+ Propagation creates new funds for the sugsequent fiscal year based on the + funds for the selected fiscal year. Only funds with the propagate setting + enabled will be affected. No money or encumbrances are altered + during this process. +
+
+ +
+
+ The year end close out operation moves encumbrances from the selected fiscal + year to the analogous funds in the subsequent fiscal year and it deactivates + funds for the selected fiscal year. Additionally, for all funds that have + the "Rollver" setting enabled, this process will move all unspent money to + the analogous fund in the subsequent fiscal year. +
+
+ +
+
+ When Dry Run is selected, the system will generate a summary of + the changes that would occur during the selected operation(s). + No data will be changed. +
+
+ +
+
+
@@ -34,5 +101,7 @@ +