Bug 12164: follow-up: various fixes
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqbudgetperiods.tt
index aae5925..aaf41e1 100644 (file)
@@ -1,9 +1,14 @@
+[% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %]
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
-
+[% INCLUDE 'datatables.inc' %]
+[% IF close_form %]
+    <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" />
+    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script>
+[% END %]
 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/javascript">
 // #################################################################################
 // Javascript
                     alert(alertString2);
             }
     }
-       $(document).ready(function() {
-                $("#periodsh").tablesorter({
-                   widgets : ['zebra'],
-                   sortList: [[0,0]],
-                   headers:  {6:{sorter:false}}
-            });
-       });
+
+    $(document).ready(function() {
+        var tabs = $('#budgetsTabs').tabs();
+        [% IF ( tab ) %]
+            tabs.tabs("option", "active", [% tab %]);
+        [% END %]
+        $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, {
+            "sDom": 't',
+            "aaSorting": [],
+            "aoColumnDefs": [
+                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+                { "sType": "title-string", "aTargets" : [ "title-string" ] }
+            ],
+            "bPaginate": false,
+            'bAutoWidth': false
+        } ) );
+
+        [% IF close_form %]
+          $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
+            sDom: "t"
+          }));
+          $("#move_form").submit(function(){
+            var budget_from = "[% budget_period_description %]";
+            var budget_to = $("#to_budget_period_id").find("option:selected").html();
+            var alert_message = _("You have chosen to move all unreceived orders from '%s' to '%s'.").format(budget_from, budget_to);
+            alert_message += _("\nThis action cannot be reversed. Do you wish to continue?");
+            return confirm ( alert_message );
+          });
+        [% END %]
+        [% IF closed %]
+          var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, {
+            // The following is a c/p from aqbudgets.tt and is a candidate for refactoring.
+            "fnDrawCallback": function ( oSettings ) {
+                if ( oSettings.aiDisplay.length == 0 )
+                {
+                    return;
+                }
+
+                var nTrs = $('#closed_report tbody tr');
+                var iColspan = nTrs[1].getElementsByTagName('td').length;
+                var sLastGroup = "";
+                for ( var i=0 ; i<nTrs.length ; i++ )
+                {
+                    var iDisplayIndex = oSettings._iDisplayStart + i;
+                    var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[0];
+                    if ( sGroup != sLastGroup )
+                    {
+                        var nGroup = document.createElement( 'tr' );
+                        var nCell = document.createElement( 'td' );
+                        nCell.colSpan = iColspan;
+                        nCell.className = "group";
+                        nCell.innerHTML = sGroup;
+                        nGroup.appendChild( nCell );
+                        nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
+                        sLastGroup = sGroup;
+                    }
+                }
+            },
+            "aoColumnDefs": [
+                { "bVisible": false, "aTargets": [ 0, 1 ] },
+                { "bSortable": false, "aTargets": ["_all"] }
+            ],
+            'bSort': true,
+            'aaSortingFixed': [[ 1, 'asc' ]],
+            'bPaginate': false,
+            "bAutoWidth": false
+          }));
+        [% END %]
+    });
 </script>
 
 <title>
             Add budget
         [% END %]
     [% END %]
-
+    [% IF ( duplicate_form ) %]&rsaquo; Duplicate budget[% END %]
     [% IF ( delete_confirm ) %]&rsaquo;
             Delete budget '[% budget_period_description %]'?
     [% END %]
     [% IF ( delete_confirmed ) %]&rsaquo;
         Data deleted
     [% END %]
+    [% IF close_form %]&rsaquo;
+      Close budget [% budget_period_description %]
+    [% END %]
+    [% IF closed %]&rsaquo;
+      Budget [% budget_period_description %] closed
+    [% END %]
 </title>
 
 
             Delete budget '[% budget_period_description %]'?
         [% END %]
     [% END %]
