cache has no object when a new object is created. if not in the cache, assume balanc...
[working/Evergreen.git] / Open-ILS / web / js / ui / default / acq / financial / list_funding_sources.js
index 8d09576..1f805b6 100644 (file)
@@ -19,8 +19,11 @@ function getOrgInfo(rowIndex, item) {
 
 function getBalanceInfo(rowIndex, item) {
     if(!item) return '';
-    var data = this.grid.store.getValue( item, 'id');   
-    return new String(openils.acq.FundingSource.cache[data].summary().balance);
+    var id = this.grid.store.getValue( item, 'id');   
+    var fs = openils.acq.FundingSource.cache[id];
+    if(fs && fs.summary())
+        return fs.summary().balance;
+    return 0;
 }
 
 function loadFSGrid() {