4 [%- BLOCK action_menu %]
6 <a class="btn btn-mini dropdown-toggle" id="budgetmenu_[% block_budget_id %]" role="button" data-toggle="dropdown" href="#">
7 Actions <b class="caret"></b>
9 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="budgetmenu_[% block_budget_id %]">
11 <a href="[% script_name %]?op=add_form&budget_period_id=[% block_budget_id |html %]"><i class="icon-pencil"></i> Edit</a>
14 <a href="[% script_name %]?op=delete_confirm&budget_period_id=[% block_budget_id %]"><i class="icon-remove"></i> Delete</a>
17 <a href="[% script_name %]?op=duplicate_form&budget_period_id=[% block_budget_id %]"><i class="icon-copy"></i> Duplicate</a>
20 <a href="[% script_name %]?op=close_form&budget_period_id=[% block_budget_id %]"><i class="icon-remove-sign"></i> Close</a>
23 <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=[% block_budget_id %]"><i class="icon-plus"></i> Add fund</a>
29 [% INCLUDE 'doc-head-open.inc' %]
30 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
31 [% INCLUDE 'doc-head-close.inc' %]
32 [% INCLUDE 'calendar.inc' %]
33 [% INCLUDE 'datatables.inc' %]
35 <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" />
36 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script>
38 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
39 <script type="text/javascript">
40 // #################################################################################
42 // #################################################################################
43 function CheckDuplicateForm(f){
47 if(!(isNotNull(f.budget_period_startdate,1))){
48 _alertString += "\n- " + _("Start date missing");
50 if (!(isNotNull(f.budget_period_enddate,1))){
51 _alertString += "\n- " + _("End date missing");
53 if( f.budget_period_startdate > f.budget_period_enddate ) {
54 _alertString += "\n- " + _("Start date must be before end date");
56 if (!(isNotNull(f.budget_period_description,1))){
57 _alertString += "\n- " + _("Budget description missing");
60 if(_alertString.length==0){
63 alertString += _("Form not submitted because of the following problem(s)");
64 alertString += "\n-----------------------------------------\n";
65 alertString += _alertString;
74 if (!(isNotNull(f.budget_period_startdate,1))) {
75 _alertString += "\n- " + _("Start date missing");
78 if (!(isNotNull(f.budget_period_enddate,1))) {
79 _alertString += "\n- " + _("End date missing");
82 if ( f.budget_period_startdate > f.budget_period_enddate ) {
83 _alertString += "\n- " + _("Start date must be before end date");
86 if (!(isNotNull(f.budget_period_description,1))) {
87 _alertString += "\n- " + _("Description missing");
90 if (!(isNum(f.budget_period_total))) {
91 _alertString += "\n- " + _("Amount must be a valid number, or empty");
99 if (_alertString.length==0) {
102 alertString2 = _("Form not submitted because of the following problem(s)");
103 alertString2 += "\n------------------------------------------------------------------------------------\n";
104 alertString2 += _alertString;
109 $(document).ready(function() {
110 var tabs = $('#budgetsTabs').tabs();
112 tabs.tabs("option", "active", [% tab %]);
114 $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, {
118 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
119 { "sType": "title-string", "aTargets" : [ "title-string" ] }
126 $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
129 $("#move_form").submit(function(){
130 var budget_from = "[% budget_period_description %]";
131 var budget_to = $("#to_budget_period_id").find("option:selected").html();
132 var alert_message = _("You have chosen to move all unreceived orders from '%s' to '%s'.").format(budget_from, budget_to);
133 alert_message += _("\nThis action cannot be reversed. Do you wish to continue?");
134 return confirm ( alert_message );
138 var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, {
139 // The following is a c/p from aqbudgets.tt and is a candidate for refactoring.
140 "fnDrawCallback": function ( oSettings ) {
141 if ( oSettings.aiDisplay.length == 0 )
146 var nTrs = $('#closed_report tbody tr');
147 var iColspan = nTrs[1].getElementsByTagName('td').length;
149 for ( var i=0 ; i<nTrs.length ; i++ )
151 var iDisplayIndex = oSettings._iDisplayStart + i;
152 var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[0];
153 if ( sGroup != sLastGroup )
155 var nGroup = document.createElement( 'tr' );
156 var nCell = document.createElement( 'td' );
157 nCell.colSpan = iColspan;
158 nCell.className = "group";
159 nCell.innerHTML = sGroup;
160 nGroup.appendChild( nCell );
161 nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
167 { "bVisible": false, "aTargets": [ 0, 1 ] },
168 { "bSortable": false, "aTargets": ["_all"] }
171 'aaSortingFixed': [[ 1, 'asc' ]],
180 Koha › Administration › Budgets
182 [% IF ( add_form ) %]›
183 [% IF ( budget_period_id ) %]
184 Modify budget [% budget_period_description %]
189 [% IF ( duplicate_form ) %]› Duplicate budget[% END %]
190 [% IF ( delete_confirm ) %]›
191 Delete budget '[% budget_period_description %]'?
193 [% IF ( delete_confirmed ) %]›
196 [% IF close_form %]›
197 Close budget [% budget_period_description %]
199 [% IF closed %]›
200 Budget [% budget_period_description %] closed
207 <body id="admin_aqbudgetperiods" class="admin">
209 [% INCLUDE 'header.inc' %]
210 [% INCLUDE 'budgets-admin-search.inc' %]
212 <!-- ################################################################################# -->
214 <!-- ################################################################################# -->
216 <div id="breadcrumbs">
217 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
218 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> ›
220 <!-- add or modify a budget period -->
221 <!-- ####################################### -->
222 [% IF ( add_form ) %]
223 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
224 [% IF ( budget_period_id ) %]
225 Modify budget <i>[% budget_period_description %]</i>
232 <!-- delete a budget period -->
233 <!-- ################################ -->
234 [% IF ( delete_confirm ) %]
235 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
237 Cannot delete budget '[% budget_period_description %]'
239 Delete budget '[% budget_period_description %]'?
242 <!-- duplicate a budget -->
243 [% IF ( duplicate_form ) %]
244 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> › Duplicate budget
247 <!-- close a budget -->
249 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
250 Close budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>
253 <!-- budget closed -->
255 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
256 Budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a> closed
258 <!-- display budget periods list -->
259 <!-- ########################################## -->
261 Budgets administration
265 <div id="doc3" class="yui-t2">
270 [% UNLESS close_form OR closed%]
271 [% INCLUDE 'budgets-admin-toolbar.inc' %]
274 [% IF ( duplicate_form ) %]
275 <h3>Duplicate budget</h3>
276 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
277 <fieldset class="rows">
278 <input type="hidden" name="op" value="duplicate_budget" />
279 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
284 <label class="required" for="from">Start date: </label>
285 <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
286 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
290 <label class="required" for="to">End date: </label>
291 <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
292 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
296 <label class="required" for="budget_period_description">Description</label>
297 <input type="text" id="budget_period_description" name="budget_period_description" value="[% budgetperiod.budget_period_description %]" />
301 <label for="mark_as_inactive">Mark the original budget as inactive</label>
302 <input type="checkbox" id="mark_as_inactive" name="mark_original_budget_as_inactive" />
306 <label for="reset_all_budgets">Set all funds to zero</label>
307 <input type="checkbox" id="reset_all_budgets" name="reset_all_budgets" />
313 <fieldset class="action">
314 <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>
321 [% IF ( add_form ) %]
322 <!-- add or modify a budget period -->
324 [% IF ( budget_period_id ) %]
325 <h3>Modify budget <i>[% budget_period_description %]</i></h3>
329 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
330 <fieldset class="rows">
331 <!-- ################################################################################# -->
332 <!-- display information about the budget period that must be added or modified -->
333 <!-- ################################################################################# -->
334 <input type="hidden" name="op" value="add_validate" />
335 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
338 <label class="required" for="from">Start date: </label>
339 <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
340 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
344 <label class="required" for="to">End date: </label>
345 <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
346 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
351 <!-- ############################## -->
352 <label class="required" for="budget_period_description">Description: </label>
353 <input type="text" id="budget_period_description" name="budget_period_description"
354 size="48" maxlength="80" value="[% budget_period_description %]" />
359 <!-- ############################## -->
360 <label for="budget_period_total">Total amount: </label>
361 <input type="text" id="budget_period_total" name="budget_period_total"
362 size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" />
367 <!-- ############################## -->
368 <label for="budget_period_active">Make budget active: </label>
369 [% 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 %]
374 <!-- ############################## -->
375 <label for="budget_period_locked">Lock budget: </label>
376 [% 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 %]
381 <fieldset class="action">
382 <!-- "save changes" button -->
383 <!-- ###################################### -->
384 <input type="button" value="Save changes" onclick="Check(this.form)" />
385 <!-- <input type="submit" value="Save Changes" /> -->
386 [% IF ( budget_period_id ) %]<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>[% END %]
393 <!-- ####################################################################### -->
394 <!-- delete a budget period -->
395 <!-- ####################################################################### -->
397 [% IF ( delete_confirm ) %]
399 <div class="dialog message">
400 <h3>Cannot delete budget</h3>
401 <p><strong>This record is used [% total %] times</strong>
402 . Deletion is not possible.</p>
404 <div class="dialog alert">
405 <h3>Delete budget '[% budget_period_description %]'?</h3>
408 <!-- ############################################################# -->
409 <!-- "delete" and "cancel" buttons -->
410 <!-- ############################################################# -->
412 <form action="[% script_name %]" method="post">
413 <input type="hidden" name="op" value="delete_confirmed" />
414 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
415 <input type="submit" class="approve" value="Delete" />
418 <form action="[% script_name %]" method="post">
419 <input type="submit" class="deny" value="Cancel" />
426 [% IF budget_periods.size == 0 %]
427 You cannot move funds of this budget, there is no active budget.
428 Please create a new active budget and retry.
429 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
430 [% ELSIF number_of_unreceived_orders == 0 %]
431 There are no unreceived orders for this budget.
432 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
434 <h3>The unreceived orders from the following funds will be moved</h3>
435 Fund list of budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>:
442 <th>Unreceived orders</th>
446 [% FOREACH budget IN budgets_to_move %]
448 <td>[% budget.budget_id %]</td>
449 <td>[% budget.budget_code_indent %]</td>
450 <td>[% budget.budget_name %]</td>
451 <td>[% budget.unreceived_orders.size %]</td>
456 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post" id="move_form">
457 <fieldset class="rows">
460 <label class="required" for="to_budget_period_id">Select a budget</label>
461 <select name="to_budget_period_id" id="to_budget_period_id" required="required">
462 <option value=""></option>
463 [% FOR budget_period IN budget_periods %]
464 <option value="[% budget_period.budget_period_id %]">[% budget_period.budget_period_description %]</option>
469 <label for="move_remaining_unspent">Move remaining unspent funds</label>
470 <input type="checkbox" name="move_remaining_unspent" id="move_remaining_unspent" />
474 <fieldset class="action">
475 <input type="hidden" name="op" value="close_confirmed" />
476 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
477 <input type="submit" value="Move unreceived orders" />
478 <a class="cancel" href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Cancel</a>
483 <h3>Report after moving unreceived orders from budget [% from_budget_period.budget_period_description %] ([% from_budget_period.budget_period_startdate | $KohaDates %] - [% from_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>
485 <table id="closed_report">
495 [% FOR r IN report %]
497 [% IF r.orders_moved.size > 0 %]
498 [% FOR order IN r.orders_moved %]
500 <td>[% r.budget.budget_name %] (id=[% r.budget.budget_id %]) Amount=[% r.budget.budget_amount | $Price %][% IF r.unspent_moved %] ([% r.unspent_moved | $Price %] remaining has been moved)[% END %]</td>
501 <td>[% order.basketname %]</td>
502 <td>[% order.ordernumber %]</td>
508 <td>[% r.budget.budget_name %] (id=[% r.budget.budget_id %])</td>
511 <td>There were no unreceived orders for this fund.</td>
515 [% IF r.error == 'budget_code_not_exists' %]
517 <td>[% r.budget.budget_id %] [% r.budget.budget_amount | $Price %][% IF r.unspent_moved %] ([% r.unspent_moved | $Price %] remaining has been moved)[% END %]</td>
520 <td>This fund code does not exist in the destination budget.</td>
528 <a class="cancel" href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
531 <!-- DEFAULT display budget periods list -->
533 <h2>Budgets administration</h2>
535 [% INCLUDE 'budgets-active-currency.inc' %]
537 <div id="budgetsTabs" class="toptabs">
539 <li><a href="#active">Active budgets</a></li>
540 <li><a href="#inactive">Inactive budgets</a></li>
544 [% IF ( period_active_loop ) %]
545 <table id="activeperiodst">
549 <th class="title-string">Start date</th>
550 <th class="title-string">End date</th>
557 [% FOREACH period_active IN period_active_loop %]
559 <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>
560 <td><span title="[% period_active.budget_period_startdate %]">[% period_active.budget_period_startdate | $KohaDates %]</span></td>
561 <td><span title="[% period_active.budget_period_enddate %]">[% period_active.budget_period_enddate | $KohaDates %]</span></td>
563 [% IF ( period_active.budget_period_locked ) %]
564 <span style="color:green;">Locked</span>
567 <td class="data">[% period_active.budget_period_total | $Price %]</td>
569 [% PROCESS action_menu block_budget_id=period_active.budget_period_id %]
578 <div class="paginationBar">[% active_pagination_bar %]</div>
581 [% IF ( period_inactive_loop ) %]
582 <table id="inactiveperiodst">
586 <th class="title-string">Start date</th>
587 <th class="title-string">End date</th>
594 [% FOREACH period_loo IN period_inactive_loop %]
596 <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>
597 <td><span title="[% period_loo.budget_period_startdate %]">[% period_loo.budget_period_startdate | $KohaDates %]</span></td>
598 <td><span title="[% period_loo.budget_period_enddate %]">[% period_loo.budget_period_enddate | $KohaDates %]</span></td>
599 <td> [% IF ( period_loo.budget_period_locked ) %]<span style="color:green;">Locked</span> [% ELSE %][% END %] </td>
600 <td class="data">[% period_loo.budget_period_total | $Price %]</td>
602 [% PROCESS action_menu block_budget_id=period_loo.budget_period_id %]
611 <div class="pages">[% inactive_pagination_bar %]</div>
620 [% INCLUDE 'acquisitions-menu.inc' %]
624 [% INCLUDE 'intranet-bottom.inc' %]