1 [% WRAPPER 'default/base.tt2' %]
3 var fundingSourceID = [% ctx.page_args.0 %];
4 function getFund(rowIndex) {
5 data = fsAllocationGrid.model.getRow(rowIndex);
7 var fund = openils.acq.Fund.retrieve(data.fund);
8 return '<a href="[% ctx.base_uri %]/acq/fund/view/'+fund.id()+'">'+fund.code()+'</a>';
13 <!-- load the page-specific JS -->
14 <script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/view_funding_source.js'> </script>
16 <div id='oils-acq-list-header' class='container'>
17 <div id='oils-acq-list-header-label'>Funding Source Details</div>
20 <div class='oils-acq-actions-div' style='margin:8px;'> <!-- XXX CSS -->
22 <!-- Dropdown menu for creating a new funding source credit -->
23 <div dojoType="dijit.form.DropDownButton">
24 <span>Apply Credit</span>
25 <div dojoType="dijit.TooltipDialog" execute="applyFSCredit(arguments[0]);">
26 <table class='dijitTooltipTable'>
28 <td><label for="amount">Amount: </label></td>
30 <!-- XXX get currency from funding source ... -->
31 <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input>
35 <td><label for="note">Note: </label></td>
37 <input dojoType="dijit.form.TextBox" name="note"> </input>
38 <!-- XXX textarea makes more sense, but it's buggy in the dropdown dialog .. perhaps a height issue?
39 <textarea dojoType='dijit.form.Textarea' name="note" style='min-height:6em'>
45 <td colspan='2' align='center'>
46 <button dojoType=dijit.form.Button type="submit">Apply</button>
52 <div dojoType="dijit.form.DropDownButton">
53 <span>Allocate to Fund</span>
54 <div dojoType="dijit.TooltipDialog" execute="applyFSAllocation(arguments[0]);">
55 <script type='dojo/connect' event='onOpen'>
56 openils.acq.Fund.createStore(
58 fundingSourceFundSelector.store =
59 new dojo.data.ItemFileReadStore({data:store});
60 fundingSourceFundSelector.setValue(store.items[0].code);
64 <table class='dijitTooltipTable'>
66 <td><label for="amount">Fund: </label></td>
68 <input jsId='fundingSourceFundSelector' name="fund"
69 dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
74 <td><label for="amount">Amount: </label></td>
76 <!-- XXX get currency from funding source ... -->
77 <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input>
81 <td><label for="amount">Percent: </label></td>
84 dojoType="dijit.form.NumberTextBox"
85 constraints="{min:0,max:100}"
86 promptMessage="Please enter an amount between 0 and 100"
92 <td><label for="note">Note: </label></td>
94 <input dojoType="dijit.form.TextBox" name="note"> </input>
98 <td colspan='2' align='center'>
99 <button dojoType=dijit.form.Button type="submit">Apply</button>
107 <div dojoType="dijit.layout.ContentPane" layoutAlign="top">
108 <div dojoType="dijit.layout.TabContainer">
109 <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Summary" selected='true'>
110 <script type='dojo/connect' event='onShow'>loadFSGrid();</script>
112 /** Define the columns for the funding source grid ----- */
113 var fundingSourceGridLayout = [{
115 {name: 'ID', field: 'id'},
116 {name: 'Name', field: "name", width:'auto'},
117 {name: 'Code', field: "code"},
118 {name: 'Balance', get:getSummaryInfo, field:'balance'},
119 {name: 'Total Credits', get:getSummaryInfo, field:'credit_total'},
120 {name: 'Total Debits', get:getSummaryInfo, field:'allocation_total'},
121 {name: 'Currency Type', field: "currency_type"},
122 {name: 'Owner', field: "owner", width:'auto', get:getOrgInfo},
126 <div jsId='fundingSourceGrid' dojoType="dojox.Grid" structure='fundingSourceGridLayout'> </div>
128 <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Credits">
129 <script type='dojo/connect' event='onShow'>loadCreditGrid();</script>
131 /** Define the columns for the funding source credits grid ----- */
132 var fsCreditGridLayout = [{
134 {name: 'ID', field: 'id'},
135 {name: 'Amount', field: "amount"},
136 {name: 'Note', field: "note", width:'auto'},
140 <div jsId='fsCreditGrid' dojoType="dojox.Grid" structure='fsCreditGridLayout'> </div>
142 <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Allocations">
143 <script type='dojo/connect' event='onShow'>loadAllocationGrid();</script>
145 /** Define the columns for the funding source allocations grid ----- */
146 var fsAllocationGridLayout = [{
148 {name: 'ID', field: 'id'},
149 {name: 'Fund', field: "fund", get:getFund},
150 {name: 'Amount', field: "amount"},
151 {name: 'Percent', field: "percent"},
152 {name: 'Allocated By', field: "allocator"},
153 {name: 'Note', field: "note", width:'auto'},
157 <div jsId='fsAllocationGrid' dojoType="dojox.Grid" structure='fsAllocationGridLayout'> </div>