+    <!-- duplicate a budget -->
+    [% IF ( duplicate_form ) %]
+        <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo; Duplicate budget
+    [% END %]
+
+    <!-- close a budget -->
+    [% IF close_form %]
+        <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
+        Close budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>
+    [% END %]
 
+    <!-- budget closed -->
+    [% IF closed %]
+        <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
+        Budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a> closed
+    [% END %]
     <!-- display budget periods list -->
     <!-- ########################################## -->
     [% IF ( else ) %]
 <div id="yui-main">
 <div class="yui-b">
 
-[% INCLUDE 'budgets-admin-toolbar.inc' %]
+[% UNLESS close_form OR closed%]
+  [% INCLUDE 'budgets-admin-toolbar.inc' %]
+[% END %]
 
 [% IF ( duplicate_form ) %]
+<h3>Duplicate budget</h3>
 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
     <fieldset class="rows">
     <input type="hidden" name="op" value="duplicate_budget" />
     <ol>
 
     <li>
-    <label class="required" for="budget_period_startdate">Start date</label>
-    <input type="text" size="10" id="budget_period_startdate" name="budget_period_startdate"   value="[% budget_period_startdate %]"  />
-    <img src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" border="0" id="openCalendarFrom" style="cursor: pointer;" alt="Show start date calendar" />
-    <script type="text/javascript">
-        Calendar.setup({
-        inputField     :    "budget_period_startdate",
-        ifFormat         :    "[% DHTMLcalendar_dateformat %]",
-        button         :    "openCalendarFrom",
-        align          :    "Tl",
-        singleClick    :    false
-        });
-    </script>
+    <label class="required" for="from">Start date: </label>
+    <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
                                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
     </li>
     <li>
 
-    <label class="required" for="budget_period_enddate">End date</label>
-    <input type="text" size="10" id="budget_period_enddate" name="budget_period_enddate" value="[% budget_period_enddate %]" />
-    <img src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" border="0" id="openCalendarTo" style="cursor: pointer;" alt="Show end date calendar" />
-
-    <script type="text/javascript">
-        Calendar.setup({
-        inputField     :    "budget_period_enddate",
-        ifFormat         :    "[% DHTMLcalendar_dateformat %]",
-        button         :    "openCalendarTo",
-        align          :    "Tl"
-        });
-    </script>
+    <label class="required" for="to">End date: </label>
+    <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
                                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
     </li>
 
+    <li>
+      <label for="mark_as_inactive">Mark the original budget as inactive</label>
+      <input type="checkbox" id="mark_as_inactive" name="mark_original_budget_as_inactive" />
+    </li>
+
+    <li>
+      <label for="reset_all_budgets">Set all funds to zero</label>
+      <input type="checkbox" id="reset_all_budgets" name="reset_all_budgets" />
+    </li>
+
     </ol>
     </fieldset>
 
     <fieldset class="action">
-        <input type="button" value="Save Changes"  onclick="CheckDuplicateForm(this.form)"    />
+        <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>
     </fieldset>
 
 </form>
     <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
     <ol>
     <li>
-    <label class="required" for="budget_period_startdate">Start date</label>
-    <input type="text" size="10" id="budget_period_startdate" name="budget_period_startdate"   value="[% budget_period_startdate %]"  />
-    <img src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" border="0" id="openCalendarFrom" style="cursor: pointer;" alt="Show start date calendar" />
-    <script type="text/javascript">
-        Calendar.setup({
-        inputField     :    "budget_period_startdate",
-        ifFormat         :    "[% DHTMLcalendar_dateformat %]",
-        button         :    "openCalendarFrom",
-        align          :    "Tl",
-        singleClick    :    false
-        });
-    </script>
+    <label class="required" for="from">Start date: </label>
+    <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
                                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
     </li>
     <li>
 
