6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha › Tools › Inventory</title>
8 [% INCLUDE 'doc-head-close.inc' %]
11 <body id="tools_inventory" class="tools">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'cat-search.inc' %]
15 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
18 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
21 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
26 <a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a>
29 <a href="#" aria-current="page">
35 <a href="#" aria-current="page">
43 <div class="main container-fluid">
45 <div class="col-sm-10 col-sm-push-2">
49 [% IF (moddatecount) %]<div class="dialog message">[% moddatecount | html %] items modified : datelastseen set to [% date | $KohaDates %]</div>
50 <div class="dialog alert">Number of potential barcodes read: [% LinesRead | html %]</div>[% END %]
51 [% IF (errorfile) %]<div class="dialog alert">[% errorfile | html %] can't be opened</div>[% END %]
52 [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
53 [% IF (err_length && err_length>1) %]<div class="dialog alert">There were [% err_length | html %] barcodes that were too long.</div>[% END %]
54 [% IF (err_data && err_data==1) %]<div class="dialog alert">There was 1 barcode that contained at least one unprintable character.</div>[% END %]
55 [% IF (err_data && err_data>1) %]<div class="dialog alert">There were [% err_data | html %] barcodes that contained at least one unprintable character.</div>[% END %]
56 [% FOREACH error IN errorloop %]
57 <div class="dialog alert">
58 [% error.barcode | html %]
59 [% IF (error.ERR_BARCODE) %]: barcode not found[% END %]
60 [% IF (error.ERR_WTHDRAWN) %]: item withdrawn[% END %]
61 [% IF (error.ERR_ONLOAN_RET) %]: item was on loan. It was returned before marked as seen[% END %]
62 [% IF (error.ERR_ONLOAN_NOT_RET) %]: item was on loan. couldn't be returned.[% END %]
67 <form method="post" id="inventory_form" action="/cgi-bin/koha/tools/inventory.pl" enctype="multipart/form-data">
68 <fieldset class="rows">
69 <legend>Use a barcode file</legend>
71 <li><label for="uploadbarcodes">Barcode file: </label> <input type="file" id="uploadbarcodes" name="uploadbarcodes" />
72 <input type="button" id="resetuploadbarcodes" name="resetuploadbarcodes" value="Reset" /></li>
75 <fieldset class="rows">
76 <legend>Or scan items one by one</legend>
79 <label for="barcodelist">Barcode list (one barcode per line): </label>
80 <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
84 <fieldset class="rows">
85 <legend>Parameters</legend>
87 <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="datepicker" disabled /></li>
88 <li><label for="compareinv2barcd">Compare barcodes list to results: </label><input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" disabled /></li>
89 <li><label for="dont_checkin">Do not check in items scanned during inventory: </label><input type="checkbox" name="dont_checkin" id="dont_checkin" disabled /></li>
90 <li><label for="out_of_order">Check barcodes list for items shelved out of order: </label><input type="checkbox" name="out_of_order" id="out_of_order" disabled /></li>
93 <fieldset class="rows">
94 <legend>Item location filters</legend>
96 <label for="branch">Location: </label>
97 <input type="radio" name="branch" value="homebranch"> Home library</input>
98 <input type="radio" name="branch" value="holdingbranch"> Current library</input>
100 <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
101 <option value="">All libraries</option>
102 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
105 [% IF (authorised_values) %]
107 <label for="locationloop">Shelving location (items.location) is: </label>
108 <select id="locationloop" name="location">
109 <option value="">Filter location</option>
110 [% FOREACH value IN authorised_values %]
111 [% IF (value.selected) %]
112 <option value="[% value.authorised_value | html %]" selected="selected">[% value.lib | html %]</option>
114 <option value="[% value.authorised_value | html %]">[% value.lib | html %]</option>
120 <label for="minlocation">Item call number between: </label>
121 <input type="text" name="minlocation" id="minlocation" value="[% minlocation | html %]" /> (items.itemcallnumber) </li>
122 <li><label for="maxlocation">...and: </label>
123 <input type="text" name="maxlocation" id="maxlocation" value="[% maxlocation | html %]" />
125 <label for="class_source">Call number classification scheme</label>
126 <select name="class_source">
127 [% FOREACH class_source IN class_sources %]
128 [% IF class_source.cn_source == pref_class %]
129 <option value="[% class_source.cn_source | html %]" selected="selected">[% class_source.description | html %] (default)</option>
131 <option value="[% class_source.cn_source | html %]">[% class_source.description | html %]</option>
139 <fieldset class="rows" id="optionalfilters">
140 <legend>Optional filters for inventory list or comparing barcodes</legend>
142 <div id="statuses" style="display: block;">
143 [% FOREACH status IN statuses %]
144 [% IF (status.values) %]
145 <fieldset style="float: left; padding: 5px; margin: 5px;text-align:right">
146 <legend>[% status.fieldname | html %]</legend>
147 <ul id="statuses-[% fieldname | html %]" style="display: inline;">
148 [% FOREACH value IN status.values %]
151 <label for="[% value.id | html %]">
152 [% IF ( status.fieldname == 'items.notforloan' && value.authorised_value == 0 && value.lib == '__IGNORE__' ) %]
155 [% value.lib | html %]
158 <input type="checkbox" name="status-[% status.fieldname | html %]-[% value.authorised_value | html %]" id="[% value.authorised_value | html %]" />
170 <label for="datelastseen">Last inventory date:</label>
171 <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates %]" class="datepicker" />
172 (Skip records marked as seen on or after this date.)
175 <label for="ignoreissued">Skip items on loan: </label>
176 [% IF (ignoreissued) %]
177 <input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" />
179 <input type="checkbox" id="ignoreissued" name="ignoreissued" />
183 <label for="ignore_waiting_holds">Skip items on hold awaiting pickup: </label>
184 <input type="checkbox" id="ignore_waiting_holds" name="ignore_waiting_holds" />
187 <label>Item types: </label>
188 <div class="branchselector">
189 <p><a href="#" id="checkallitemtypes"> <i class="fa fa-check"></i> Select all</a> | <a href="#" id="checknoneitemtypes"> <i class="fa fa-remove"></i> Clear all</a></p>
190 <div class="branchgridrow">
191 [% FOREACH itemtype IN itemtypes %]
192 <div class="branchgriditem">
193 <input id="itemtype-[% itemtype.itemtype | html %]" class="branch_select" type="checkbox" name="itemtype-[% itemtype.itemtype | html %]" value="[% itemtype.itemtype | html %]" />
194 <label for="itemtype-[% itemtype.itemtype | html %]">[% itemtype.description | html %]</label>
196 [% IF loop.count() % 4 == 0 && !loop.last() %]
198 <div class="branchgridrow">
209 <fieldset class="rows">
210 <legend>Additional options</legend>
214 <label for="CSVexport">Export to CSV file: </label>
215 <input type="checkbox" name="CSVexport" id="CSVexport" />
219 <input type="hidden" name="op" value="do_it" />
221 <fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
226 <form method="post" action="/cgi-bin/koha/tools/inventory.pl">
227 <input type="hidden" name="minlocation" value="[% minlocation | html %]" />
228 <input type="hidden" name="maxlocation" value="[% maxlocation | html %]" />
229 <input type="hidden" name="location" value="[% location | html %]" />
230 <input type="hidden" name="branchcode" value="[% branchcode | html %]" />
231 <input type="hidden" name="datelastseen" value="[% datelastseen | html %]" />
233 [% UNLESS uploadedbarcodesflag %]
234 <div><a href="#" class="checkall"><i class="fa fa-check"></i> Select all</a> <a href="#" class="clearall"><i class="fa fa-remove"></i> Clear all</a></div>
237 <table id="inventoryt">
240 [% UNLESS uploadedbarcodesflag %]<th>Seen</th>[% END %]
244 <th class="anti-the">Title</th>
245 <th>Not for loan</th>
254 [% FOREACH result IN loop %]
256 [% UNLESS uploadedbarcodesflag %]
258 <input type="checkbox" name="SEEN-[% result.itemnumber | html %]" value="1" />
262 [% result.barcode | html %]
264 <td data-order="[% result.cn_sort | html %]">
265 [% result.itemcallnumber | html %]
268 [% Branches.GetName( result.homebranch ) | html %]
269 <span class="shelvingloc">[% result.location | html %]</span>
272 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% result.biblionumber | uri %]" class="openWin">[% result.title | html %]</a>
273 [% IF ( result.author ) %]
274 by <span class="author">[% result.author | html %]</span>
278 [% result.notforloan | html %]
281 [% result.itemlost | html %]
284 [% result.damaged | html %]
287 [% result.withdrawn | html %]
289 <td data-order="[% result.datelastseen | html %]">
290 [% result.datelastseen | $KohaDates%]
293 [% FOREACH problem IN result.problems %]
294 [% IF problem.key == 'wrongplace' %]
295 Found in wrong place<br/>
296 [% ELSIF problem.key == 'changestatus' %]
297 Unknown not-for-loan status<br/>
298 [% ELSIF problem.key == 'not_scanned' %]
299 Missing (not scanned)<br/>
300 [% ELSIF problem.key == 'checkedout' %]
301 Still checked out<br/>
302 [% ELSIF problem.key == 'no_barcode' %]
304 [% ELSIF problem.key == 'out_of_order' %]
305 Item may be shelved out of order<br/>
313 <div class="spacer"></div>
314 [% UNLESS uploadedbarcodesflag %]
315 <div style="padding : .3em 0"><a href="#" class="checkall"><i class="fa fa-check"></i> Select all</a> <a href="#" class="clearall"><i class="fa fa-remove"></i> Clear all</a></div>
316 <input type="submit" id="markseenandquit" value="Mark seen and quit" />
317 <input type="submit" value="Mark seen and continue >>" id="markseenandcontinuebutton" />
318 <input type="submit" value="Continue without marking >>" id="continuewithoutmarkingbutton" class="submit" />
326 </div> <!-- /.col-sm-10.col-sm-push-2 -->
328 <div class="col-sm-2 col-sm-pull-10">
330 [% INCLUDE 'tools-menu.inc' %]
332 </div> <!-- .col-sm-2.col-sm-pull-10 -->
333 </div> <!-- /.row -->
335 [% MACRO jsinclude BLOCK %]
336 [% Asset.js("js/tools-menu.js") | $raw %]
337 [% INCLUDE 'datatables.inc' %]
338 [% INCLUDE 'calendar.inc' %]
340 function checkForm() {
341 if ( $('#uploadbarcodes').val() && $('#barcodelist').val() ) {
342 alert(_("You have uploaded a barcode file and scanned barcodes at the same time. Please choose one of the two options."));
345 if ( $('#uploadbarcodes').val() || $('#barcodelist').val() ) {
347 $('#branchloop').val() ||
348 $('#locationloop').val() ||
349 $('#minlocation').val() ||
350 $('#maxlocation').val() ||
351 $('#statuses input:checked').length
354 _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
355 _("For large catalogs this can result in unexpected behavior") + "\n\n" +
356 _("Are you sure you want to do this?")
364 function barcodesProvided() {
365 if( $("#uploadbarcodes").val() || $("#barcodelist").val() ) {
366 $("#setdate").prop('disabled',false);
367 $("#compareinv2barcd").prop('disabled',false);
368 $("#compareinv2barcd").attr('checked',true); // default
369 $("#dont_checkin").prop('disabled',false);
370 $("#out_of_order").prop('disabled',false);
371 if( $("#compareinv2barcd").attr('checked') ) {
372 $("fieldset#optionalfilters").show();
373 $("#ignoreissued").attr('checked',true); // default
375 $("fieldset#optionalfilters").hide();
376 $("#ignoreissued").attr('checked',false);
379 $("#setdate").prop('disabled',true);
380 $("#compareinv2barcd").prop('disabled',true);
381 $("#compareinv2barcd").attr('checked',false);
382 $("#dont_checkin").prop('disabled',true);
383 $("#dont_checkin").attr('checked',false);
384 $("#out_of_order").prop('disabled',true);
385 $("#out_of_order").attr('checked',false);
386 $("fieldset#optionalfilters").show();
390 $(document).ready(function(){
391 inventorydt = $('#inventoryt').dataTable($.extend(true, {}, dataTablesDefaults, {
392 'sPaginationType': 'full_numbers',
393 [% IF compareinv2barcd %]
394 // sort on callnumber
395 "aaSorting": [[ 1, "asc" ]],
397 // first column contains checkboxes
399 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
400 { "bSortable": false, "bSearchable": false, "aTargets": [ 0 ] }
402 // 3rd column is callnumber
403 "aaSorting": [[ 2, "asc" ]],
405 'fnDrawCallback': function() {
406 //bind the click handler script to the newly created elements held in the table
407 $('.openWin').bind('click',function(e){
409 openWindow(this.href,'marcview',800,600);
415 $("#continuewithoutmarkingbutton").click(function(){
416 inventorydt.fnPageChange( 'next' );
420 $("#markseenandcontinuebutton").click(function(){
422 $("input:checked").each(function() {
423 param += "|" + $(this).attr('name');
425 $.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param });
426 inventorydt.fnPageChange( 'next' );
430 $("#markseenandquit").click(function(){
432 $("input:checked").each(function() {
433 param += "|" + $(this).attr('name');
437 url: '/cgi-bin/koha/tools/ajax-inventory.pl',
438 data: { seen: param},
441 document.location.href = '/cgi-bin/koha/tools/inventory.pl';
445 $(".checkall").click(function(e){
447 $("#inventoryt input:checkbox").each(function(){
448 $(this).prop("checked", true);
451 $(".clearall").click(function(e){
453 $("#inventoryt input:checkbox").each(function(){
454 $(this).prop("checked", false);
457 $("#inventory_form").on("submit",function(){
461 $("#resetuploadbarcodes").click(function() {
462 $("#uploadbarcodes").val("");
466 // #uploadbarcodes and #compareinv2barcd determine the behavior of
467 // the controls within the barcode fieldset and the optional filters
468 $("#uploadbarcodes").change(barcodesProvided);
469 $("#barcodelist").on("change keyup paste", barcodesProvided);
471 $("#compareinv2barcd").click(function() {
472 if( $("#compareinv2barcd").attr('checked') ) {
473 $("fieldset#optionalfilters").show();
474 $("#ignoreissued").attr('checked',true); // default
476 $("#ignoreissued").attr('checked',false);
477 $("fieldset#optionalfilters").hide();
481 $("#checkallitemtypes").on("click",function(e){
483 $(".branch_select").prop("checked",1);
485 $("#checknoneitemtypes").on("click",function(e){
487 $(".branch_select").prop("checked",0);
493 [% INCLUDE 'intranet-bottom.inc' %]