5 [% USE TablesSettings %]
7 [% PROCESS 'i18n.inc' %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>[% FILTER collapse %]
10 [% t("Acquisitions") | html %] ›
11 [% t("Koha") | html %]
13 [% INCLUDE 'doc-head-close.inc' %]
14 [% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %]
17 <body id="acq_acqui-home" class="acq">
18 [% WRAPPER 'header.inc' %]
19 [% INCLUDE 'acquisitions-search.inc' %]
22 [% WRAPPER 'sub-header.inc' %]
23 [% WRAPPER breadcrumbs %]
24 [% WRAPPER breadcrumb_item bc_active= 1 %]
25 <span>Acquisitions</span>
27 [% END #/ WRAPPER breadcrumbs %]
30 <div class="main container-fluid">
32 <div class="col-sm-10 col-sm-push-2">
35 [% INCLUDE 'acquisitions-toolbar.inc' %]
38 [% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %]
39 [% UNLESS ( loop_budget ) %]
40 [% IF ( CAN_user_acquisition_period_manage ) %]
41 <div class="dialog alert"><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">You must define a budget in Administration</a></div>
43 <div class="dialog alert">Your administrator must define a budget in Administration</div>
47 [% IF ( suggestions_count || all_pendingsuggestions ) %]
48 <div class="col-sm-6">
50 <div class="col-sm-12">
52 <div id="acqui_acqui_home_order">
54 <legend>Manage orders</legend>
55 <form name="findsupplier" action="/cgi-bin/koha/acqui/booksellers.pl" method="post">
56 <p><label for="supplierpage">Vendor: </label><input type="text" size="25" name="supplier" id="supplierpage" class="focus" />
57 <input type="submit" class="btn btn-primary" value="Search" />
64 [% IF ( CAN_user_suggestions_suggestions_manage && ( suggestions_count || all_pendingsuggestions ) ) %]
65 <div class="col-sm-6">
66 <div id="acqui_acqui_home_suggestions">
68 <legend>Pending suggestions</legend>
71 <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=[% Branches.GetLoggedInBranchcode | url %]#ASKED">
72 <span id="pendingsuggestions" class="pending-number-link">[% Branches.GetLoggedInBranchname | html %]: [% suggestions_count | html %]</span>
74 [% IF (all_pendingsuggestions > 0) %]
76 <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=__ANY__#ASKED">
77 <span id="all_pendingsuggestions" class="pending-number-link">All libraries: [% all_pendingsuggestions | html %]</span>
88 [% IF ( loop_budget ) %]
90 <div class="page-section">
91 <h3>All available funds</h3>
93 <div id="BudgetsAndFunds">
94 <div class="toolbar btn-toolbar">
95 <span class="actions">
96 <a href="#" id="expand_all">Expand all</a> |
97 <a href="#" id="collapse_all">Collapse all</a> |
98 <a href="#" id="hide_inactive">Hide inactive budgets</a> |
99 <a href="#" id="show_inactive">Show inactive budgets</a> |
100 <select id="library-filter">
101 <option value="">Filter by library</option>
102 [% FOREACH b IN Branches.all %]
103 <option value="[% b.branchname | html %]">[% b.branchname | html %]</option>
108 <table id="accounts">
113 <th>Budget period description</th>
121 <th>Total available</th>
124 <tfoot id="funds_total">
128 <th colspan="4">Total</th>
129 <th class="data"></th>
130 <th class="data"></th>
131 <th class="data"></th>
132 <th class="data"></th>
136 [% FOREACH loop_budge IN loop_budget %]
137 [% IF loop_budge.budget_parent_id %]
138 <tr data-tt-id="[% loop_budge.budget_id | html %]" data-tt-parent-id="[% loop_budge.budget_parent_id | html %]">
140 <tr data-tt-id="[% loop_budge.budget_id | html %]">
143 <td>[% loop_budge.budget_period_active | html %]</td>
144 <td>Budget [% loop_budge.budget_period_description | html %] [id=[% loop_budge.budget_period_id | html %]][% UNLESS loop_budge.budget_period_active %] (inactive)[% END %]</td>
146 [% IF ( CAN_user_acquisition_budget_manage ) %]
147 <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id | uri %]">[% loop_budge.budget_code | html %]</a>
149 [% loop_budge.budget_code | html %]
152 <td>[% loop_budge.budget_name | html %]</td>
153 <td>[% IF ( loop_budge.budget_owner ) %]
154 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loop_budge.budget_owner.borrowernumber | uri %]">[% loop_budge.budget_owner.surname | html %], [% loop_budge.budget_owner.firstname | html %]</a>
159 <td>[% Branches.GetName( loop_budge.budget_branchcode ) | html %]</td>
161 <span class="total_amount" data-parent_id="[% loop_budge.budget_parent_id | html %]" data-self_id="[% loop_budge.budget_id | html %]">[% loop_budge.budget_amount | $Price %]</span>
164 <a href="ordered.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
165 [% IF loop_budge.children.size %]
166 <a title="Ordered from this fund" href="ordered.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
167 (<span class="total_amount">[% loop_budge.budget_ordered | $Price %]</span>)
169 <span title="Ordered from this fund and children" class="inclusive_amount">[% loop_budge.total_ordered | $Price %]</span>
171 <a href="ordered.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
172 <span class="total_amount">[% loop_budge.budget_ordered | $Price %]</span>
177 [% IF loop_budge.children.size %]
178 <a title="Spent from this fund" href="spent.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
179 (<span class="total_amount">[% loop_budge.budget_spent | $Price %]</span>)
181 <span title="Spent from this fund and children" class="inclusive_amount">[% loop_budge.total_spent | $Price %]</span>
183 <a href="spent.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
184 <span class="total_amount">[% loop_budge.budget_spent | $Price %]</span>
189 [% IF loop_budge.children.size %]
190 (<span title="Remaining in this fund" class="parent_amount" data-parent_id="[% loop_budge.budget_parent_id | html %]" data-self_id="[% loop_budge.budget_id | html %]">[% loop_budge.budget_avail | $Price %]</span>)
191 <span title="Remaining with child funds included" class="total_amount" data-parent_id="[% loop_budge.budget_parent_id | html %]" data-self_id="[% loop_budge.budget_id | html %]">[% loop_budge.total_avail | $Price %]</span>
193 <span class="total_amount" data-parent_id="[% loop_budge.budget_parent_id | html %]" data-self_id="[% loop_budge.budget_id | html %]">[% loop_budge.budget_avail | $Price %]</span>
200 </div><!-- /#BudgetsAndFunds -->
201 </div><!-- /.page-section -->
205 </div> <!-- /.col-sm-10.col-sm-push-2 -->
207 <div class="col-sm-2 col-sm-pull-10">
209 [% INCLUDE 'acquisitions-menu.inc' %]
212 </div> <!-- /.row -->
214 [% MACRO jsinclude BLOCK %]
215 [% INCLUDE 'datatables.inc' %]
216 [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
217 [% Asset.js("js/acquisitions-menu.js") | $raw %]
218 [% INCLUDE 'columns_settings.inc' %]
220 dt_overwrite_html_sorting_localeCompare();
222 $(document).ready(function() {
223 var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'acq_acqui-home', 'accounts', 'json' ) | $raw %];
224 var oTable = KohaTable("accounts", {
225 "fnDrawCallback": function ( oSettings ) {
226 if ( oSettings.aiDisplay.length == 0 )
231 var nTrs = $('#accounts tbody tr');
232 var iColspan = nTrs[0].getElementsByTagName('td').length;
234 for ( var i=0 ; i<nTrs.length ; i++ )
236 var iDisplayIndex = oSettings._iDisplayStart + i;
237 var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[1];
238 if ( sGroup != sLastGroup )
240 var nGroup = document.createElement( 'tr' );
241 var nCell = document.createElement( 'td' );
242 nCell.colSpan = iColspan;
243 nCell.className = "group";
244 nCell.innerHTML = sGroup;
245 nGroup.appendChild( nCell );
246 nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
251 "footerCallback": function ( row, data, start, end, display ) {
252 var api = this.api(), data;
253 footer_column_sum( api, [ 6, 7, 8, 9 ] );
256 { "bVisible": false, "aTargets": [ 0, 1 ] },
257 { "bSortable": false, "aTargets": ["_all"] }
260 'aaSortingFixed': [[ 1, 'asc' ]],
265 $(oTable).treetable({
268 $(oTable).treetable('expandAll');
269 $("#expand_all").click(function(e){
271 $(oTable).treetable('expandAll');
273 $("#collapse_all").click(function(e){
275 $(oTable).treetable('collapseAll');
278 $("#hide_inactive").click(function(e){
280 oTable.fnFilter( 1, 0 ); // Show only active=1
282 $("#show_inactive").click(function(e){
284 oTable.fnFilter( '', 0 );
286 $("#hide_inactive").click();
288 $("#library-filter").change(function(){
289 $("#accounts").DataTable().search(this.value);
290 $("#accounts").DataTable().draw();
297 [% INCLUDE 'intranet-bottom.inc' %]