[open-ils-commits] r15820 - in trunk/Open-ILS/web: js/ui/default/acq/financial templates/default/acq/financial (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Mar 12 00:03:05 EST 2010
Author: erickson
Date: 2010-03-12 00:03:02 -0500 (Fri, 12 Mar 2010)
New Revision: 15820
Modified:
trunk/Open-ILS/web/js/ui/default/acq/financial/list_funds.js
trunk/Open-ILS/web/templates/default/acq/financial/list_funds.tt2
Log:
initial fiscall rollover processor UI. still needs to handle the response data in a more useful way
Modified: trunk/Open-ILS/web/js/ui/default/acq/financial/list_funds.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/financial/list_funds.js 2010-03-12 05:03:01 UTC (rev 15819)
+++ trunk/Open-ILS/web/js/ui/default/acq/financial/list_funds.js 2010-03-12 05:03:02 UTC (rev 15820)
@@ -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 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 @@
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 @@
);
}
+<<<<<<< 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);
Modified: trunk/Open-ILS/web/templates/default/acq/financial/list_funds.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/financial/list_funds.tt2 2010-03-12 05:03:01 UTC (rev 15819)
+++ trunk/Open-ILS/web/templates/default/acq/financial/list_funds.tt2 2010-03-12 05:03:02 UTC (rev 15820)
@@ -9,10 +9,77 @@
<!-- TODO CSS -->
<td style='text-align:left;font-size:130%;font-weight: bold;'>Funds</td>
<td style='text-align:right;width:90%;'>
+
+ <span>
+ <span>Context Org Unit</span>
+ <select
+ dojoType="openils.widget.OrgUnitFilteringSelect"
+ jsId='contextOrgSelector'
+ searchAttr='shortname'
+ labelAttr='shortname'>
+ </select>
+ </span>
+
Year <select dojoType='dijit.form.FilteringSelect'
jsId='fundFilterYearSelect' labelAttr='year' searchAttr='year'> </select>
+
<button dojoType='dijit.form.Button' onClick='lfGrid.showCreateDialog()'>New Fund</button>
<button dojoType='dijit.form.Button' onClick='lfGrid.deleteSelected()'>Delete Selected</button>
+
+ <div dojoType="dijit.form.DropDownButton">
+ <span>Fund Propagation & Rollover</span>
+ <div dojoType="dijit.TooltipDialog" execute="performRollover(arguments[0]);">
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td colspan='2'>
+ <div style='width:400px;border-bottom:2px solid #888'>
+ 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.
+ <div>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="rollover">Perform Fiscal Year Close-out Operation: </label></td>
+ <td>
+ <input dojoType="dijit.form.CheckBox" name="rollover"> </input>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2'>
+ <div style='width:400px;border-bottom:2px solid #888'>
+ 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.
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="dry_run">Dry Run: </label></td>
+ <td>
+ <input dojoType="dijit.form.CheckBox" name="dry_run" checked='checked'> </input>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2'>
+ <div style='width:400px;border-bottom:2px solid #888'>
+ 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.
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">Process</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
</td>
</tr>
</table>
@@ -34,5 +101,7 @@
</thead>
</table>
</div>
+<div dojoType='openils.widget.ProgressDialog' class='hidden' jsId='progressDialog'/>
+
[% END %]
More information about the open-ils-commits
mailing list