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="fa fa-pencil"></i> Edit</a>
14 <a href="[% script_name %]?op=delete_confirm&budget_period_id=[% block_budget_id %]"><i class="fa fa-remove"></i> Delete</a>
17 <a href="[% script_name %]?op=duplicate_form&budget_period_id=[% block_budget_id %]"><i class="fa fa-copy"></i> Duplicate</a>
20 <a href="[% script_name %]?op=close_form&budget_period_id=[% block_budget_id %]"><i class="fa fa-times-circle"></i> Close</a>
23 <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=[% block_budget_id %]"><i class="fa fa-plus"></i> Add fund</a>
29 [% INCLUDE 'doc-head-open.inc' %]
30 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/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, {
116 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
117 { "sType": "title-string", "aTargets" : [ "title-string" ] }
119 "sPaginationType": "four_button",
124 $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
127 $("#move_form").submit(function(){
128 var budget_from = "[% budget_period_description %]";
129 var budget_to = $("#to_budget_period_id").find("option:selected").html();
130 var alert_message = _("You have chosen to move all unreceived orders from '%s' to '%s'.").format(budget_from, budget_to);
131 alert_message += "\n" + _("This action cannot be reversed. Do you wish to continue?");
132 return confirm ( alert_message );
136 var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, {
137 // The following is a c/p from aqbudgets.tt and is a candidate for refactoring.
138 "fnDrawCallback": function ( oSettings ) {
139 if ( oSettings.aiDisplay.length == 0 )
144 var nTrs = $('#closed_report tbody tr');
145 var iColspan = nTrs[1].getElementsByTagName('td').length;
147 for ( var i=0 ; i<nTrs.length ; i++ )
149 var iDisplayIndex = oSettings._iDisplayStart + i;
150 var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[0];
151 if ( sGroup != sLastGroup )
153 var nGroup = document.createElement( 'tr' );
154 var nCell = document.createElement( 'td' );
155 nCell.colSpan = iColspan;
156 nCell.className = "group";
157 nCell.innerHTML = sGroup;
158 nGroup.appendChild( nCell );
159 nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
165 { "bVisible": false, "aTargets": [ 0, 1 ] },
166 { "bSortable": false, "aTargets": ["_all"] }
169 'aaSortingFixed': [[ 1, 'asc' ]],
171 "sPaginationType": "full_numbers"
178 Koha › Administration › Budgets
180 [% IF ( add_form ) %]›
181 [% IF ( budget_period_id ) %]
182 Modify budget [% budget_period_description %]
187 [% IF ( duplicate_form ) %]› Duplicate budget[% END %]
188 [% IF ( delete_confirm ) %]›
189 Delete budget '[% budget_period_description %]'?
191 [% IF ( delete_confirmed ) %]›
194 [% IF close_form %]›
195 Close budget [% budget_period_description %]
197 [% IF closed %]›
198 Budget [% budget_period_description %] closed
205 <body id="admin_aqbudgetperiods" class="admin">
207 [% INCLUDE 'header.inc' %]
208 [% INCLUDE 'budgets-admin-search.inc' %]
210 <!-- ################################################################################# -->
212 <!-- ################################################################################# -->
214 <div id="breadcrumbs">
215 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
216 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> ›
218 [% IF ( add_form ) %]
219 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
220 [% IF ( budget_period_id ) %]
221 <span>Modify budget '[% budget_period_description %]'</span>
223 <span>Add budget</span>
226 [% IF ( delete_confirm ) %]
227 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
229 <span>Cannot delete budget '[% budget_period_description %]'</span>
231 <span>Delete budget '[% budget_period_description %]'?</span>
234 [% IF ( duplicate_form ) %]
235 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> › Duplicate budget
238 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
239 <span>Close budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a></span>
242 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
243 <span>Budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a> closed</span>
246 <span>Budgets administration</span>
250 <div id="doc3" class="yui-t2">
255 [% UNLESS close_form OR closed%]
256 [% INCLUDE 'budgets-admin-toolbar.inc' %]
259 [% IF ( duplicate_form ) %]
260 <h3>Duplicate budget</h3>
261 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
262 <fieldset class="rows">
263 <input type="hidden" name="op" value="duplicate_budget" />
264 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
269 <label class="required" for="from">Start date: </label>
270 <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
271 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
275 <label class="required" for="to">End date: </label>
276 <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
277 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
281 <label class="required" for="budget_period_description">Description</label>
282 <input type="text" id="budget_period_description" name="budget_period_description" value="[% budgetperiod.budget_period_description %]" />
286 <label for="amount_change_percentage">Change amounts by</label>
287 <input type="text" id="amount_change_percentage" name="amount_change_percentage" /> %
288 <div class="hint">(can be positive or negative)</div>
292 <label for="amount_change_round_increment">If amounts changed, round to a multiple of</label>
293 <input type="text" id="amount_change_round_increment" name="amount_change_round_increment" />
294 <div class="hint">(amounts will be rounded down)</div>
298 <label for="mark_as_inactive">Mark the original budget as inactive</label>
299 <input type="checkbox" id="mark_as_inactive" name="mark_original_budget_as_inactive" />
303 <label for="reset_all_budgets">Set all funds to zero</label>
304 <input type="checkbox" id="reset_all_budgets" name="reset_all_budgets" />
310 <fieldset class="action">
311 <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>
318 [% IF ( add_form ) %]
319 <!-- add or modify a budget period -->
321 [% IF ( budget_period_id ) %]
322 <h3>Modify budget <i>[% budget_period_description %]</i></h3>
326 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
327 <fieldset class="rows">
328 <!-- ################################################################################# -->
329 <!-- display information about the budget period that must be added or modified -->
330 <!-- ################################################################################# -->
331 <input type="hidden" name="op" value="add_validate" />
332 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
335 <label class="required" for="from">Start date: </label>
336 <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
337 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
341 <label class="required" for="to">End date: </label>
342 <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
343 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
348 <!-- ############################## -->
349 <label class="required" for="budget_period_description">Description: </label>
350 <input type="text" id="budget_period_description" name="budget_period_description"
351 size="48" maxlength="80" value="[% budget_period_description %]" />
356 <!-- ############################## -->
357 <label for="budget_period_total">Total amount: </label>
358 <input type="text" id="budget_period_total" name="budget_period_total"
359 size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" />
364 <!-- ############################## -->
365 <label for="budget_period_active">Make budget active: </label>
366 [% 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 %]
371 <!-- ############################## -->
372 <label for="budget_period_locked">Lock budget: </label>
373 [% 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 %]
378 <fieldset class="action">
379 <!-- "save changes" button -->
380 <!-- ###################################### -->
381 <input type="button" value="Save changes" onclick="Check(this.form)" />
382 <!-- <input type="submit" value="Save Changes" /> -->
383 [% IF ( budget_period_id ) %]<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>[% END %]
390 <!-- ####################################################################### -->
391 <!-- delete a budget period -->
392 <!-- ####################################################################### -->
394 [% IF ( delete_confirm ) %]
396 <div class="dialog message">
397 <h3>Cannot delete budget</h3>
398 <p><strong>This record is used [% total %] times</strong>
399 . Deletion is not possible.</p>
401 <div class="dialog alert">
402 <h3>Delete budget '[% budget_period_description %]'?</h3>
405 <!-- ############################################################# -->
406 <!-- "delete" and "cancel" buttons -->
407 <!-- ############################################################# -->
409 <form action="[% script_name %]" method="post">
410 <input type="hidden" name="op" value="delete_confirmed" />
411 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
412 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
414 <form action="[% script_name %]" method="post">
415 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
422 [% IF budget_periods.size == 0 %]
423 You cannot move funds of this budget, there is no active budget.
424 Please create a new active budget and retry.
425 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
426 [% ELSIF number_of_unreceived_orders == 0 %]
427 There are no unreceived orders for this budget.
428 <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
430 <h3>The unreceived orders from the following funds will be moved</h3>
431 Fund list of budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>:
438 <th>Unreceived orders</th>
442 [% FOREACH budget IN budgets_to_move %]
444 <td>[% budget.budget_id %]</td>
445 <td>[% budget.budget_code_indent %]</td>
446 <td>[% budget.budget_name %]</td>
447 <td>[% budget.unreceived_orders.size %]</td>
452 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post" id="move_form">
453 <fieldset class="rows">
456 <label class="required" for="to_budget_period_id">Select a budget</label>
457 <select name="to_budget_period_id" id="to_budget_period_id" required="required">
458 <option value=""></option>
459 [% FOR budget_period IN budget_periods %]
460 <option value="[% budget_period.budget_period_id %]">[% budget_period.budget_period_description %]</option>
465 <label for="move_remaining_unspent">Move remaining unspent funds</label>
466 <input type="checkbox" name="move_remaining_unspent" id="move_remaining_unspent" />
470 <fieldset class="action">
471 <input type="hidden" name="op" value="close_confirmed" />
472 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
473 <input type="submit" value="Move unreceived orders" />
474 <a class="cancel" href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Cancel</a>
479 <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>
481 <table id="closed_report">
491 [% FOR r IN report %]
493 [% IF r.orders_moved.size > 0 %]
494 [% FOR order IN r.orders_moved %]
496 <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>
497 <td>[% order.basketname %]</td>
498 <td>[% order.ordernumber %]</td>
504 <td>[% r.budget.budget_name %] (id=[% r.budget.budget_id %])</td>
507 <td>There were no unreceived orders for this fund.</td>
511 [% IF r.error == 'budget_code_not_exists' %]
513 <td>[% r.budget.budget_id %] [% r.budget.budget_amount | $Price %][% IF r.unspent_moved %] ([% r.unspent_moved | $Price %] remaining has been moved)[% END %]</td>
516 <td>This fund code does not exist in the destination budget.</td>
524 <a class="cancel" href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
527 <!-- DEFAULT display budget periods list -->
529 <h2>Budgets administration</h2>
531 [% INCLUDE 'budgets-active-currency.inc' %]
533 <div id="budgetsTabs" class="toptabs">
535 <li><a href="#active">Active budgets</a></li>
536 <li><a href="#inactive">Inactive budgets</a></li>
540 [% IF ( period_active_loop ) %]
541 <table id="activeperiodst">
545 <th class="title-string">Start date</th>
546 <th class="title-string">End date</th>
553 [% FOREACH period_active IN period_active_loop %]
555 <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>
556 <td><span title="[% period_active.budget_period_startdate %]">[% period_active.budget_period_startdate | $KohaDates %]</span></td>
557 <td><span title="[% period_active.budget_period_enddate %]">[% period_active.budget_period_enddate | $KohaDates %]</span></td>
559 [% IF ( period_active.budget_period_locked ) %]
560 <span style="color:green;">Locked</span>
563 <td class="data">[% period_active.budget_period_total | $Price %]</td>
565 [% PROCESS action_menu block_budget_id=period_active.budget_period_id %]
576 [% IF ( period_inactive_loop ) %]
577 <table id="inactiveperiodst">
581 <th class="title-string">Start date</th>
582 <th class="title-string">End date</th>
589 [% FOREACH period_loo IN period_inactive_loop %]
591 <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>
592 <td><span title="[% period_loo.budget_period_startdate %]">[% period_loo.budget_period_startdate | $KohaDates %]</span></td>
593 <td><span title="[% period_loo.budget_period_enddate %]">[% period_loo.budget_period_enddate | $KohaDates %]</span></td>
594 <td> [% IF ( period_loo.budget_period_locked ) %]<span style="color:green;">Locked</span> [% ELSE %][% END %] </td>
595 <td class="data">[% period_loo.budget_period_total | $Price %]</td>
597 [% PROCESS action_menu block_budget_id=period_loo.budget_period_id %]
614 [% INCLUDE 'acquisitions-menu.inc' %]
618 [% INCLUDE 'intranet-bottom.inc' %]