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 [% WRAPPER 'header.inc' %]
15 [% INCLUDE 'acquisitions-search.inc' %]
18 [% WRAPPER 'sub-header.inc' %]
19 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
22 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
25 <a href="#" aria-current="page">Acquisitions</a>
31 <div class="main container-fluid">
33 <div class="col-sm-10 col-sm-push-2">
36 [% INCLUDE 'acquisitions-toolbar.inc' %]
39 [% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %]
40 [% UNLESS ( loop_budget ) %]
41 [% IF ( CAN_user_acquisition_period_manage ) %]
42 <div class="dialog alert"><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">You must define a budget in Administration</a></div>
44 <div class="dialog alert">Your administrator must define a budget in Administration</div>
48 [% IF ( suggestions_count || all_pendingsuggestions ) %]
49 <div class="col-sm-6">
51 <div class="col-sm-12">
53 <div id="acqui_acqui_home_order">
55 <legend>Manage orders</legend>
56 <form name="findsupplier" action="/cgi-bin/koha/acqui/booksellers.pl" method="post">
57 <p><label for="supplierpage">Vendor: </label><input type="text" size="25" name="supplier" id="supplierpage" class="focus" />
58 <input type="submit" value="Search" />
65 [% IF ( CAN_user_suggestions_suggestions_manage && ( suggestions_count || all_pendingsuggestions ) ) %]
66 <div class="col-sm-6">
67 <div id="acqui_acqui_home_suggestions">
69 <legend>Pending suggestions</legend>
72 <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=[% Branches.GetLoggedInBranchcode | url %]#ASKED">
73 <span id="pendingsuggestions" class="pending-number-link">[% Branches.GetLoggedInBranchname | html %]: [% suggestions_count | html %]</span>
75 [% IF (all_pendingsuggestions > 0) %]
77 <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=__ANY__#ASKED">
78 <span id="all_pendingsuggestions" class="pending-number-link">All libraries: [% all_pendingsuggestions | html %]</span>
89 [% IF ( loop_budget ) %]
91 <div class="page-section">
92 <h3>All available funds</h3>
94 <div id="BudgetsAndFunds">
95 <div class="toolbar btn-toolbar">
96 <span class="actions">
97 <a href="#" id="expand_all">Expand all</a> |
98 <a href="#" id="collapse_all">Collapse all</a> |
99 <a href="#" id="hide_inactive">Hide inactive budgets</a> |
100 <a href="#" id="show_inactive">Show inactive budgets</a> |
101 <select id="library-filter">
102 <option value="">Filter by library</option>
103 [% FOREACH b IN Branches.all %]
104 <option value="[% b.branchname | html %]">[% b.branchname | html %]</option>
109 <table id="accounts">
114 <th>Budget period description</th>
122 <th>Total available</th>
125 <tfoot id="funds_total">
129 <th colspan="4">Total</th>
130 <th class="data"></th>
131 <th class="data"></th>
132 <th class="data"></th>
133 <th class="data"></th>
137 [% FOREACH loop_budge IN loop_budget %]
138 [% IF loop_budge.budget_parent_id %]
139 <tr data-tt-id="[% loop_budge.budget_id | html %]" data-tt-parent-id="[% loop_budge.budget_parent_id | html %]">
141 <tr data-tt-id="[% loop_budge.budget_id | html %]">
144 <td>[% loop_budge.budget_period_active | html %]</td>
145 <td>Budget [% loop_budge.budget_period_description | html %] [id=[% loop_budge.budget_period_id | html %]][% UNLESS loop_budge.budget_period_active %] (inactive)[% END %]</td>
147 [% IF ( CAN_user_acquisition_budget_manage ) %]
148 <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id | uri %]">[% loop_budge.budget_code | html %]</a>
150 [% loop_budge.budget_code | html %]
153 <td>[% loop_budge.budget_name | html %]</td>
154 <td>[% IF ( loop_budge.budget_owner ) %]
155 <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>
160 <td>[% Branches.GetName( loop_budge.budget_branchcode ) | html %]</td>
162 <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>
165 <a href="ordered.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
166 [% IF loop_budge.children.size %]
167 <a title="Ordered from this fund" href="ordered.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
168 (<span class="total_amount">[% loop_budge.budget_ordered | $Price %]</span>)
170 <span title="Ordered from this fund and children" class="inclusive_amount">[% loop_budge.total_ordered | $Price %]</span>
172 <a href="ordered.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
173 <span class="total_amount">[% loop_budge.budget_ordered | $Price %]</span>
178 [% IF loop_budge.children.size %]
179 <a title="Spent from this fund" href="spent.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
180 (<span class="total_amount">[% loop_budge.budget_spent | $Price %]</span>)
182 <span title="Spent from this fund and children" class="inclusive_amount">[% loop_budge.total_spent | $Price %]</span>
184 <a href="spent.pl?fund=[% loop_budge.budget_id | uri %]&fund_code=[% loop_budge.budget_code | uri %]">
185 <span class="total_amount">[% loop_budge.budget_spent | $Price %]</span>
190 [% IF loop_budge.children.size %]
191 (<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>)
192 <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>
194 <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>
201 </div><!-- /#BudgetsAndFunds -->
202 </div><!-- /.page-section -->
206 </div> <!-- /.col-sm-10.col-sm-push-2 -->
208 <div class="col-sm-2 col-sm-pull-10">
210 [% INCLUDE 'acquisitions-menu.inc' %]
213 </div> <!-- /.row -->
215 [% MACRO jsinclude BLOCK %]
216 [% INCLUDE 'datatables.inc' %]
217 [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
218 [% Asset.js("js/acquisitions-menu.js") | $raw %]
219 [% INCLUDE 'columns_settings.inc' %]
221 dt_overwrite_html_sorting_localeCompare();
223 $(document).ready(function() {
224 var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'acq_acqui-home', 'accounts', 'json' ) | $raw %];
225 var oTable = KohaTable("accounts", {
226 "fnDrawCallback": function ( oSettings ) {
227 if ( oSettings.aiDisplay.length == 0 )
232 var nTrs = $('#accounts tbody tr');
233 var iColspan = nTrs[0].getElementsByTagName('td').length;
235 for ( var i=0 ; i<nTrs.length ; i++ )
237 var iDisplayIndex = oSettings._iDisplayStart + i;
238 var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[1];
239 if ( sGroup != sLastGroup )
241 var nGroup = document.createElement( 'tr' );
242 var nCell = document.createElement( 'td' );
243 nCell.colSpan = iColspan;
244 nCell.className = "group";
245 nCell.innerHTML = sGroup;
246 nGroup.appendChild( nCell );
247 nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
252 "footerCallback": function ( row, data, start, end, display ) {
253 var api = this.api(), data;
254 footer_column_sum( api, [ 6, 7, 8, 9 ] );
257 { "bVisible": false, "aTargets": [ 0, 1 ] },
258 { "bSortable": false, "aTargets": ["_all"] }
261 'aaSortingFixed': [[ 1, 'asc' ]],
266 $(oTable).treetable({
269 $(oTable).treetable('expandAll');
270 $("#expand_all").click(function(e){
272 $(oTable).treetable('expandAll');
274 $("#collapse_all").click(function(e){
276 $(oTable).treetable('collapseAll');
279 $("#hide_inactive").click(function(e){
281 oTable.fnFilter( 1, 0 ); // Show only active=1
283 $("#show_inactive").click(function(e){
285 oTable.fnFilter( '', 0 );
287 $("#hide_inactive").click();
289 $("#library-filter").change(function(){
290 $("#accounts").DataTable().search(this.value);
291 $("#accounts").DataTable().draw();
298 [% INCLUDE 'intranet-bottom.inc' %]