base_uri as a misnomer. changed to base_path. added support for overrideing the...
[working/Evergreen.git] / Open-ILS / web / templates / default / acq / financial / view_fund.tt2
1 [% WRAPPER 'default/base.tt2' %]
2 <script>
3     var fundID = [% ctx.page_args.0 %]
4     function getFundingSource(rowIndex, item) {
5     if(!item) return ''; 
6     var fs_id = this.grid.store.getValue(item, 'funding_source');
7     var fs = openils.acq.FundingSource.retrieve(fs_id);
8     return '<a href="[% ctx.base_path %]/acq/funding_source/view/'+fs.id()+'">'+fs.name()+'</a>';
9     }
10 </script>
11
12 <!-- load the page-specific JS -->
13 <script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/view_fund.js'> </script>
14
15 <div id='oils-acq-list-header' class='container'>
16     <div id='oils-acq-list-header-label'>Fund Details</div>
17 </div>
18
19 <div class='oils-acq-actions-div' style='margin:8px;'> <!-- XXX CSS -->
20     <!-- Dropdown menu for creating a new funding source credit -->
21     <div dojoType="dijit.form.DropDownButton">
22         <span>Create Allocation</span>
23         <div dojoType="dijit.TooltipDialog" execute="createAllocation(arguments[0]);">
24             <script type='dojo/connect' event='onOpen'>
25                 openils.acq.FundingSource.createStore(
26                 function(store) {
27                     fundingSourceSelector.store = 
28                     new dojo.data.ItemFileReadStore({data:store});
29                     fundingSourceSelector.setValue(store.items[0].code);
30                     }, 'MANAGE_FUNDING_SOURCE'
31                 );
32             </script>
33             <table class='dijitTooltipTable'>
34                 <tr>
35                     <td><label for="amount">Funding Source: </label></td>
36                     <td>
37                         <input jsId='fundingSourceSelector' name="funding_source" 
38                                dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
39                         </input>
40                     </td>
41                 </tr>
42                 <tr>
43                     <td><label for="amount">Amount: </label></td>
44                     <td>
45                         <!-- XXX get currency from funding source ... -->
46                         <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input>
47                     </td>
48                 </tr>
49                 <tr>
50                     <td><label for="amount">Percent: </label></td>
51                     <td>
52                         <input 
53                              dojoType="dijit.form.NumberTextBox" 
54                              constraints="{min:0,max:100}" 
55                              promptMessage="Please enter an amount between 0 and 100"
56                              name="percent"> 
57                         </input>
58                     </td>
59                 </tr>
60                 <tr>
61                     <td><label for="note">Note: </label></td>
62                     <td>
63                         <input dojoType="dijit.form.TextBox" name="note"> </input>
64                     </td>
65                 </tr>
66                 <tr>
67                     <td colspan='2' align='center'>
68                         <button dojoType="dijit.form.Button" type="submit">Apply</button>
69                     </td>
70                 </tr>
71             </table>
72         </div>
73     </div> 
74 </div>
75
76
77 <div dojoType="dijit.layout.ContentPane" layoutAlign="top">
78     <div dojoType="dijit.layout.TabContainer">
79         <div dojoType="dijit.layout.ContentPane" 
80              class='oils-acq-detail-content-pane' title="Summary" selected='true'>
81             
82             <div dojoType="dijit.layout.ContentPane" layoutAlign="top"> 
83                 <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'> 
84                     <table jsId="fundGrid" dojoType="dojox.grid.DataGrid" query="{id: '*'}" rowSelector='20px'> 
85                         <thead> 
86                             <tr> 
87                                 <th field="id">ID</th> 
88                                 <th field="name" width='auto'>Name</th> 
89                                 <th field="code">Code</th> 
90                                 <th field="currency_type">Currency Type</th> 
91                                 <th field="org" get='getOrgInfo'>Owner</th> 
92                                 <th field="combined_balance" get='getSummaryInfo'>Balance</th> 
93                                 <th field="allocation_total" get='getSummaryInfo'>Total Allocated</th>
94                                 <th field="spent_balance" get='getSummaryInfo'>Spent Balance</th>
95                                 <th field="debit_total" get='getSummaryInfo'>Total Debits</th>
96                                 <th field="spent_total" get='getSummaryInfo'>Total Spent</th>
97                                 <th field="encumbrance_total" get='getSummaryInfo'>Total Encumbered</th>
98                             </tr> 
99                         </thead> 
100                     </table>     
101                
102             <!--
103             {name: 'Balance (Total - (Spent + Encumbrances))")}', get:getSummaryInfo},
104             {name: 'Amount Allocated to this Fund")}', get:getSummaryInfo},
105             {name: 'Spent Balance (Total - Spent)")}', get:getSummaryInfo},
106             {name: 'Total Debits (Spent + Encumbered)")}', get:getSummaryInfo},
107             -->
108
109         </div>
110     </div>
111 </div>
112         <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Allocations">
113             <script type='dojo/connect' event='onShow'>loadAllocationGrid();</script>
114             
115             <div dojoType="dijit.layout.ContentPane" layoutAlign="top"> 
116                 <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'> 
117                     <table jsId="fundAllocationGrid" dojoType="dojox.grid.DataGrid" query="{id: '*'}" rowSelector='20px'> 
118                         <thead> 
119                             <tr> 
120                                 <th field="id">ID</th> 
121                                 <th field="funding_source" get='getFundingSource'>Funding Source</th> 
122                                 <th field="amount">Amount</th> 
123                                 <th field="percent">Percent</th> 
124                                 <th field="allocator">Allocated By</th> 
125                                 <th field="note" width='auto'>Note</th> 
126                             </tr> 
127                         </thead> 
128                     </table>     
129                 </div> 
130             </div> 
131
132         </div>
133         <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Debits">
134             <script type='dojo/connect' event='onShow'>loadDebitGrid();</script>
135             
136             <div dojoType="dijit.layout.ContentPane" layoutAlign="top"> 
137                 <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'> 
138                     <table jsId="fundDebitGrid" dojoType="dojox.grid.DataGrid" query="{id: '*'}" rowSelector='20px'> 
139                         <thead> 
140                             <tr> 
141                                 <th field="id">ID</th> 
142                                 <th field="origin_amount">Origin Amount</th> 
143                                 <th field="origin_currency_type">Origin Currency Type</th> 
144                                 <th field="amount">Amount</th> 
145                                 <th field="encumbrance">Encumbrance</th> 
146                                 <th field="debit_type">Debit Type</th>
147                                 <th field="xfer_destination" get='getXferDestination'>Transfer Destination</th> 
148                             </tr> 
149                         </thead> 
150                     </table>     
151                 </div> 
152             </div> 
153         </div>
154     </div>
155 </div>
156 [% END %]