-    <label class="required" for="budget_period_enddate">End date</label>
-    <input type="text" size="10" id="budget_period_enddate" name="budget_period_enddate" value="[% budget_period_enddate %]" />
-    <img src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" border="0" id="openCalendarTo" style="cursor: pointer;" alt="Show end date calendar" />
-
-    <script type="text/javascript">
-        Calendar.setup({
-        inputField     :    "budget_period_enddate",
-        ifFormat         :    "[% DHTMLcalendar_dateformat %]",
-        button         :    "openCalendarTo",
-        align          :    "Tl"
-        });
-    </script>
+    <label class="required" for="to">End date: </label>
+    <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
                                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
     </li>
 
     <li>
         <!-- DESCRIPTION -->
         <!-- ############################## -->
-        <label class="required" for="budget_period_description">Description</label>
+        <label class="required" for="budget_period_description">Description</label>
         <input type="text" id="budget_period_description" name="budget_period_description"
         size="48" maxlength="80" value="[% budget_period_description %]" />
     </li>
     <li>
         <!-- TOTAL -->
         <!-- ############################## -->
-        <label for="budget_period_total">Total amount</label>
+        <label for="budget_period_total">Total amount</label>
         <input type="text" id="budget_period_total" name="budget_period_total"
         size="10" maxlength="80" value="[% budget_period_total %]" />
     </li>
     <li>
         <!-- ACTIVE -->
         <!-- ############################## -->
-        <label for="budget_period_active">Make budget active</label>
+        <label for="budget_period_active">Make budget active</label>
         [% 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 %]
     </li>
 
     <li>
         <!-- LOCK  -->
         <!-- ############################## -->
-        <label for="budget_period_locked">Lock budget</label>
+        <label for="budget_period_locked">Lock budget</label>
         [% 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 %]
     </li>
     </ol>
         <!-- ###################################### -->
         <input type="button" value="Save changes"  onclick="Check(this.form)"    />
         <!--             <input type="submit" value="Save Changes"  />  -->
-        <!--            <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl" class="cancel">Cancel</a> -->
+        [% IF ( budget_period_id ) %]<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>[% END %]
     </fieldset>
 
 </form>
 
     </div>
 [% END %]
-<!--  DEFAULT  display budget periods list -->
-[% IF ( else ) %]
-    <h2>Budgets administration</h2>
 
-    [% INCLUDE 'budgets-active-currency.inc' %]
+[% IF close_form %]
+  [% IF budget_periods.size == 0 %]
+    You cannot move funds of this budget, there is no active budget.
+    Please create a new active budget and retry.
+    <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
+  [% ELSIF number_of_unreceived_orders == 0 %]
+    There is no unreceived orders for this budget.
+    <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
+  [% ELSE %]
+    <h3>The unreceived orders from the following funds will be moved</h3>
+      Fund list of budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>:
+    <table id="budgeth">
+      <thead>
+        <tr>
+            <th>Fund id</th>
+            <th>Fund code</th>
+            <th>Fund name</th>
+            <th>Unreceived orders</th>
+        </tr>
+      </thead>
+      <tbody>
+        [% FOREACH budget IN budgets_to_move %]
+          <tr>
+            <td>[% budget.budget_id %]</td>
+            <td>[% budget.budget_code_indent %]</td>
+            <td>[% budget.budget_name %]</td>
+            <td>[% budget.unreceived_orders.size %]</td>
+          </tr>
+        [% END %]
+      </tbody>
+    </table>
+    <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post" id="move_form">
+      <fieldset class="rows">
+        <ol>
+          <li>
+            <label class="required" for="to_budget_period_id">Select a budget</label>
+            <select name="to_budget_period_id" id="to_budget_period_id" required="required">
+              <option value=""></option>
+              [% FOR budget_period IN budget_periods %]
+                <option value="[% budget_period.budget_period_id %]">[% budget_period.budget_period_description %]</option>
+              [% END %]
+            </select>
+          </li>
+          <li>
+          <label for="move_remaining_unspent">Move remaining unspent funds</label>
+            <input type="checkbox" name="move_remaining_unspent" id="move_remaining_unspent" />
+          </li>
+        </ol>
+      </fieldset>
+      <fieldset class="action">
+          <input type="hidden" name="op" value="close_confirmed" />
+          <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
+          <input type="submit" value="Move unreceive orders" />
+          <a class="cancel" href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Cancel</a>
+      </fieldset>
+    </form>
+  [% END %]
+[% ELSIF closed %]
+  <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>
 
