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