From 7c025bb7a41c0a206074f75eea23c42a7c79aa71 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 30 Mar 2010 15:50:41 +0000 Subject: [PATCH] moved to auto-grid for allocations and debits for paging support, etc. hiding percent-based allocation option for now since they are not supported by the back-end git-svn-id: svn://svn.open-ils.org/ILS/trunk@16056 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/examples/fm_IDL.xml | 2 +- .../js/ui/default/acq/financial/view_fund.js | 13 +-- .../default/acq/financial/view_fund.tt2 | 100 +++++++++--------- 3 files changed, 56 insertions(+), 59 deletions(-) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 77e4fb1522..3e813f5c63 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -4955,7 +4955,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - + diff --git a/Open-ILS/web/js/ui/default/acq/financial/view_fund.js b/Open-ILS/web/js/ui/default/acq/financial/view_fund.js index aedddf1e8f..0813a59245 100644 --- a/Open-ILS/web/js/ui/default/acq/financial/view_fund.js +++ b/Open-ILS/web/js/ui/default/acq/financial/view_fund.js @@ -13,6 +13,7 @@ dojo.require('openils.Event'); dojo.require('openils.User'); dojo.require('openils.Util'); dojo.require("openils.widget.AutoFieldWidget"); +dojo.require("openils.widget.AutoGrid"); var fund = null; var tagManager; @@ -25,7 +26,6 @@ function getSummaryInfo(rowIndex, item) { function createAllocation(fields) { fields.fund = fundID; - if(isNaN(fields.percent)) fields.percent = null; if(isNaN(fields.amount)) fields.amount = null; openils.acq.Fund.createAllocation(fields, function(r){location.href = location.href;}); @@ -52,17 +52,13 @@ function loadFundGrid() { function loadAllocationGrid() { if(fundAllocationGrid.isLoaded) return; - var store = new dojo.data.ItemFileReadStore({data:acqfa.toStoreData(fund.allocations())}); - fundAllocationGrid.setStore(store); - fundAllocationGrid.render(); + fundAllocationGrid.loadAll({order_by : {acqfa : 'create_time DESC'}}); fundAllocationGrid.isLoaded = true; } function loadDebitGrid() { if(fundDebitGrid.isLoaded) return; - var store = new dojo.data.ItemFileReadStore({data:acqfa.toStoreData(fund.debits())}); - fundDebitGrid.setStore(store); - fundDebitGrid.render(); + fundDebitGrid.loadAll({order_by : {acqfdeb : 'create_time DESC'}}); fundDebitGrid.isLoaded = true; } @@ -72,8 +68,7 @@ function fetchFund() { { async: true, params: [ openils.User.authtoken, fundID, - {flesh_summary:1, flesh_allocations:1, flesh_debits:1, flesh_tags:1} - /* TODO grab allocations and debits only on as-needed basis */ + {flesh_summary:1, flesh_tags:1} ], oncomplete: function(r) { fund = r.recv().content(); diff --git a/Open-ILS/web/templates/default/acq/financial/view_fund.tt2 b/Open-ILS/web/templates/default/acq/financial/view_fund.tt2 index 4d183d19ad..836ca7241a 100644 --- a/Open-ILS/web/templates/default/acq/financial/view_fund.tt2 +++ b/Open-ILS/web/templates/default/acq/financial/view_fund.tt2 @@ -2,10 +2,10 @@ @@ -24,11 +24,12 @@
@@ -47,6 +48,8 @@ + + + - + @@ -177,59 +184,54 @@
@@ -155,6 +160,8 @@
+ +
@@ -164,7 +171,7 @@
IDNameName Code Currency Type Owner
- - - +
+ - - + +
-
- - - - - - - - - - - -
IDFunding SourceAmountPercentAllocated ByNote
+
+ + +
-
+ +
-
-
- - - - - - - - - - - - -
IDOrigin AmountOrigin Currency TypeAmountEncumbranceDebit TypeTransfer Destination
+
+
+ + +
+