From: erickson Date: Fri, 11 Apr 2008 21:28:00 +0000 (+0000) Subject: funding source list page is now a basic grid with some actions along the top. select... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=008883865904a5f8c1669745157b71b2a981322d;p=Evergreen.git funding source list page is now a basic grid with some actions along the top. select a funding source, it takes to the details page, where you get a breakdown of credits and allocations. git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9315 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/funding_source.py b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/funding_source.py index ec9e1b46d4..e19799c67d 100644 --- a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/funding_source.py +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/funding_source.py @@ -13,16 +13,7 @@ class FundingSourceController(BaseController): def view(self, **kwargs): r = RequestMgr() - ses = ClientSession(oils.const.OILS_APP_ACQ) - r.ctx.core.org_tree.value = OrgUtil.fetch_org_tree() - - source = ses.request( - 'open-ils.acq.funding_source.retrieve', - r.ctx.core.authtoken.value, kwargs.get('id'), {"flesh_summary":1}).recv().content() - Event.parse_and_raise(source) - - source.owner(OrgUtil.get_org_unit(source.owner())) # flesh the owner - r.ctx.acq.funding_source.value = source + r.ctx.acq.funding_source_id = kwargs['id'] return r.render('acq/financial/view_funding_source.html') def list(self): diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js index c455962b85..ef92629bc2 100644 --- a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js @@ -50,9 +50,28 @@ openils.acq.FundingSource.create = function(fields, onCreateComplete) { req.oncomplete = function(r) { var msg = r.recv(); var id = msg.content(); - fs.id(id); /* XXX check for event */ if(onCreateComplete) - onCreateComplete(fs); + onCreateComplete(id); + }; + req.send(); +}; + + +openils.acq.FundingSource.createCredit = function(fields, onCreateComplete) { + + var fsc = new acqfscred() + for(var field in fields) + fsc[field](fields[field]); + + var ses = new OpenSRF.ClientSession('open-ils.acq'); + var req = ses.request( + 'open-ils.acq.funding_source_credit.create', oilsAuthtoken, fsc); + + req.oncomplete = function(r) { + var msg = r.recv(); + var id = msg.content(); + if(onCreateComplete) + onCreateComplete(id); }; req.send(); }; @@ -73,8 +92,11 @@ openils.acq.FundingSource.deleteList = function(list, onComplete) { openils.acq.FundingSource._deleteList = function(list, idx, onComplete) { if(idx >= list.length) return onComplete(); + var ses = new OpenSRF.ClientSession('open-ils.acq'); var req = ses.request('open-ils.acq.funding_source.delete', oilsAuthtoken, list[idx]); + delete openils.acq.FundingSource.cache[list[idx]]; + req.oncomplete = function(r) { msg = r.recv() stat = msg.content(); diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html index 7bf9a05bfc..f96330dad1 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html @@ -8,21 +8,17 @@
${_('Funding Sources')}
- - - + +
-
${source.name()}
-
- ${_('Add Credit')} +
${_('Funding Source Details')}
+
+ +
+ + +
+ ${('Apply Credit')} +
+ + + + + + + + + + + + +
+ + +
+ + +
+ +
+
+
+
+ + + +
+
+
+ +
+
+
+ + +
+
+
+ + +
+
- - - - - - - - - - - - - - - - - - - - - - - -
${_('Funding Source Owner')}${source.owner().name()}
${_('Funding Source Currency Type')}${source.currency_type()}
${_('Funding Source Credit Total')}${source.summary()['credit_total']}
${_('Funding Source Allocation Total')}${source.summary()['allocation_total']}
${_('Funding Source Balance')}${source.summary()['balance']}