3 [% USE AuthorisedValues %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Inventory › Tools › Koha</title>
9 [% INCLUDE 'doc-head-close.inc' %]
12 <body id="tools_inventory" class="tools">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'cat-search.inc' %]
16 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
19 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
27 <a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a>
30 <a href="#" aria-current="page">
36 <a href="#" aria-current="page">
44 <div class="main container-fluid">
46 <div class="col-sm-10 col-sm-push-2">
50 [% IF (moddatecount) %]<div class="dialog message">[% moddatecount | html %] items modified : datelastseen set to [% date | $KohaDates %]</div>
51 <div class="dialog alert">Number of potential barcodes read: [% LinesRead | html %]</div>[% END %]
52 [% IF (errorfile) %]<div class="dialog alert">[% errorfile | html %] can't be opened</div>[% END %]
53 [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
54 [% IF (err_length && err_length>1) %]<div class="dialog alert">There were [% err_length | html %] barcodes that were too long.</div>[% END %]
55 [% IF (err_data && err_data==1) %]<div class="dialog alert">There was 1 barcode that contained at least one unprintable character.</div>[% END %]
56 [% 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 %]
57 [% FOREACH error IN errorloop %]
58 <div class="dialog alert">
59 [% error.barcode | html %]
60 [% IF (error.ERR_BARCODE) %]: <span>Barcode not found.</span>[% END %]
61 [% IF (error.ERR_WTHDRAWN) %]: <span>Item withdrawn.</span>[% END %]
62 [% IF (error.ERR_ONLOAN_RET) %]: <span>Item was on loan. It was checked in before being marked as seen.</span>[% END %]
63 [% IF (error.ERR_ONLOAN_NOT_RET) %]: <span>Item was on loan and could not be checked in.</span>[% END %]
68 <form method="post" id="inventory_form" action="/cgi-bin/koha/tools/inventory.pl" enctype="multipart/form-data">
69 <fieldset class="rows">
70 <legend>Use a barcode file</legend>
72 <li><label for="uploadbarcodes">Barcode file: </label> <input type="file" id="uploadbarcodes" name="uploadbarcodes" />
73 <input type="button" id="resetuploadbarcodes" name="resetuploadbarcodes" value="Reset" /></li>
76 <fieldset class="rows">
77 <legend>Or scan items one by one</legend>
80 <label for="barcodelist">Barcode list (one barcode per line): </label>
81 <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
85 <fieldset class="rows">
86 <legend>Parameters</legend>
88 <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="flatpickr" /></li>
89 <li><label for="compareinv2barcd">Compare barcodes list to results: </label><input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" disabled /></li>
90 <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>
91 <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>
94 <fieldset class="rows">
95 <legend>Item location filters</legend>
97 <label for="branch">Location: </label>
98 <input type="radio" name="branch" value="homebranch"> Home library</input>
99 <input type="radio" name="branch" value="holdingbranch"> Current library</input>
101 <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
102 <option value="">All libraries</option>
103 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
106 [% IF (authorised_values) %]
108 <label for="locationloop">Shelving location (items.location) is: </label>
109 <select id="locationloop" name="location">
110 <option value="">Filter location</option>
111 [% FOREACH value IN authorised_values %]
112 [% IF (value.selected) %]
113 <option value="[% value.authorised_value | html %]" selected="selected">[% value.lib | html %]</option>
115 <option value="[% value.authorised_value | html %]">[% value.lib | html %]</option>
120 [% SET ccodes = AuthorisedValues.GetAuthValueDropbox('CCODE') %]
121 [% IF ( ccodes.count > 0 ) %]
123 <label for="ccode">Collection code: </label>
124 <select id="ccodeloop" name="ccode">
125 <option value="">Filter collection</option>
126 [% FOREACH cc IN ccodes %]
127 [% IF (ccode == cc.authorised_value) %]
128 <option value="[% cc.authorised_value | html %]" selected="selected">[% cc.lib | html %]</option>
130 <option value="[% cc.authorised_value | html %]">[% cc.lib | html %]</option>
137 <label for="minlocation">Item call number between: </label>
138 <input type="text" name="minlocation" id="minlocation" value="[% minlocation | html %]" /> (items.itemcallnumber) </li>
139 <li><label for="maxlocation">...and: </label>
140 <input type="text" name="maxlocation" id="maxlocation" value="[% maxlocation | html %]" />
142 <label for="class_source">Call number classification scheme</label>
143 <select name="class_source">
144 [% FOREACH class_source IN class_sources %]
145 [% IF class_source.cn_source == pref_class %]
146 <option value="[% class_source.cn_source | html %]" selected="selected">[% class_source.description | html %] (default)</option>
148 <option value="[% class_source.cn_source | html %]">[% class_source.description | html %]</option>
156 <fieldset class="rows" id="optionalfilters">
157 <legend>Optional filters for inventory list or comparing barcodes</legend>
159 <div id="statuses" style="display: block;">
160 [% FOREACH status IN statuses %]
161 [% IF (status.values) %]
162 <fieldset style="float: left; padding: 5px; margin: 5px;text-align:right">
163 <legend>[% status.fieldname | html %]</legend>
164 <ul id="statuses-[% fieldname | html %]" style="display: inline;">
165 [% FOREACH value IN status.values %]
168 <label for="[% value.id | html %]">
169 [% IF ( status.fieldname == 'items.notforloan' && value.authorised_value == 0 && value.lib == '__IGNORE__' ) %]
172 [% value.lib | html %]
175 <input type="checkbox" name="status-[% status.fieldname | html %]-[% value.authorised_value | html %]" id="[% value.authorised_value | html %]" />
187 <label for="datelastseen">Last inventory date:</label>
188 <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates %]" class="flatpickr" />
189 (Skip records marked as seen on or after this date.)
192 <label for="ignoreissued">Skip items on loan: </label>
193 [% IF (ignoreissued) %]
194 <input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" />
196 <input type="checkbox" id="ignoreissued" name="ignoreissued" />
200 <label for="ignore_waiting_holds">Skip items on hold awaiting pickup: </label>
201 <input type="checkbox" id="ignore_waiting_holds" name="ignore_waiting_holds" />
204 <label>Item types: </label>
205 <div class="branchselector">
206 <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>
207 <div class="branchgridrow">
208 [% FOREACH itemtype IN itemtypes %]
209 <div class="branchgriditem">
210 <input id="itemtype-[% itemtype.itemtype | html %]" class="branch_select" type="checkbox" name="itemtype-[% itemtype.itemtype | html %]" value="[% itemtype.itemtype | html %]" />
211 <label for="itemtype-[% itemtype.itemtype | html %]">[% itemtype.description | html %]</label>
213 [% IF loop.count() % 4 == 0 && !loop.last() %]
215 <div class="branchgridrow">
226 <fieldset class="rows">
227 <legend>Additional options</legend>
231 <label for="CSVexport">Export to CSV file: </label>
232 <input type="checkbox" name="CSVexport" id="CSVexport" />
236 <input type="hidden" name="op" value="do_it" />
238 <fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
243 <form method="post" action="/cgi-bin/koha/tools/inventory.pl">
244 <input type="hidden" name="minlocation" value="[% minlocation | html %]" />
245 <input type="hidden" name="maxlocation" value="[% maxlocation | html %]" />
246 <input type="hidden" name="location" value="[% location | html %]" />
247 <input type="hidden" name="branchcode" value="[% branchcode | html %]" />
248 <input type="hidden" name="datelastseen" value="[% datelastseen | html %]" />
249 <input type="hidden" name="ccode" value="[% ccode | html %]" />
251 [% UNLESS uploadedbarcodesflag %]
252 <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>
255 <table id="inventoryt">
258 [% UNLESS uploadedbarcodesflag %]<th>Seen</th>[% END %]
262 <th>Collection code</th>
263 <th class="anti-the">Title</th>
264 <th>Not for loan</th>
273 [% FOREACH result IN loop %]
275 [% UNLESS uploadedbarcodesflag %]
277 <input type="checkbox" name="SEEN-[% result.itemnumber | html %]" value="1" />
281 [% result.barcode | html %]
283 <td data-order="[% result.cn_sort | html %]">
284 [% result.itemcallnumber | html %]
287 [% Branches.GetName( result.homebranch ) | html %]
288 <span class="shelvingloc">[% result.location | html %]</span>
291 <span class="ccode">[% result.ccode | html %]</span>
294 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% result.biblionumber | uri %]" class="openWin">[% result.title | html %]</a>
295 [% IF ( result.author ) %]
296 by <span class="author">[% result.author | html %]</span>
300 [% result.notforloan | html %]
303 [% result.itemlost | html %]
306 [% result.damaged | html %]
309 [% result.withdrawn | html %]
311 <td data-order="[% result.datelastseen | html %]">
312 [% result.datelastseen | $KohaDates%]
315 [% FOREACH problem IN result.problems %]
316 [% IF problem.key == 'wrongplace' %]
317 <span>Found in wrong place</span><br/>
318 [% ELSIF problem.key == 'changestatus' %]
319 <span>Unknown not-for-loan status</span><br/>
320 [% ELSIF problem.key == 'not_scanned' %]
321 <span>Missing (not scanned)</span><br/>
322 [% ELSIF problem.key == 'checkedout' %]
323 <span>Still checked out</span><br/>
324 [% ELSIF problem.key == 'no_barcode' %]
325 <span>No barcode</span><br/>
326 [% ELSIF problem.key == 'out_of_order' %]
327 <span>Item may be shelved out of order</span><br/>
335 <div class="spacer"></div>
336 [% UNLESS uploadedbarcodesflag %]
337 <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>
338 <input type="submit" id="markseenandquit" value="Mark seen and quit" />
339 <input type="submit" value="Mark seen and continue >>" id="markseenandcontinuebutton" />
340 <input type="submit" value="Continue without marking >>" id="continuewithoutmarkingbutton" class="submit" />
348 </div> <!-- /.col-sm-10.col-sm-push-2 -->
350 <div class="col-sm-2 col-sm-pull-10">
352 [% INCLUDE 'tools-menu.inc' %]
354 </div> <!-- .col-sm-2.col-sm-pull-10 -->
355 </div> <!-- /.row -->
357 [% MACRO jsinclude BLOCK %]
358 [% Asset.js("js/tools-menu.js") | $raw %]
359 [% INCLUDE 'datatables.inc' %]
360 [% INCLUDE 'calendar.inc' %]
362 function checkForm() {
363 if ( $('#uploadbarcodes').val() && $('#barcodelist').val() ) {
364 alert(_("You have uploaded a barcode file and scanned barcodes at the same time. Please choose one of the two options."));
367 if ( $('#uploadbarcodes').val() || $('#barcodelist').val() ) {
369 $('#branchloop').val() ||
370 $('#locationloop').val() ||
371 $('#minlocation').val() ||
372 $('#maxlocation').val() ||
373 $('#statuses input:checked').length
376 _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
377 _("For large catalogs this can result in unexpected behavior") + "\n\n" +
378 _("Are you sure you want to do this?")
386 function barcodesProvided() {
387 if( $("#uploadbarcodes").val() || $("#barcodelist").val() ) {
388 $("#setdate").prop('disabled',false);
389 $("#compareinv2barcd").prop('disabled',false);
390 $("#compareinv2barcd").attr('checked',true); // default
391 $("#dont_checkin").prop('disabled',false);
392 $("#out_of_order").prop('disabled',false);
393 if( $("#compareinv2barcd").attr('checked') ) {
394 $("fieldset#optionalfilters").show();
395 $("#ignoreissued").attr('checked',true); // default
397 $("fieldset#optionalfilters").hide();
398 $("#ignoreissued").attr('checked',false);
401 $("#setdate").prop('disabled',true);
402 $("#compareinv2barcd").prop('disabled',true);
403 $("#compareinv2barcd").attr('checked',false);
404 $("#dont_checkin").prop('disabled',true);
405 $("#dont_checkin").attr('checked',false);
406 $("#out_of_order").prop('disabled',true);
407 $("#out_of_order").attr('checked',false);
408 $("fieldset#optionalfilters").show();
412 $(document).ready(function(){
413 inventorydt = $('#inventoryt').dataTable($.extend(true, {}, dataTablesDefaults, {
414 'sPaginationType': 'full_numbers',
415 [% IF compareinv2barcd %]
416 // sort on callnumber
417 "aaSorting": [[ 1, "asc" ]],
419 // first column contains checkboxes
421 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
422 { "bSortable": false, "bSearchable": false, "aTargets": [ 0 ] }
424 // 3rd column is callnumber
425 "aaSorting": [[ 2, "asc" ]],
427 'fnDrawCallback': function() {
428 //bind the click handler script to the newly created elements held in the table
429 $('.openWin').bind('click',function(e){
431 openWindow(this.href,'marcview',800,600);
437 $("#continuewithoutmarkingbutton").click(function(){
438 inventorydt.fnPageChange( 'next' );
442 $("#markseenandcontinuebutton").click(function(){
444 $("input:checked").each(function() {
445 param += "|" + $(this).attr('name');
447 $.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param });
448 inventorydt.fnPageChange( 'next' );
452 $("#markseenandquit").click(function(){
454 $("input:checked").each(function() {
455 param += "|" + $(this).attr('name');
459 url: '/cgi-bin/koha/tools/ajax-inventory.pl',
460 data: { seen: param},
463 document.location.href = '/cgi-bin/koha/tools/inventory.pl';
467 $(".checkall").click(function(e){
469 $("#inventoryt input:checkbox").each(function(){
470 $(this).prop("checked", true);
473 $(".clearall").click(function(e){
475 $("#inventoryt input:checkbox").each(function(){
476 $(this).prop("checked", false);
479 $("#inventory_form").on("submit",function(){
483 $("#resetuploadbarcodes").click(function() {
484 $("#uploadbarcodes").val("");
488 // #uploadbarcodes and #compareinv2barcd determine the behavior of
489 // the controls within the barcode fieldset and the optional filters
490 $("#uploadbarcodes").change(barcodesProvided);
491 $("#barcodelist").on("change keyup paste", barcodesProvided);
493 $("#compareinv2barcd").click(function() {
494 if( $("#compareinv2barcd").attr('checked') ) {
495 $("fieldset#optionalfilters").show();
496 $("#ignoreissued").attr('checked',true); // default
498 $("#ignoreissued").attr('checked',false);
499 $("fieldset#optionalfilters").hide();
503 $("#checkallitemtypes").on("click",function(e){
505 $(".branch_select").prop("checked",1);
507 $("#checknoneitemtypes").on("click",function(e){
509 $(".branch_select").prop("checked",0);
515 [% INCLUDE 'intranet-bottom.inc' %]