]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/default/acq/financial/view_fund.tt2
Move templates out of a web-served directory
[working/Evergreen.git] / Open-ILS / src / templates / default / acq / financial / view_fund.tt2
1 [% WRAPPER 'default/base.tt2' %]
2 <script type="text/javascript"> var fundID = [% ctx.page_args.0 %] </script>
3
4 <div id='oils-acq-list-header' class='container'>
5     <div id='oils-acq-list-header-label'>Fund Details</div>
6 </div>
7
8 <div class='oils-acq-actions-div' style='margin:8px;'> <!-- XXX CSS -->
9     <!-- Dropdown menu for creating a new funding source credit -->
10     <div dojoType="dijit.form.DropDownButton">
11         <span>Create Allocation</span>
12         <div dojoType="dijit.TooltipDialog" execute="createAllocation(arguments[0]);">
13             <script type='dojo/connect' event='onOpen'>
14                 openils.acq.FundingSource.createStore(
15                     function(store) {
16                         fundingSourceSelector.store = 
17                             new dojo.data.ItemFileReadStore({data:store});
18                             fundingSourceSelector.setValue(store.items[0].code);
19                     }, 
20                     'MANAGE_FUNDING_SOURCE'
21                 );
22             </script>
23             <table class='dijitTooltipTable'>
24                 <tr>
25                     <td><label for="amount">Funding Source: </label></td>
26                     <td>
27                         <input jsId='fundingSourceSelector' name="funding_source" 
28                                dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
29                         </input>
30                     </td>
31                 </tr>
32                 <tr>
33                     <td><label for="amount">Amount: </label></td>
34                     <td>
35                         <input dojoType="dijit.form.CurrencyTextBox" name="amount"> </input>
36                     </td>
37                 </tr>
38
39                 <!-- Percent-based allocations are not supported.  Will implement or remove later.
40                 <tr>
41                     <td><label for="amount">Percent: </label></td>
42                     <td>
43                         <input 
44                              dojoType="dijit.form.NumberTextBox" 
45                              constraints="{min:0,max:100}" 
46                              promptMessage="Please enter an amount between 0 and 100"
47                              name="percent"> 
48                         </input>
49                     </td>
50                 </tr>
51                 -->
52
53                 <tr>
54                     <td><label for="note">Note: </label></td>
55                     <td>
56                         <input dojoType="dijit.form.TextBox" name="note"> </input>
57                     </td>
58                 </tr>
59                 <tr>
60                     <td colspan='2' align='center'>
61                         <button dojoType="dijit.form.Button" type="submit">Apply</button>
62                     </td>
63                 </tr>
64             </table>
65         </div>
66     </div> 
67     <div dojoType="dijit.form.DropDownButton">
68         <span>Transfer Money</span>
69         <div jsId="xferDialog" dojoType="dijit.TooltipDialog">
70             <script type="dojo/connect" event="onOpen">
71                 /* If a fund is selected (from a previous time that the
72                 user popped open this dialog), unselect it. Wouldn't want to
73                 accidentally encourage a transfer that the user didn't mean. */
74                 xferManager.clearFundSelector();
75                 xferManager.setFundName(fund);
76             </script>
77             <table id="oils-acq-fund-xfer-table">
78                 <tr>
79                     <th>
80                         <label for="oils-acq-fund-xfer-o-amount">
81                             Source amount<br />
82                             <em>Amount to transfer from<br />
83                                 <span id="oils-acq-fund-xfer-name-fund"></span>
84                             </em>
85                         </label>
86                     </th>
87                     <td>
88                         <input dojoType="dijit.form.CurrencyTextBox"
89                             id="oils-acq-fund-xfer-o-amount"
90                             name="o_amount" />
91                     </td>
92                 </tr>
93                 <tr>
94                     <th>
95                         <label for="oils-acq-fund-xfer-d-selector">
96                             Destination fund
97                         </label>
98                     </th>
99                     <td>
100                         <span id="oils-acq-fund-xfer-d-selector"></span>
101                     </td>
102                 </tr>
103                 <tr id="oils-acq-fund-xfer-dest-amount" class="hidden">
104                     <th>
105                         <label for="oils-acq-fund-xfer-d-selector">
106                             Destination amount
107                         </label>
108                     </th>
109                     <td>
110                         <div class="oils-acq-basic-roomy">
111                             <input id="oils-acq-fund-xfer-same-o-d"
112                                 dojoType="dijit.form.CheckBox" checked="checked"
113                                 value="1" name="same_o_d" />
114                             <label for="oils-acq-fund-xfer-same-o-d">
115                                 Same as source amount?
116                             </label>
117                         </div>
118                         <div class="oils-acq-basic-roomy">
119                             <input id="oils-acq-fund-xfer-d-amount"
120                                 dojoType="dijit.form.CurrencyTextBox"
121                                 name="d_amount" disabled="disabled" />
122                         </div>
123                     </td>
124                 </tr>
125                 <tr>
126                     <th>
127                         <label for="oils-acq-fund-xfer-note">Note</label>
128                     </th>
129                     <td>
130                         <input dojoType="dijit.form.TextBox" name="note"
131                             id="oils-acq-fund-xfer-note" />
132                     </td>
133                 </tr>
134                 <tr>
135                     <td colspan="2" id="oils-acq-fund-xfer-submit-row">
136                         <button onclick="xferManager.submit();"
137                             dojoType="dijit.form.Button" type="submit">
138                             Transfer
139                         </button>
140                     </td>
141                 </tr>
142             </table>
143         </div>
144     </div>
145 </div>
146
147
148 <div dojoType="dijit.layout.ContentPane" layoutAlign="top">
149     <div dojoType="dijit.layout.TabContainer">
150
151         <!-- Fund Summary -->
152         <div dojoType="dijit.layout.ContentPane" 
153              class='oils-acq-detail-content-pane' title="Summary" selected='true'>
154             
155             <div dojoType="dijit.layout.ContentPane" layoutAlign="top"> 
156                 <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'> 
157                     <table jsId="fundGrid" dojoType="dojox.grid.DataGrid" query="{id: '*'}" rowSelector='20px'> 
158                         <thead> 
159                             <tr> 
160                                 <th field="id">ID</th> 
161                                 <th field="name">Name</th> 
162                                 <th field="code">Code</th> 
163                                 <th field="currency_type">Currency Type</th> 
164                                 <th field="org" get='getOrgInfo'>Owner</th> 
165                                 <th field="combined_balance" get='getSummaryInfo'>Balance</th> 
166                                 <th field="allocation_total" get='getSummaryInfo'>Total Allocated</th>
167                                 <th field="spent_balance" get='getSummaryInfo'>Spent Balance</th>
168                                 <th field="debit_total" get='getSummaryInfo'>Total Debits</th>
169                                 <th field="spent_total" get='getSummaryInfo'>Total Spent</th>
170                                 <th field="encumbrance_total" get='getSummaryInfo'>Total Encumbered</th>
171                             </tr> 
172                         </thead> 
173                     </table>     
174                 </div>
175             </div>
176         </div>
177
178         <!-- Fund Allocations -->
179         <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Allocations">
180             <script type='dojo/connect' event='onShow'>loadAllocationGrid();</script>
181             
182             <div dojoType="dijit.layout.ContentPane" layoutAlign="top"> 
183                 <div dojoType="dijit.layout.ContentPane" layoutAlign="client"> 
184
185                     <table 
186                         jsId="fundAllocationGrid" 
187                         autoHeight='true'
188                         dojoType="openils.widget.AutoGrid"
189                         fieldOrder="['funding_source', 'amount', 'create_time', 'allocator', 'note']"
190                         suppressFields="['id', 'fund']"
191                         defaultCellWidth='"auto"'
192                         fmClass="acqfa"
193                         query="{id: '*'}"
194                         showPaginator='true'>
195
196                         <thead>
197                             <tr>
198                                 <th field='funding_source' get='getFundingSource' formatter='formatFundingSource'/>
199                             </tr>
200                         </thead>
201                     </table>
202                 </div> 
203             </div> 
204         </div>
205
206         <!--- Fund Debits -->
207         <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Debits">
208             <script type='dojo/connect' event='onShow'>loadDebitGrid();</script>
209             
210             <div dojoType="dijit.layout.ContentPane" layoutAlign="top" style='height:600px;'> 
211                 <button dojoType="dijit.form.Button" onClick="fundDebitGrid.refresh();">Refresh Grid</button>
212                 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
213
214                     <table 
215                         jsId="fundDebitGrid" 
216                         autoHeight='true'
217                         dojoType="openils.widget.AutoGrid"
218                         fieldOrder="['amount', 'encumbrance', 'debit_type', 'origin_amount', 'origin_currency_type']"
219                         suppressFields="['id', 'fund']"
220                         defaultCellWidth='"auto"'
221                         fmClass="acqfdeb"
222                         query="{id: '*'}"
223                         showPaginator='true'>
224                     </table>
225                 </div> 
226             </div> 
227         </div>
228
229         <div dojoType="dijit.layout.ContentPane" class="oils-acq-detail-content-pane" title="Tags">
230             <script type="dojo/connect" event="onShow">
231                 tagManager.displayFund(fund);
232             </script>
233             <div id="oils-acq-tag-manager-display"></div>
234             <div id="oils-acq-tag-manager-add">
235                 <div dojoType="dijit.form.DropDownButton">
236                     <span>Add Tag</span>
237                     <div dojoType="dijit.TooltipDialog">
238                         <select dojoType="dijit.form.FilteringSelect"
239                             jsId="tagSelector">
240                         </select>
241                         <button onclick="tagManager.addMapping(
242                             fund, new acqft().fromStoreItem(tagSelector.item)
243                         );" type="submit" dojoType="dijit.form.Button">
244                             Add
245                         </button>
246                     </div>
247                 </div>
248             </div>
249         </div>
250     </div>
251 </div>
252
253 <!-- load the page-specific JS -->
254 <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/acq/common/tag_manager.js"></script>
255 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/acq/financial/view_fund.js'></script>
256
257 [% END %]