Bug 22007: Generated with add_missing_filters.pl
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqbudgetperiods.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE Price %]
5 [% SET footerjs = 1 %]
6 [%- BLOCK action_menu %]
7     <div class="dropdown">
8         <a class="btn btn-default btn-xs dropdown-toggle" id="budgetmenu_[% block_budget.budget_period_id | html %]" role="button" data-toggle="dropdown" href="#">
9            Actions <b class="caret"></b>
10         </a>
11         <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="budgetmenu_[% block_budget.budget_period_id | html %]">
12               <li>
13                   <a href="[% script_name | url %]?op=add_form&amp;budget_period_id=[% block_budget.budget_period_id | uri %]"><i class="fa fa-pencil"></i> Edit</a>
14               </li>
15               [% IF block_budget.count %]
16                   <li class="disabled">
17                       <a data-toggle="tooltip" data-placement="left" title="[% block_budget.count | html %] fund(s) are attached to this budget. You must delete all attached funds before deleting this budget." href="#"><i class="fa fa-trash"></i> Delete</a>
18                   </li>
19               [% ELSE %]
20                   <li>
21                       <a href="[% script_name | url %]?op=delete_confirm&amp;budget_period_id=[% block_budget.budget_period_id | uri %]"><i class="fa fa-trash"></i> Delete</a>
22                   </li>
23               [% END %]
24               <li>
25                   <a href="[% script_name | url %]?op=duplicate_form&amp;budget_period_id=[% block_budget.budget_period_id | uri %]"><i class="fa fa-copy"></i> Duplicate</a>
26               </li>
27               <li>
28                   <a href="[% script_name | url %]?op=close_form&amp;budget_period_id=[% block_budget.budget_period_id | uri %]"><i class="fa fa-times-circle"></i> Close</a>
29               </li>
30               <li>
31                   <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_period_id=[% block_budget.budget_period_id | uri %]"><i class="fa fa-plus"></i> Add fund</a>
32               </li>
33         </ul>
34     </div>
35 [% END -%]
36
37 [% INCLUDE 'doc-head-open.inc' %]
38 [% INCLUDE 'doc-head-close.inc' %]
39 [% Asset.css("css/datatables.css") | $raw %]
40 [% IF close_form %]
41     [% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %]
42 [% END %]
43
44 <title>
45     Koha &rsaquo; Administration &rsaquo; Budgets
46
47     [% IF ( add_form ) %]&rsaquo;
48         [% IF ( budget_period_id ) %]
49             Modify budget [% budget_period_description | html %]
50         [% ELSE %]
51             Add budget
52         [% END %]
53     [% END %]
54     [% IF ( duplicate_form ) %]&rsaquo; Duplicate budget[% END %]
55     [% IF ( delete_confirm ) %]&rsaquo;
56             Delete budget '[% budget_period_description | html %]'?
57     [% END %]
58     [% IF ( delete_confirmed ) %]&rsaquo;
59         Data deleted
60     [% END %]
61     [% IF close_form %]&rsaquo;
62       Close budget [% budget_period_description | html %]
63     [% END %]
64     [% IF closed %]&rsaquo;
65       Budget [% budget_period_description | html %] closed
66     [% END %]
67 </title>
68
69
70 </head>
71
72 <body id="admin_aqbudgetperiods" class="admin">
73
74 [% INCLUDE 'header.inc' %]
75 [% INCLUDE 'budgets-admin-search.inc' %]
76
77 <!-- ################################################################################# -->
78 <!-- BREADCRUMBS -->
79 <!-- ################################################################################# -->
80
81 <div id="breadcrumbs">
82     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
83     <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo;
84
85     [% IF ( add_form ) %]
86         <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
87         [% IF ( budget_period_id ) %]
88             <span>Modify budget '[% budget_period_description | html %]'</span>
89         [% ELSE %]
90             <span>Add budget</span>
91         [% END %]
92     [% END %]
93     [% IF ( delete_confirm ) %]
94         <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
95         [% IF ( total || funds_exist ) %]
96             <span>Cannot delete budget '[% budget_period_description | html %]'</span>
97         [% ELSE %]
98             <span>Delete budget '[% budget_period_description | html %]'?</span>
99         [% END %]
100     [% END %]
101     [% IF ( duplicate_form ) %]
102         <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo; Duplicate budget
103     [% END %]
104     [% IF close_form %]
105         <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
106         <span>Close budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | uri %]">[% budget_period_description | html %]</a></span>
107     [% END %]
108     [% IF closed %]
109         <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
110         <span>Budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | uri %]">[% budget_period_description | html %]</a> closed</span>
111     [% END %]
112     [% IF ( else ) %]
113         <span>Budgets administration</span>
114     [% END %]
115 </div>
116
117 <div class="main container-fluid">
118     <div class="row">
119         <div class="col-sm-10 col-sm-push-2">
120             <main>
121
122 [% UNLESS close_form OR closed OR duplicate_form %]
123   [% INCLUDE 'budgets-admin-toolbar.inc' %]
124 [% END %]
125
126 [% IF ( duplicate_form ) %]
127 <h3>Duplicate budget</h3>
128 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" id="add_modify_budget" name="f" method="post">
129     <fieldset class="rows">
130     <input type="hidden" name="op" value="duplicate_budget" />
131     <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
132
133     <ol>
134
135     <li>
136     <label class="required" for="from">Start date: </label>
137     <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
138         <span class="required">Required</span>
139         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
140     </li>
141     <li>
142
143     <label class="required" for="to">End date: </label>
144     <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
145         <span class="required">Required</span>
146         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
147     </li>
148
149     <li>
150     <label class="required" for="budget_period_description">Description</label>
151     <input type="text" id="budget_period_description" name="budget_period_description" value="[% budgetperiod.budget_period_description | html %]" />
152         <span class="required">Required</span>
153     </li>
154
155     <li>
156       <label for="amount_change_percentage">Change amounts by</label>
157       <input type="text" id="amount_change_percentage" name="amount_change_percentage" /> %
158       <div class="hint">(can be positive or negative)</div>
159     </li>
160
161     <li>
162       <label for="amount_change_round_increment">If amounts changed, round to a multiple of</label>
163       <input type="text" id="amount_change_round_increment" name="amount_change_round_increment" />
164       <div class="hint">(amounts will be rounded down)</div>
165     </li>
166
167     <li>
168       <label for="mark_as_inactive">Mark the original budget as inactive</label>
169       <input type="checkbox" id="mark_as_inactive" name="mark_original_budget_as_inactive" />
170     </li>
171
172     <li>
173       <label for="reset_all_budgets">Set all funds to zero</label>
174       <input type="checkbox" id="reset_all_budgets" name="reset_all_budgets" />
175     </li>
176
177     </ol>
178     </fieldset>
179
180     <fieldset class="action">
181         <input type="submit" value="Save" />
182         <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | html %]">Cancel</a>
183     </fieldset>
184
185 </form>
186
187 [% END %]
188
189 [% IF ( add_form ) %]
190     <!--  add or modify a budget period   -->
191
192     [% IF ( budget_period_id ) %]
193         <h3>Modify budget <i>[% budget_period_description | html %]</i></h3>
194     [% ELSE %]
195         <h3>Add budget</h3>
196         [% END %]
197 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" id="add_modify_budget" name="f" method="post">
198     <fieldset class="rows">
199     <!-- ################################################################################# -->
200     <!-- display information about the budget period that must be added or modified -->
201     <!-- ################################################################################# -->
202     <input type="hidden" name="op" value="add_validate" />
203     <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
204     <ol>
205     <li>
206     <label class="required" for="from">Start date: </label>
207     <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
208         <span class="required">Required</span>
209         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
210     </li>
211     <li>
212
213     <label class="required" for="to">End date: </label>
214     <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
215         <span class="required">Required</span>
216         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
217     </li>
218
219     <li>
220         <!-- DESCRIPTION -->
221         <!-- ############################## -->
222         <label class="required" for="budget_period_description">Description: </label>
223         <input type="text" id="budget_period_description" name="budget_period_description"
224         size="48" maxlength="80" value="[% budget_period_description | html %]" />
225             <span class="required">Required</span>
226     </li>
227
228     <li>
229         <!-- TOTAL -->
230         <!-- ############################## -->
231         <label for="budget_period_total">Total amount: </label>
232         <input type="text" id="budget_period_total" name="budget_period_total"
233         size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" />
234     </li>
235
236     <li>
237         <!-- ACTIVE -->
238         <!-- ############################## -->
239         <label for="budget_period_active">Make budget active: </label>
240         [% IF ( budget_period_active ) %]<input type="checkbox" checked="checked" id="budget_period_active" name="budget_period_active" value="1" />[% ELSE %]  <input type="checkbox" id="budget_period_active" name="budget_period_active" value="1"/> [% END %]
241     </li>
242
243     <li>
244         <!-- LOCK  -->
245         <!-- ############################## -->
246         <label for="budget_period_locked">Lock budget: </label>
247         [% IF ( budget_period_locked ) %]<input type="checkbox" checked="checked" id="budget_period_locked" name="budget_period_locked" value="1" />[% ELSE %]  <input type="checkbox" id="budget_period_locked" name="budget_period_locked" value="1"/> [% END %]
248     </li>
249     </ol>
250     </fieldset>
251
252     <fieldset class="action">
253         <!-- "save changes" button -->
254         <!-- ###################################### -->
255         <input type="submit" value="Save" />
256         [% IF ( budget_period_id ) %]
257             <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | uri %]" class="cancel">Cancel</a>
258         [% ELSE %]
259             <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl" class="cancel">Cancel</a>
260         [% END %]
261     </fieldset>
262
263 </form>
264
265 [% END %]
266
267 <!-- ####################################################################### -->
268 <!-- delete a budget period -->
269 <!-- ####################################################################### -->
270
271 [% IF ( delete_confirm ) %]
272     [% IF ( total ) %]
273         <div class="dialog message">
274         <h3>Cannot delete budget</h3>
275         <p><strong>This record is used [% total | html %] times</strong>
276         . Deletion is not possible.</p>
277     [% ELSIF ( funds_exist ) %]
278         <div class="dialog message">
279         <h3>Cannot delete budget</h3>
280         <p>This budget has funds attached. You must delete all attached funds before you can delete this budget.</p>
281     [% ELSE %]
282         <div class="dialog alert">
283         <h3>Delete budget '[% budget_period_description | html %]'?</h3>
284
285     <!-- ############################################################# -->
286     <!-- "delete" and "cancel" buttons    -->
287     <!-- ############################################################# -->
288
289     <form action="[% script_name | html %]" method="post">
290         <input type="hidden" name="op" value="delete_confirmed" />
291         <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
292         <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
293     </form>
294     <form action="[% script_name | html %]" method="post">
295         <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
296     </form>
297     [% END %]
298
299     </div>
300 [% END %]
301
302 [% IF close_form %]
303   [% IF budget_periods.size == 0 %]
304     You cannot move funds of this budget, there is no active budget.
305     Please create a new active budget and retry.
306     <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
307   [% ELSIF number_of_unreceived_orders == 0 %]
308     There are no unreceived orders for this budget.
309     <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
310   [% ELSE %]
311     <h3>The unreceived orders from the following funds will be moved</h3>
312       Fund list of budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | uri %]">[% budget_period_description | html %]</a>:
313     <table id="budgeth">
314       <thead>
315         <tr>
316             <th>Fund id</th>
317             <th>Fund code</th>
318             <th>Fund name</th>
319             <th>Unreceived orders</th>
320         </tr>
321       </thead>
322       <tbody>
323         [% FOREACH budget IN budgets_to_move %]
324           <tr>
325             <td>[% budget.budget_id | html %]</td>
326             <td>[% budget.budget_code_indent | html %]</td>
327             <td>[% budget.budget_name | html %]</td>
328             <td>[% budget.unreceived_orders.size | html %]</td>
329           </tr>
330         [% END %]
331       </tbody>
332     </table>
333     <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post" id="move_form">
334       <fieldset class="rows">
335         <ol>
336           <li>
337             <label class="required" for="to_budget_period_id">Select a budget</label>
338             <select name="to_budget_period_id" id="to_budget_period_id" required="required">
339               <option value=""></option>
340               [% FOR budget_period IN budget_periods %]
341                 <option value="[% budget_period.budget_period_id | html %]">[% budget_period.budget_period_description | html %]</option>
342               [% END %]
343             </select>
344           </li>
345           <li>
346           <label for="move_remaining_unspent">Move remaining unspent funds</label>
347             <input type="checkbox" name="move_remaining_unspent" id="move_remaining_unspent" />
348           </li>
349         </ol>
350       </fieldset>
351       <fieldset class="action">
352           <input type="hidden" name="op" value="close_confirmed" />
353           <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
354           <input type="submit" value="Move unreceived orders" />
355           <a class="cancel" href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Cancel</a>
356       </fieldset>
357     </form>
358   [% END %]
359 [% ELSIF closed %]
360   <h3>Report after moving unreceived orders from budget [% from_budget_period.budget_period_description | html %] ([% from_budget_period.budget_period_startdate | $KohaDates %] - [% from_budget_period.budget_period_enddate | $KohaDates %]) to [% to_budget_period.budget_period_description | html %] ([% to_budget_period.budget_period_startdate | $KohaDates %] - [% to_budget_period.budget_period_enddate | $KohaDates%])</h3>
361
362   <table id="closed_report">
363     <thead>
364       <tr>
365         <td>Budget id</td>
366         <td>Basket</td>
367         <td>Ordernumber</td>
368         <td>Details</td>
369       </tr>
370     </thead>
371     <tbody>
372       [% FOR r IN report %]
373           [% IF r.moved %]
374             [% IF r.orders_moved.size > 0 %]
375               [% FOR order IN r.orders_moved %]
376                 <tr>
377                   <td>[% r.budget.budget_name | html %] (id=[% r.budget.budget_id | html %]) Amount=[% r.budget.budget_amount | $Price %][% IF r.unspent_moved %] ([% r.unspent_moved | $Price %] remaining has been moved)[% END %]</td>
378                   <td>[% order.basketname | html %]</td>
379                   <td>[% order.ordernumber | html %]</td>
380                   <td>Moved!</td>
381                 </tr>
382               [% END %]
383             [% ELSE %]
384               <tr>
385                 <td>[% r.budget.budget_name | html %] (id=[% r.budget.budget_id | html %])</td>
386                 <td></td>
387                 <td></td>
388                 <td>There were no unreceived orders for this fund.</td>
389               </tr>
390             [% END %]
391           [% ELSE %]
392             [% IF r.error == 'budget_code_not_exists' %]
393               <tr>
394                 <td>[% r.budget.budget_id | html %] [% r.budget.budget_amount | $Price %][% IF r.unspent_moved %] ([% r.unspent_moved | $Price %] remaining has been moved)[% END %]</td>
395                 <td></td>
396                 <td></td>
397                 <td>This fund code does not exist in the destination budget.</td>
398               </tr>
399             [% END %]
400           [% END %]
401         </tr>
402       [% END %]
403     </tbody>
404   </table>
405   <a class="cancel" href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
406 [% END %]
407
408 <!--  DEFAULT  display budget periods list -->
409 [% IF ( else ) %]
410   <h2>Budgets administration</h2>
411
412     [% IF ( failed_delete_funds_exist ) %]
413         <div class="dialog message">Failed to delete budget because funds exist.</div>
414     [% END %]
415
416   [% INCLUDE 'budgets-active-currency.inc' %]
417
418   <div id="budgetsTabs" class="toptabs">
419     <ul>
420         <li><a href="#active">Active budgets</a></li>
421         <li><a href="#inactive">Inactive budgets</a></li>
422     </ul>
423
424     <div id="active">
425       [% IF ( period_active_loop ) %]
426         <table id="activeperiodst">
427           <thead>
428             <tr>
429               <th>Budget name</th>
430               <th class="title-string">Start date</th>
431               <th class="title-string">End date</th>
432               <th>Locked</th>
433               <th>Total</th>
434               <th>Actions</th>
435             </tr>
436           </thead>
437           <tbody>
438               [% FOREACH period_active IN period_active_loop %]
439                 <tr>
440                 <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_active.budget_period_id | uri %]" title="View funds for [% period_active.budget_period_description | html %]">[% period_active.budget_period_description | html %]</a></td>
441                 <td><span title="[% period_active.budget_period_startdate | html %]">[% period_active.budget_period_startdate | $KohaDates %]</span></td>
442                 <td><span title="[% period_active.budget_period_enddate | html %]">[% period_active.budget_period_enddate | $KohaDates %]</span></td>
443                 <td>
444                   [% IF ( period_active.budget_period_locked ) %]
445                     <span style="color:green;">Locked</span>&nbsp;
446                   [% END %]
447                 </td>
448                 <td class="data">[% period_active.budget_period_total | $Price %]</td>
449                 <td>
450                     [% PROCESS action_menu block_budget=period_active %]
451                 </td>
452                 </tr>
453               [% END %]
454           </tbody>
455         </table>
456       [% ELSE %]
457         No active budgets
458       [% END %]
459     </div>
460     <div id="inactive">
461       [% IF ( period_inactive_loop ) %]
462         <table id="inactiveperiodst">
463           <thead>
464               <tr>
465                   <th>Budget name</th>
466                   <th class="title-string">Start date</th>
467                   <th class="title-string">End date</th>
468                   <th>Locked</th>
469                   <th>Total</th>
470                   <th>Actions</th>
471               </tr>
472           </thead>
473           <tbody>
474               [% FOREACH period_loo IN period_inactive_loop %]
475                   <tr>
476                   <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_loo.budget_period_id | uri %]" title="View funds for [% period_loo.budget_period_description | html %]">[% period_loo.budget_period_description | html %]</a></td>
477                   <td><span title="[% period_loo.budget_period_startdate | html %]">[% period_loo.budget_period_startdate | $KohaDates %]</span></td>
478                   <td><span title="[% period_loo.budget_period_enddate | html %]">[% period_loo.budget_period_enddate | $KohaDates %]</span></td>
479                   <td> [% IF ( period_loo.budget_period_locked ) %]<span style="color:green;">Locked</span>&nbsp;[% ELSE %][% END %] </td>
480                   <td class="data">[% period_loo.budget_period_total | $Price %]</td>
481                   <td>
482                         [% PROCESS action_menu block_budget=period_loo %]
483                   </td>
484                   </tr>
485               [% END %]
486           </tbody>
487         </table>
488       [% ELSE %]
489         No inactive budgets
490       [% END %]
491     </div>
492   </div>
493 [% END %]
494
495             </main>
496         </div> <!-- /.col-sm-10.col-sm-push-2 -->
497
498         <div class="col-sm-2 col-sm-pull-10">
499             <aside>
500                 [% INCLUDE 'acquisitions-menu.inc' %]
501             </aside>
502         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
503      </div> <!-- /.row -->
504
505 [% MACRO jsinclude BLOCK %]
506     [% INCLUDE 'calendar.inc' %]
507     [% INCLUDE 'datatables.inc' %]
508     [% IF close_form %]
509         [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
510     [% END %]
511     [% Asset.js("js/acq.js") | $raw %]
512     <script>
513         $(document).ready(function() {
514             var tabs = $('#budgetsTabs').tabs();
515             [% IF ( tab ) %]
516                 tabs.tabs("option", "active", [% tab | html %]);
517             [% END %]
518             $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, {
519                 "aoColumnDefs": [
520                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
521                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
522                 ],
523                 "sPaginationType": "four_button",
524                 'bAutoWidth': false
525             } ) );
526
527             [% IF close_form %]
528               $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
529                 sDom: "t"
530               }));
531               $("#move_form").submit(function(){
532                 var budget_from = "[% budget_period_description | html %]";
533                 var budget_to = $("#to_budget_period_id").find("option:selected").html();
534                 var alert_message = _("You have chosen to move all unreceived orders from '%s' to '%s'.").format(budget_from, budget_to);
535                 alert_message += "\n" + _("This action cannot be reversed. Do you wish to continue?");
536                 return confirm ( alert_message );
537               });
538             [% END %]
539             [% IF closed %]
540               var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, {
541                 // The following is a c/p from aqbudgets.tt and is a candidate for refactoring.
542                 "fnDrawCallback": function ( oSettings ) {
543                     if ( oSettings.aiDisplay.length == 0 )
544                     {
545                         return;
546                     }
547
548                     var nTrs = $('#closed_report tbody tr');
549                     var iColspan = nTrs[1].getElementsByTagName('td').length;
550                     var sLastGroup = "";
551                     for ( var i=0 ; i<nTrs.length ; i++ )
552                     {
553                         var iDisplayIndex = oSettings._iDisplayStart + i;
554                         var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[0];
555                         if ( sGroup != sLastGroup )
556                         {
557                             var nGroup = document.createElement( 'tr' );
558                             var nCell = document.createElement( 'td' );
559                             nCell.colSpan = iColspan;
560                             nCell.className = "group";
561                             nCell.innerHTML = sGroup;
562                             nGroup.appendChild( nCell );
563                             nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
564                             sLastGroup = sGroup;
565                         }
566                     }
567                 },
568                 "aoColumnDefs": [
569                     { "bVisible": false, "aTargets": [ 0, 1 ] },
570                     { "bSortable": false, "aTargets": ["_all"] }
571                 ],
572                 'bSort': true,
573                 'aaSortingFixed': [[ 1, 'asc' ]],
574                 "bAutoWidth": false,
575                 "sPaginationType": "full_numbers"
576               }));
577             [% END %]
578             $("#add_modify_budget").validate({
579                 rules: {
580                     budget_period_startdate: "required",
581                     budget_period_enddate: {
582                         required: true,
583                         date_on_or_after: "#from"
584                     },
585                     budget_period_description: "required",
586                     budget_period_total: {
587                         number: true
588                     }
589                 },
590                 messages: {
591                     budget_period_enddate: {
592                         date_on_or_after: _("Budget end date must be on or after budget start date")
593                     }
594                 }
595             });
596         });
597     </script>
598 [% END %]
599 [% INCLUDE 'intranet-bottom.inc' %]