-    <table id="periodsh">
+  <table id="closed_report">
     <thead>
-           <tr>
-            <th>Budget name</th>
-            <th>Start date</th>
-            <th>End date</th>
-               <th>Active</th>
-               <th>Locked</th>
-               <th>Total</th>
-               <th>Actions</th>
-           </tr>
-       </thead>
-       <tbody>
-           [% FOREACH period_loo IN period_loop %]
-               [% IF ( loop.odd ) %]
-                   <tr>
-               [% ELSE %]
-                   <tr class="highlight">
-               [% END %]
-               <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>
-               <td>[% period_loo.budget_period_startdate %]</td>
-               <td>[% period_loo.budget_period_enddate %]</td>
-               <td>[% IF ( period_loo.budget_period_active ) %]<span style="color:green;">Active</span>&nbsp;[% ELSE %][% END %] </td>
-               <td> [% IF ( period_loo.budget_period_locked ) %]<span style="color:green;">Locked</span>&nbsp;[% ELSE %][% END %] </td>
-               <td align='right'>[% period_loo.budget_period_total %]</td>
-               <td>
-                   <a href="[% period_loo.script_name %]?op=add_form&amp;budget_period_id=[% period_loo.budget_period_id |html %]">Edit</a>
-                   <a href="[% period_loo.script_name %]?op=delete_confirm&amp;budget_period_id=[% period_loo.budget_period_id %]">Delete</a>
-            <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_period_id=[% period_loo.budget_period_id %]">Add fund</a>
-               </td>
-               </tr>
-           [% END %]
-           [% UNLESS ( period_loop ) %]
-       <tr><td colspan="7">No budget</td></tr>
-       [% END %]
+      <tr>
+        <td>Budget id</td>
+        <td>Basket</td>
+        <td>Ordernumber</td>
+        <td>Informations</td>
+      </tr>
+    </thead>
+    <tbody>
+      [% FOR r IN report %]
+          [% IF r.moved %]
+            [% IF r.orders_moved.size > 0 %]
+              [% FOR order IN r.orders_moved %]
+                <tr>
+                  <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>
+                  <td>[% order.basketname %]</td>
+                  <td>[% order.ordernumber %]</td>
+                  <td>Moved!</td>
+                </tr>
+              [% END %]
+            [% ELSE %]
+              <tr>
+                <td>[% r.budget.budget_name %] (id=[% r.budget.budget_id %])</td>
+                <td></td>
+                <td></td>
+                <td>There was no unreceived orders for this fund.</td>
+              </tr>
+            [% END %]
+          [% ELSE %]
+            [% IF r.error == 'budget_code_not_exists' %]
+              <tr>
+                <td>[% r.budget.budget_id %] [% r.budget.budget_amount %][% IF r.unspent_moved %] ([% r.unspent_moved %] remaining has been moved)[% END %]</td>
+                <td></td>
+                <td></td>
+                <td>This fund code does not exist in the destination budget.</td>
+              </tr>
+            [% END %]
+          [% END %]
+        </tr>
+      [% END %]
     </tbody>
