2 [% USE AdditionalContents %]
6 [% USE TablesSettings %]
8 [% PROCESS 'i18n.inc' %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>[% FILTER collapse %]
11 [% t("Acquisitions") | html %] ›
12 [% t("Koha") | html %]
14 [% INCLUDE 'doc-head-close.inc' %]
15 [% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %]
18 <body id="acq_acqui-home" class="acq">
19 [% WRAPPER 'header.inc' %]
20 [% INCLUDE 'acquisitions-search.inc' %]
23 [% WRAPPER 'sub-header.inc' %]
24 [% WRAPPER breadcrumbs %]
25 [% WRAPPER breadcrumb_item bc_active= 1 %]
26 <span>Acquisitions</span>
28 [% END #/ WRAPPER breadcrumbs %]
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" class="btn btn-primary" 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 -->
205 [%- SET StaffAcquisitionsHome = AdditionalContents.get( location => "StaffAcquisitionsHome", lang => lang, library => logged_in_user.branchcode ) -%]
206 [%- FOREACH block IN StaffAcquisitionsHome.content -%]
207 <div class="page-section">
208 [%- block.content | $raw -%]
213 </div> <!-- /.col-sm-10.col-sm-push-2 -->
215 <div class="col-sm-2 col-sm-pull-10">
217 [% INCLUDE 'acquisitions-menu.inc' %]
221 </div> <!-- /.row -->
223 [% MACRO jsinclude BLOCK %]
224 [% INCLUDE 'datatables.inc' %]
225 [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
226 [% Asset.js("js/acquisitions-menu.js") | $raw %]
227 [% INCLUDE 'columns_settings.inc' %]
229 dt_overwrite_html_sorting_localeCompare();
231 $(document).ready(function() {
232 var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'acq_acqui-home', 'accounts', 'json' ) | $raw %];
233 var oTable = KohaTable("accounts", {
234 "drawCallback": function ( oSettings ) {
235 if ( oSettings.aiDisplay.length == 0 )
240 var nTrs = $('#accounts tbody tr');
241 var iColspan = nTrs[0].getElementsByTagName('td').length;
243 for ( var i=0 ; i<nTrs.length ; i++ )
245 var iDisplayIndex = oSettings._iDisplayStart + i;
246 var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[1];
247 if ( sGroup != sLastGroup )
249 var nGroup = document.createElement( 'tr' );
250 var nCell = document.createElement( 'td' );
251 nCell.colSpan = iColspan;
252 nCell.className = "group";
253 nCell.innerHTML = sGroup;
254 nGroup.appendChild( nCell );
255 nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
260 "footerCallback": function ( row, data, start, end, display ) {
261 var api = this.api(), data;
262 footer_column_sum( api, [ 6, 7, 8, 9 ] );
265 { "visible": false, "targets": [ 0, 1 ] },
266 { "orderable": false, "targets": ["_all"] }
269 "orderFixed": [[ 1, 'asc' ]],
274 $(oTable).treetable({
277 $(oTable).treetable('expandAll');
278 $("#expand_all").click(function(e){
280 $(oTable).treetable('expandAll');
282 $("#collapse_all").click(function(e){
284 $(oTable).treetable('collapseAll');
287 $("#hide_inactive").click(function(e){
289 oTable.fnFilter( 1, 0 ); // Show only active=1
291 $("#show_inactive").click(function(e){
293 oTable.fnFilter( '', 0 );
295 $("#hide_inactive").click();
297 $("#library-filter").change(function(){
298 $("#accounts").DataTable().search(this.value);
299 $("#accounts").DataTable().draw();
305 [% INCLUDE 'intranet-bottom.inc' %]