]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/default/acq/financial/view_funding_source.tt2
Merge remote branch 'working/user/shadowspar/ttopac-altcleanup' into template-toolkit...
[Evergreen.git] / Open-ILS / src / templates / default / acq / financial / view_funding_source.tt2
1 [% WRAPPER 'default/base.tt2' %]
2 <script type="text/javascript"> var fundingSourceID = [% ctx.page_args.0 %]; </script>
3
4 <div id='oils-acq-list-header' class='container'>
5     <div id='oils-acq-list-header-label'>Funding Source Details</div>
6 </div>
7
8 <div class='oils-acq-actions-div' style='margin:8px;'> <!-- XXX CSS -->
9
10     <!-- Dropdown menu for creating a new funding source credit -->
11     <div dojoType="dijit.form.DropDownButton">
12         <span>Apply Credit</span>
13         <div dojoType="dijit.TooltipDialog" execute="applyFSCredit(arguments[0]);">
14             <table class='dijitTooltipTable'>
15                 <tr>
16                     <td><label for="amount">Amount: </label></td>
17                     <td>
18                         <input dojoType="dijit.form.CurrencyTextBox" name="amount"> </input>
19                     </td>
20                 </tr>
21                 <tr>
22                     <td><label for="note">Note: </label></td>
23                     <td>
24                         <input dojoType="dijit.form.TextBox" name="note"> </input>
25                     </td>
26                 </tr>
27                 <tr>
28                     <td colspan='2' align='center'>
29                         <button dojoType=dijit.form.Button type="submit">Apply</button>
30                     </td>
31                 </tr>
32             </table>
33         </div>
34     </div> 
35     <div dojoType="dijit.form.DropDownButton">
36         <span>Allocate to Fund</span>
37         <div dojoType="dijit.TooltipDialog" execute="applyFSAllocation(arguments[0]);">
38             <script type='dojo/connect' event='onOpen'>
39                 openils.acq.Fund.createStore(
40                     function(store) {
41                         fundingSourceFundSelector.store = 
42                             new dojo.data.ItemFileReadStore({data:store});
43                         fundingSourceFundSelector.setValue(store.items[0].code);
44                     }, 'MANAGE_FUND'
45                 );
46             </script>
47             <table class='dijitTooltipTable'>
48                 <tr>
49                     <td><label for="amount">Fund: </label></td>
50                     <td>
51                         <input jsId='fundingSourceFundSelector' name="fund" 
52                             dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
53                         </input>
54                     </td>
55                 </tr>
56                 <tr>
57                     <td><label for="amount">Amount: </label></td>
58                     <td>
59                         <input dojoType="dijit.form.CurrencyTextBox" name="amount"> </input>
60                     </td>
61                 </tr>
62                 <!-- Percent-based allocations are not supported.  Will implement or remove later.
63                 <tr>
64                     <td><label for="amount">Percent: </label></td>
65                     <td>
66                         <input 
67                             dojoType="dijit.form.NumberTextBox" 
68                             constraints="{min:0,max:100}" 
69                             promptMessage="Please enter an amount between 0 and 100"
70                             name="percent"> 
71                         </input>
72                     </td>
73                 </tr>
74                 -->
75                 <tr>
76                     <td><label for="note">Note: </label></td>
77                     <td>
78                         <input dojoType="dijit.form.TextBox" name="note"> </input>
79                     </td>
80                 </tr>
81                 <tr>
82                     <td colspan='2' align='center'>
83                         <button dojoType=dijit.form.Button type="submit">Apply</button>
84                     </td>
85                 </tr>
86             </table>
87         </div>
88     </div> 
89 </div>
90
91 <div dojoType="dijit.layout.ContentPane" layoutAlign="top">
92     <div dojoType="dijit.layout.TabContainer">
93
94         <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Summary" selected='true'>
95             <script type='dojo/connect' event='onShow'>loadFSGrid();</script>
96
97             <div dojoType="dijit.layout.ContentPane" layoutAlign="top"> 
98                 <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'> 
99                     <table jsId="fundingSourceGrid" dojoType="dojox.grid.DataGrid" query="{id: '*'}" rowSelector='20px'> 
100                         <thead> 
101                             <tr> 
102                                 <th field="id">ID</th> 
103                                 <th field="name" width='auto'>Name</th> 
104                                 <th field="code">Code</th> 
105                                 <th field="balance" get='getSummaryInfo'>Balance</th>
106                                 <th field="credit_total" get='getSummaryInfo'>Total Credits</th>
107                                 <th field="allocation_total" get='getSummaryInfo'>Total Debits</th>
108                                 <th field="currency_type">Currency Type</th> 
109                                 <th field="owner" width='auto' get='getOrgInfo'>Owner</th>
110                             </tr> 
111                         </thead> 
112                     </table>     
113                 </div> 
114             </div>               
115         </div>
116  
117         <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Credits">
118             <script type='dojo/connect' event='onShow'>loadCreditGrid(); </script> 
119
120             <div dojoType="dijit.layout.ContentPane" layoutAlign="top"> 
121                 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
122
123                     <table 
124                         jsId="fsCreditGrid"
125                         autoheight="true"
126                         dojoType="openils.widget.AutoGrid"
127                         fieldOrder="['amount', 'effective_date', 'deadline_date', 'note']"
128                         suppressFields="['id', 'funding_source']"
129                         defaultCellWidth='"auto"'
130                         fmClass="acqfscred"
131                         query="{id: '*'}"
132                         showPaginator='true'>
133                     </table>
134                 </div> 
135             </div> 
136         </div>
137
138         <!-- Fund Allocations -->
139         <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Allocations">
140             <script type='dojo/connect' event='onShow'>loadAllocationGrid();</script>
141             
142             <div dojoType="dijit.layout.ContentPane" layoutAlign="top"> 
143                 <div dojoType="dijit.layout.ContentPane" layoutAlign="client"> 
144
145                     <table 
146                         jsId="fsAllocationGrid" 
147                         autoHeight='true'
148                         dojoType="openils.widget.AutoGrid"
149                         fieldOrder="['fund', 'amount', 'create_time', 'allocator', 'note']"
150                         suppressFields="['id', 'funding_source']"
151                         defaultCellWidth='"auto"'
152                         fmClass="acqfa"
153                         query="{id: '*'}"
154                         showPaginator='true'>
155
156                         <thead>
157                             <tr>
158                                 <th field='fund' get='getFund' formatter='formatFund'/>
159                             </tr>
160                         </thead>
161                     </table>
162                 </div> 
163             </div> 
164         </div>
165
166     </div>
167 </div>
168
169 <!-- load the page-specific JS -->
170 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/acq/financial/view_funding_source.js'> </script>
171
172 [% END %]
173