-    </table>
-    <div class="pages">[% pagination_bar %]</div>
+  </table>
+  <a class="cancel" href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
+[% END %]
+
+<!--  DEFAULT  display budget periods list -->
+[% IF ( else ) %]
+  <h2>Budgets administration</h2>
+
+  [% INCLUDE 'budgets-active-currency.inc' %]
+
+  <div id="budgetsTabs" class="toptabs">
+    <ul>
+        <li><a href="#active">Active budgets</a></li>
+        <li><a href="#inactive">Inactive budgets</a></li>
+    </ul>
+
+    <div id="active">
+      [% IF ( period_active_loop ) %]
+        <table id="activeperiodst">
+          <thead>
+            <tr>
+              <th>Budget name</th>
+              <th class="title-string">Start date</th>
+              <th class="title-string">End date</th>
+              <th>Locked</th>
+              <th>Total</th>
+              <th>Actions</th>
+            </tr>
+          </thead>
+          <tbody>
+              [% FOREACH period_active IN period_active_loop %]
+                <tr>
+                <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>
+                <td><span title="[% period_active.budget_period_startdate %]">[% period_active.budget_period_startdate | $KohaDates %]</span></td>
+                <td><span title="[% period_active.budget_period_enddate %]">[% period_active.budget_period_enddate | $KohaDates %]</span></td>
+                <td>
+                  [% IF ( period_active.budget_period_locked ) %]
+                    <span style="color:green;">Locked</span>&nbsp;
+                  [% END %]
+                </td>
+                <td class="data">[% period_active.budget_period_total %]</td>
+                <td>
+                  <a href="[% script_name %]?op=add_form&amp;budget_period_id=[% period_active.budget_period_id |html %]">Edit</a>
+                  <a href="[% script_name %]?op=delete_confirm&amp;budget_period_id=[% period_active.budget_period_id %]">Delete</a>
+                  <a href="[% script_name %]?op=duplicate_form&amp;budget_period_id=[% period_active.budget_period_id %]">Duplicate</a>
+                  <a href="[% script_name %]?op=close_form&amp;budget_period_id=[% period_active.budget_period_id %]">Close</a>
+                  <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_period_id=[% period_active.budget_period_id %]">Add fund</a>
+                </td>
+                </tr>
+              [% END %]
+          </tbody>
+        </table>
+      [% ELSE %]
+        No active budgets
+      [% END %]
+      <div class="paginationBar">[% active_pagination_bar %]</div>
+    </div>
+    <div id="inactive">
+      [% IF ( period_inactive_loop ) %]
+        <table id="inactiveperiodst">
+          <thead>
+              <tr>
+                  <th>Budget name</th>
+                  <th class="title-string">Start date</th>
+                  <th class="title-string">End date</th>
+                  <th>Locked</th>
+                  <th>Total</th>
+                  <th>Actions</th>
+              </tr>
+          </thead>
+          <tbody>
+              [% FOREACH period_loo IN period_inactive_loop %]
+                  [% IF ( loop.odd ) %]
+                      <tr>
+                  [% ELSE %]
+                      <tr class="highlight">
+                  [% END %]
+                  <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>
+                  <td><span title="[% period_loo.budget_period_startdate %]">[% period_loo.budget_period_startdate | $KohaDates %]</span></td>
+                  <td><span title="[% period_loo.budget_period_enddate %]">[% period_loo.budget_period_enddate | $KohaDates %]</span></td>
+                  <td> [% IF ( period_loo.budget_period_locked ) %]<span style="color:green;">Locked</span>&nbsp;[% ELSE %][% END %] </td>
+                  <td class="data">[% period_loo.budget_period_total %]</td>
+                  <td>
+                      <a href="[% script_name %]?op=add_form&amp;budget_period_id=[% period_loo.budget_period_id |html %]">Edit</a>
+                      <a href="[% script_name %]?op=delete_confirm&amp;budget_period_id=[% period_loo.budget_period_id %]">Delete</a>
+                      <a href="[% script_name %]?op=duplicate_form&amp;budget_period_id=[% period_loo.budget_period_id %]">Duplicate</a>
+                      <a href="[% script_name %]?op=close_form&amp;budget_period_id=[% period_loo.budget_period_id %]">Close</a>
+                  <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_period_id=[% period_loo.budget_period_id %]">Add fund</a>
+                  </td>
+                  </tr>
+              [% END %]
+          </tbody>
+        </table>
+      [% ELSE %]
+        No inactive budgets
+      [% END %]
+      <div class="pages">[% inactive_pagination_bar %]</div>
+    </div>
+  </div>
 [% END %]