2 [% INCLUDE 'doc-head-open.inc' %]
3 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'calendar.inc' %]
6 [% INCLUDE 'datatables.inc' %]
8 <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" />
9 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script>
11 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
12 <script type="text/javascript">
13 // #################################################################################
15 // #################################################################################
16 function CheckDuplicateForm(f){
20 if(!(isNotNull(f.budget_period_startdate,1))){
21 _alertString += "\n- " + _("Start date missing");
23 if (!(isNotNull(f.budget_period_enddate,1))){
24 _alertString += "\n- " + _("End date missing");
26 if( f.budget_period_startdate > f.budget_period_enddate ) {
27 _alertString += "\n- " + _("Start date must be before end date");
30 if(_alertString.length==0){
33 alertString += _("Form not submitted because of the following problem(s)");
34 alertString += "\n-----------------------------------------\n";
35 alertString += _alertString;
44 if (!(isNotNull(f.budget_period_startdate,1))) {
45 _alertString += "\n- " + _("Start date missing");
48 if (!(isNotNull(f.budget_period_enddate,1))) {
49 _alertString += "\n- " + _("End date missing");
52 if ( f.budget_period_startdate > f.budget_period_enddate ) {
53 _alertString += "\n- " + _("Start date must be before end date");
56 if (!(isNotNull(f.budget_period_description,1))) {
57 _alertString += "\n- " + _("Description missing");
60 if (!(isNum(f.budget_period_total))) {
61 _alertString += "\n- " + _("Amount must be a valid number, or empty");
69 if (_alertString.length==0) {
72 alertString2 = _("Form not submitted because of the following problem(s)");
73 alertString2 += "\n------------------------------------------------------------------------------------\n";
74 alertString2 += _alertString;
79 $(document).ready(function() {
80 var tabs = $('#budgetsTabs').tabs();
82 tabs.tabs("option", "active", [% tab %]);
84 $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, {
88 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
89 { "sType": "title-string", "aTargets" : [ "title-string" ] }
96 $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
99 $("#move_form").submit(function(){
100 var budget_from = "[% budget_period_description %]";
101 var budget_to = $("#budget_period").find("option:selected").html();
102 var alert_message = _("You have chosen to move all unreceived orders from '%s' to '%s'.").format(budget_from, budget_to);
103 alert_message += _("\nThis action cannot be reversed. Do you wish to continue?");
104 return confirm ( alert_message );
108 var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, {
109 // The following is a c/p from aqbudgets.tt and is a candidate for refactoring.
110 "fnDrawCallback": function ( oSettings ) {
111 if ( oSettings.aiDisplay.length == 0 )
116 var nTrs = $('#closed_report tbody tr');
117 var iColspan = nTrs[1].getElementsByTagName('td').length;
119 for ( var i=0 ; i<nTrs.length ; i++ )
121 var iDisplayIndex = oSettings._iDisplayStart + i;
122 var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[0];
123 if ( sGroup != sLastGroup )
125 var nGroup = document.createElement( 'tr' );
126 var nCell = document.createElement( 'td' );
127 nCell.colSpan = iColspan;
128 nCell.className = "group";
129 nCell.innerHTML = sGroup;
130 nGroup.appendChild( nCell );
131 nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
137 { "bVisible": false, "aTargets": [ 0, 1 ] },
138 { "bSortable": false, "aTargets": ["_all"] }
141 'aaSortingFixed': [[ 1, 'asc' ]],
150 Koha › Administration › Budgets
152 [% IF ( add_form ) %]›
153 [% IF ( budget_period_id ) %]
154 Modify budget'[% budget_period_id %]'
159 [% IF ( duplicate_form ) %]› Duplicate budget[% END %]
160 [% IF ( delete_confirm ) %]›
161 Delete budget '[% budget_period_description %]'?
163 [% IF ( delete_confirmed ) %]›
166 [% IF close_form %]›
167 Close budget [% budget_period_description %]
169 [% IF closed %]›
170 Budget [% budget_period_description %] closed
177 <body id="admin_aqbudgetperiods" class="admin">
179 [% INCLUDE 'header.inc' %]
180 [% INCLUDE 'budgets-admin-search.inc' %]
182 <!-- ################################################################################# -->
184 <!-- ################################################################################# -->
186 <div id="breadcrumbs">
187 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
188 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> ›
190 <!-- add or modify a budget period -->
191 <!-- ####################################### -->
192 [% IF ( add_form ) %]
193 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budget</a> ›
194 [% IF ( budget_period_id ) %]
195 Modify budget [% budget_period_description %]
202 <!-- delete a budget period -->
203 <!-- ################################ -->
204 [% IF ( delete_confirm ) %]
205 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
207 Cannot delete budget '[% budget_period_description %]'
209 Delete budget '[% budget_period_description %]'?
212 <!-- duplicate a budget -->
213 [% IF ( duplicate_form ) %]
214 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> › Duplicate budget
217 <!-- close a budget -->
219 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
220 Close budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>
223 <!-- budget closed -->
225 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
226 Budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a> closed
228 <!-- display budget periods list -->
229 <!-- ########################################## -->
231 Budgets administration
235 <div id="doc3" class="yui-t2">
240 [% UNLESS close_form OR closed%]
241 [% INCLUDE 'budgets-admin-toolbar.inc' %]
244 [% IF ( duplicate_form ) %]
245 <h3>Duplicate budget</h3>
246 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
247 <fieldset class="rows">
248 <input type="hidden" name="op" value="duplicate_budget" />
249 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
254 <label class="required" for="from">Start date: </label>
255 <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
256 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
260 <label class="required" for="to">End date: </label>
261 <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
262 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
266 <label for="mark_as_inactive">Mark the original budget as inactive</label>
267 <input type="checkbox" id="mark_as_inactive" name="mark_original_budget_as_inactive" />
271 <label for="reset_all_budgets">Set all funds to zero</label>
272 <input type="checkbox" id="reset_all_budgets" name="reset_all_budgets" />
278 <fieldset class="action">
279 <input type="button" value="Save Changes" onclick="CheckDuplicateForm(this.form)" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">Cancel</a>
286 [% IF ( add_form ) %]
287 <!-- add or modify a budget period -->
289 [% IF ( budget_period_id ) %]
290 <h3>Modify budget</h3>
294 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
295 <fieldset class="rows">
296 <!-- ################################################################################# -->
297 <!-- display information about the budget period that must be added or modified -->
298 <!-- ################################################################################# -->
299 <input type="hidden" name="op" value="add_validate" />
300 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
303 <label class="required" for="from">Start date: </label>
304 <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
305 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
309 <label class="required" for="to">End date: </label>
310 <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
311 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
316 <!-- ############################## -->
317 <label class="required" for="budget_period_description">Description: </label>
318 <input type="text" id="budget_period_description" name="budget_period_description"
319 size="48" maxlength="80" value="[% budget_period_description %]" />
324 <!-- ############################## -->
325 <label for="budget_period_total">Total amount: </label>
326 <input type="text" id="budget_period_total" name="budget_period_total"
327 size="10" maxlength="80" value="[% budget_period_total %]" />
332 <!-- ############################## -->
333 <label for="budget_period_active">Make budget active: </label>
334 [% 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 %]
339 <!-- ############################## -->
340 <label for="budget_period_locked">Lock budget: </label>
341 [% 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 %]
346 <fieldset class="action">
347 <!-- "save changes" button -->
348 <!-- ###################################### -->
349 <input type="button" value="Save changes" onclick="Check(this.form)" />
350 <!-- <input type="submit" value="Save Changes" /> -->
351 [% IF ( budget_period_id ) %]<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>[% END %]
358 <!-- ####################################################################### -->
359 <!-- delete a budget period -->
360 <!-- ####################################################################### -->
362 [% IF ( delete_confirm ) %]
364 <div class="dialog message">
365 <h3>Cannot delete budget</h3>
366 <p><strong>This record is used [% total %] times</strong>
367 . Deletion is not possible.</p>
369 <div class="dialog alert">
370 <h3>Delete budget '[% budget_period_description %]'?</h3>
373 <!-- ############################################################# -->
374 <!-- "delete" and "cancel" buttons -->
375 <!-- ############################################################# -->
377 <form action="[% script_name %]" method="post">
378 <input type="hidden" name="op" value="delete_confirmed" />
379 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
380 <input type="submit" class="approve" value="Delete" />
383 <form action="[% script_name %]" method="post">
384 <input type="submit" class="deny" value="Cancel" />
391 [% IF budget_periods.size == 0 %]
392 You cannot move funds of this budget, there is no active budget.
393 Please create a new active budget and retry.
394 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
395 [% ELSIF number_of_unreceived_orders == 0 %]
396 There is no unreceived orders for this budget.
397 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
399 <h3>Choose the funds you want to move unreceived orders:</h3>
400 Fund list of budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>:
407 <th>Unreceived orders</th>
411 [% FOREACH budget IN budgets_to_move %]
413 <td>[% budget.budget_id %]</td>
414 <td>[% budget.budget_code_indent %]</td>
415 <td>[% budget.budget_name %]</td>
416 <td>[% budget.unreceived_orders.size %]</td>
421 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post" id="move_form">
422 <fieldset class="rows">
425 <label class="required" for="to_budget_period_id">Select a budget</label>
426 <select name="to_budget_period_id" id="to_budget_period_id" required="required">
427 <option value=""></option>
428 [% FOR budget_period IN budget_periods %]
429 <option value="[% budget_period.budget_period_id %]">[% budget_period.budget_period_description %]</option>
434 <label for="move_remaining_unspent">Move remaining unspent funds</label>
435 <input type="checkbox" name="move_remaining_unspent" id="move_remaining_unspent" />
439 <fieldset class="action">
440 <input type="hidden" name="op" value="close_confirmed" />
441 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
442 <input type="submit" value="Move unreceive orders" />
443 <a class="cancel" href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Cancel</a>
448 <h3>Report after moving unreceived orders from budget [% from_budget_period.budget_period_description %] ([% from_budget_period.budget_period_startdate | $KohaDates %] - [% to_budget_period.budget_period_enddate | $KohaDates %]) to [% to_budget_period.budget_period_description %] ([% to_budget_period.budget_period_startdate | $KohaDates %] - [% to_budget_period.budget_period_enddate | $KohaDates%])</h3>
450 <table id="closed_report">
456 <td>Informations</td>
460 [% FOR r IN report %]
462 [% IF r.orders_moved.size > 0 %]
463 [% FOR order IN r.orders_moved %]
465 <td>[% r.budget.budget_name %] (id=[% r.budget.budget_id %]) Amount=[% r.budget.budget_amount %][% IF r.unspent_moved %] ([% r.unspent_moved %] remaining has been moved)[% END %]</td>
466 <td>[% order.basketname %]</td>
467 <td>[% order.ordernumber %]</td>
473 <td>[% r.budget.budget_name %] (id=[% r.budget.budget_id %])</td>
476 <td>There was no unreceived orders for this fund.</td>
480 [% IF r.error == 'budget_code_not_exists' %]
482 <td>[% r.budget.budget_id %] [% r.budget.budget_amount %][% IF r.unspent_moved %] ([% r.unspent_moved %] remaining has been moved)[% END %]</td>
485 <td>This fund code does not exist in the destination budget.</td>
493 <a class="cancel" href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
496 <!-- DEFAULT display budget periods list -->
498 <h2>Budgets administration</h2>
500 [% INCLUDE 'budgets-active-currency.inc' %]
502 <div id="budgetsTabs" class="toptabs">
504 <li><a href="#active">Active budgets</a></li>
505 <li><a href="#inactive">Inactive budgets</a></li>
509 [% IF ( period_active_loop ) %]
510 <table id="activeperiodst">
514 <th class="title-string">Start date</th>
515 <th class="title-string">End date</th>
522 [% FOREACH period_active IN period_active_loop %]
524 <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_active.budget_period_id %]" title="View funds for [% period_active.budget_period_description %]">[% period_active.budget_period_description %]</a></td>
525 <td><span title="[% period_active.budget_period_startdate %]">[% period_active.budget_period_startdate | $KohaDates %]</span></td>
526 <td><span title="[% period_active.budget_period_enddate %]">[% period_active.budget_period_enddate | $KohaDates %]</span></td>
528 [% IF ( period_active.budget_period_locked ) %]
529 <span style="color:green;">Locked</span>
532 <td class="data">[% period_active.budget_period_total %]</td>
534 <a href="[% script_name %]?op=add_form&budget_period_id=[% period_active.budget_period_id |html %]">Edit</a>
535 <a href="[% script_name %]?op=delete_confirm&budget_period_id=[% period_active.budget_period_id %]">Delete</a>
536 <a href="[% script_name %]?op=duplicate_form&budget_period_id=[% period_active.budget_period_id %]">Duplicate</a>
537 <a href="[% script_name %]?op=close_form&budget_period_id=[% period_active.budget_period_id %]">Close</a>
538 <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=[% period_active.budget_period_id %]">Add fund</a>
547 <div class="paginationBar">[% active_pagination_bar %]</div>
550 [% IF ( period_inactive_loop ) %]
551 <table id="inactiveperiodst">
555 <th class="title-string">Start date</th>
556 <th class="title-string">End date</th>
563 [% FOREACH period_loo IN period_inactive_loop %]
564 [% IF ( loop.odd ) %]
567 <tr class="highlight">
569 <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_loo.budget_period_id %]" title="View funds for [% period_loo.budget_period_description %]">[% period_loo.budget_period_description %]</a></td>
570 <td><span title="[% period_loo.budget_period_startdate %]">[% period_loo.budget_period_startdate | $KohaDates %]</span></td>
571 <td><span title="[% period_loo.budget_period_enddate %]">[% period_loo.budget_period_enddate | $KohaDates %]</span></td>
572 <td> [% IF ( period_loo.budget_period_locked ) %]<span style="color:green;">Locked</span> [% ELSE %][% END %] </td>
573 <td class="data">[% period_loo.budget_period_total %]</td>
575 <a href="[% script_name %]?op=add_form&budget_period_id=[% period_loo.budget_period_id |html %]">Edit</a>
576 <a href="[% script_name %]?op=delete_confirm&budget_period_id=[% period_loo.budget_period_id %]">Delete</a>
577 <a href="[% script_name %]?op=duplicate_form&budget_period_id=[% period_loo.budget_period_id %]">Duplicate</a>
578 <a href="[% script_name %]?op=close_form&budget_period_id=[% period_loo.budget_period_id %]">Close</a>
579 <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=[% period_loo.budget_period_id %]">Add fund</a>
588 <div class="pages">[% inactive_pagination_bar %]</div>
597 [% INCLUDE 'acquisitions-menu.inc' %]
601 [% INCLUDE 'intranet-bottom.inc' %]