added field names to summary columns to make it simpler to fetch the data for display
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 27 Jul 2008 15:19:47 +0000 (15:19 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 27 Jul 2008 15:19:47 +0000 (15:19 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@10149 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_fund.js
Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_funding_source.js
Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_fund.html
Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_funding_source.html

index 661f4d1..d4719af 100644 (file)
@@ -13,14 +13,7 @@ dojo.require('openils.User');
 var fund = null;
 
 function getSummaryInfo(rowIndex) {
-    switch(this.index) {
-        case 4: return new String(fund.summary().combined_balance);
-        case 5: return new String(fund.summary().allocation_total);
-        case 6: return new String(fund.summary().spent_balance);
-        case 7: return new String(fund.summary().debit_total);
-        case 8: return new String(fund.summary().spent_total);
-        case 9: return new String(fund.summary().encumbrance_total);
-    }
+    return new String(fund.summary()[this.field]);
 }
 
 function createAllocation(fields) {
index 4b457a7..78a1446 100644 (file)
@@ -63,11 +63,7 @@ function getOrgInfo(rowIndex) {
 }
 
 function getSummaryInfo(rowIndex) {
-    switch(this.index) {
-        case 2: return new String(fundingSource.summary().balance);
-        case 3: return new String(fundingSource.summary().credit_total);
-        case 4: return new String(fundingSource.summary().allocation_total);
-    }
+    return new String(fundingSource.summary()[this.field]);
 }
 
 /** builds the credits grid ----- */
index 702ac82..3ff6e83 100644 (file)
                         {name: '${_("Spent Balance (Total - Spent)")}', get:getSummaryInfo},
                         {name: '${_("Total Debits (Spent + Encumbered)")}', get:getSummaryInfo},
                         */
-                        {name: '${_("Balance")}', get:getSummaryInfo},
-                        {name: '${_("Total Allocated")}', get:getSummaryInfo},
-                        {name: '${_("Spent Balance")}', get:getSummaryInfo},
-                        {name: '${_("Total Debits")}', get:getSummaryInfo},
-                        {name: '${_("Total Spent")}', get:getSummaryInfo},
-                        {name: '${_("Total Encumbered")}', get:getSummaryInfo}
+                        {name: '${_("Balance")}', get:getSummaryInfo, field:'combined_balance'},
+                        {name: '${_("Total Allocated")}', get:getSummaryInfo, field:'allocation_total'},
+                        {name: '${_("Spent Balance")}', get:getSummaryInfo, field:'spent_balance'},
+                        {name: '${_("Total Debits")}', get:getSummaryInfo, field:'debit_total'},
+                        {name: '${_("Total Spent")}', get:getSummaryInfo, field:'spent_total'},
+                        {name: '${_("Total Encumbered")}', get:getSummaryInfo, field:'encumbrance_total'}
                     ]]
                 }];
             </script>
index e19b452..8eb7cf2 100644 (file)
                         {name: '${_("ID")}', field: 'id'},
                         {name: '${_("Name")}', field: "name", width:'auto'}, 
                         {name: '${_("Code")}', field: "code"},
-                        {name: '${_("Balance")}', get:getSummaryInfo},
-                        {name: '${_("Total Credits")}', get:getSummaryInfo},
-                        {name: '${_("Total Debits")}', get:getSummaryInfo},
+                        {name: '${_("Balance")}', get:getSummaryInfo, field:'balance'},
+                        {name: '${_("Total Credits")}', get:getSummaryInfo, field:'credit_total'},
+                        {name: '${_("Total Debits")}', get:getSummaryInfo, field:'allocation_total'},
                         {name: '${_("Currency Type")}', field: "currency_type"},
                         {name: '${_("Owner")}', field: "owner", width:'auto', get:getOrgInfo}, 
                     ]]