}
+
+function getFundingSource(rowIndex, item) {
+ if(item) {
+ var fsId = this.grid.store.getValue(item, 'funding_source');
+ return openils.acq.FundingSource.retrieve(fsId);
+ }
+}
+
+function formatFundingSource(fs) {
+ if(fs) {
+ return '<a href="' + oilsBasePath + '/acq/funding_source/view/'+fs.id()+'">'+fs.code()+'</a>';
+ }
+}
+
function getXferDest(rowIndex, item) {
if(!item) return '';
var xfer_destination = this.grid.store.getValue(item, 'xfer_destination');
[% WRAPPER 'default/base.tt2' %]
-<script>
- var fundID = [% ctx.page_args.0 %]
- function getFundingSource(rowIndex, item) {
- if(!item) return '';
- var fs_id = this.grid.store.getValue(item, 'funding_source');
- var fs = openils.acq.FundingSource.retrieve(fs_id);
- return '<a href="[% ctx.base_path %]/acq/funding_source/view/'+fs.id()+'">'+fs.name()+'</a>';
- }
-</script>
+<script> var fundID = [% ctx.page_args.0 %] </script>
<!-- load the page-specific JS -->
<script src="[% ctx.media_prefix %]/js/ui/default/acq/common/tag_manager.js"> </script>
<tr>
<td><label for="amount">Amount: </label></td>
<td>
- <!-- XXX get currency from funding source ... -->
- <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input>
+ <input dojoType="dijit.form.CurrencyTextBox" name="amount"> </input>
</td>
</tr>
fmClass="acqfa"
query="{id: '*'}"
showPaginator='true'>
+
+ <thead>
+ <tr>
+ <th field='funding_source' get='getFundingSource' formatter='formatFundingSource'/>
+ </tr>
+ </thead>
</table>
</div>
</div>