5 [% USE TablesSettings %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Acquisitions › Koha</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %]
13 <body id="acq_acqui-home" class="acq">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'acquisitions-search.inc' %]
17 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
20 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
23 <a href="#" aria-current="page">Acquisitions</a>
28 <div class="main container-fluid">
30 <div class="col-sm-10 col-sm-push-2">
33 [% INCLUDE 'acquisitions-toolbar.inc' %]
36 [% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %]
37 [% UNLESS ( loop_budget ) %]
38 [% IF ( CAN_user_acquisition_period_manage ) %]
39 <div class="dialog alert"><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">You must define a budget in Administration</a></div>
41 <div class="dialog alert">Your administrator must define a budget in Administration</div>
45 [% IF ( suggestions_count || all_pendingsuggestions ) %]
46 <div class="col-sm-6">
48 <div class="col-sm-12">
50 <div id="acqui_acqui_home_order">
52 <legend>Manage orders</legend>
53 <form name="findsupplier" action="/cgi-bin/koha/acqui/booksellers.pl" method="post">
54 <p><label for="supplierpage">Vendor: </label><input type="text" size="25" name="supplier" id="supplierpage" class="focus" />
55 <input type="submit" value="Search" />
62 [% IF ( CAN_user_suggestions_suggestions_manage && ( suggestions_count || all_pendingsuggestions ) ) %]
63 <div class="col-sm-6">
64 <div id="acqui_acqui_home_suggestions">
66 <legend>Pending suggestions</legend>
69 <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=[% Branches.GetLoggedInBranchcode | url %]#ASKED">
70 <span id="pendingsuggestions" class="pending-number-link">[% Branches.GetLoggedInBranchname | html %]: [% suggestions_count | html %]</span>
72 [% IF (all_pendingsuggestions > 0) %]
74 <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=__ANY__#ASKED">
75 <span id="all_pendingsuggestions" class="pending-number-link">All libraries: [% all_pendingsuggestions | html %]</span>
86 [% IF ( loop_budget ) %]
88 <h3>All available funds</h3>
90 <div id="BudgetsAndFunds">
91 <div class="toolbar btn-toolbar">
92 <span class="actions">
93 <a href="#" id="expand_all">Expand all</a> |
94 <a href="#" id="collapse_all">Collapse all</a> |
95 <a href="#" id="hide_inactive">Hide inactive budgets</a> |
96 <a href="#" id="show_inactive">Show inactive budgets</a> |
97 <select id="library-filter">
98 <option value="">Filter by library</option>
99 [% FOREACH b IN Branches.all %]
100 <option value="[% b.branchname | html %]">[% b.branchname | html %]</option>
106 <table id="accounts">
111 <th>Budget period description</th>
119 <th>Total available</th>
122 <tfoot id="funds_total">
126 <th colspan="4">Total</th>
127 <th class="data"></th>
128 <th class="data"></th>
129 <th class="data"></th>
130 <th class="data"></th>
134 [% FOREACH loop_budge IN loop_budget %]
135 [% IF loop_budge.budget_parent_id %]
136 <tr data-tt-id="[% loop_budge.budget_id | html %]" data-tt-parent-id="[% loop_budge.budget_parent_id | html %]">
138 <tr data-tt-id="[% loop_budge.budget_id | html %]">
141 <td>[% loop_budge.budget_period_active | html %]</td>
142 <td>Budget [% loop_budge.budget_period_description | html %] [id=[% loop_budge.budget_period_id | html %]][% UNLESS loop_budge.budget_period_active %] (inactive)[% END %]</td>
144 [% IF ( CAN_user_acquisition_budget_manage ) %]
145 <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id | uri %]">[% loop_budge.budget_code | html %]</a>
147 [% loop_budge.budget_code | html %]
150 <td>[% loop_budge.budget_name | html %]</td>
151 <td>[% IF ( loop_budge.budget_owner ) %]
152 <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>
157 <td>[% Branches.GetName( loop_budge.budget_branchcode ) | html %]</td>
159 <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>
162 <a href="ordered.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
163 [% IF !loop_budge.budget_parent_id %]
164 <a title="Ordered from this fund" href="ordered.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
165 (<span class="total_amount">[% loop_budge.budget_ordered | $Price %]</span>)
167 <span title="Ordered from this fund and children" class="inclusive_amount">[% loop_budge.total_ordered | $Price %]</span>
169 <a href="ordered.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
170 <span class="total_amount">[% loop_budge.budget_ordered | $Price %]</span>
175 [% IF !loop_budge.budget_parent_id %]
176 <a title="Spent from this fund" href="spent.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
177 (<span class="total_amount">[% loop_budge.budget_spent | $Price %]</span>)
179 <span title="Spent from this fund and children" class="inclusive_amount">[% loop_budge.total_spent | $Price %]</span>
181 <a href="spent.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
182 <span class="total_amount">[% loop_budge.budget_spent | $Price %]</span>
187 [% IF !loop_budge.budget_parent_id %]
188 (<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>)
189 <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>
191 <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>
202 </div> <!-- /.col-sm-10.col-sm-push-2 -->
204 <div class="col-sm-2 col-sm-pull-10">
206 [% INCLUDE 'acquisitions-menu.inc' %]
209 </div> <!-- /.row -->
211 [% MACRO jsinclude BLOCK %]
212 [% INCLUDE 'datatables.inc' %]
213 [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
214 [% Asset.js("js/acquisitions-menu.js") | $raw %]
215 [% INCLUDE 'columns_settings.inc' %]
217 dt_overwrite_html_sorting_localeCompare();
219 $(document).ready(function() {
220 var column_settings = [% TablesSettings.GetColumns( 'acqui', 'acq_acqui-home', 'accounts', 'json' ) | $raw %];
221 var oTable = KohaTable("accounts", {
222 "fnDrawCallback": function ( oSettings ) {
223 if ( oSettings.aiDisplay.length == 0 )
228 var nTrs = $('#accounts tbody tr');
229 var iColspan = nTrs[0].getElementsByTagName('td').length;
231 for ( var i=0 ; i<nTrs.length ; i++ )
233 var iDisplayIndex = oSettings._iDisplayStart + i;
234 var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[1];
235 if ( sGroup != sLastGroup )
237 var nGroup = document.createElement( 'tr' );
238 var nCell = document.createElement( 'td' );
239 nCell.colSpan = iColspan;
240 nCell.className = "group";
241 nCell.innerHTML = sGroup;
242 nGroup.appendChild( nCell );
243 nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
248 "footerCallback": function ( row, data, start, end, display ) {
249 var api = this.api(), data;
250 footer_column_sum( api, [ 6, 7, 8, 9 ] );
253 { "bVisible": false, "aTargets": [ 0, 1 ] },
254 { "bSortable": false, "aTargets": ["_all"] }
257 'aaSortingFixed': [[ 1, 'asc' ]],
260 }, column_settings );
262 $(oTable).treetable({
265 $(oTable).treetable('expandAll');
266 $("#expand_all").click(function(e){
268 $(oTable).treetable('expandAll');
270 $("#collapse_all").click(function(e){
272 $(oTable).treetable('collapseAll');
275 $("#hide_inactive").click(function(e){
277 oTable.fnFilter( 1, 0 ); // Show only active=1
279 $("#show_inactive").click(function(e){
281 oTable.fnFilter( '', 0 );
283 $("#hide_inactive").click();
285 $("#library-filter").change(function(){
286 $("#accounts").DataTable().search(this.value);
287 $("#accounts").DataTable().draw();
294 [% INCLUDE 'intranet-bottom.inc' %]