3 [% USE AuthorisedValues %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Inventory › Cataloging › Koha</title>
9 [% INCLUDE 'doc-head-close.inc' %]
12 <body id="tools_inventory" class="tools">
13 [% WRAPPER 'header.inc' %]
14 [% INCLUDE 'cat-search.inc' %]
17 [% WRAPPER 'sub-header.inc' %]
18 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
21 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
24 <a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a>
29 <a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a>
32 <a href="#" aria-current="page">
38 <a href="#" aria-current="page">
47 <div class="main container-fluid">
49 <div class="col-sm-10 col-sm-push-2">
53 [% IF (moddatecount) %]<div class="dialog message">[% moddatecount | html %] items modified : datelastseen set to [% date | $KohaDates %]</div>
54 <div class="dialog alert">Number of potential barcodes read: [% LinesRead | html %]</div>[% END %]
55 [% IF (errorfile) %]<div class="dialog alert">[% errorfile | html %] can't be opened</div>[% END %]
56 [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
57 [% IF (err_length && err_length>1) %]<div class="dialog alert">There were [% err_length | html %] barcodes that were too long.</div>[% END %]
58 [% IF (err_data && err_data==1) %]<div class="dialog alert">There was 1 barcode that contained at least one unprintable character.</div>[% END %]
59 [% 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 %]
60 [% FOREACH error IN errorloop %]
61 <div class="dialog alert">
62 [% error.barcode | html %]
63 [% IF (error.ERR_BARCODE) %]: <span>Barcode not found.</span>[% END %]
64 [% IF (error.ERR_WTHDRAWN) %]: <span>Item withdrawn.</span>[% END %]
65 [% IF (error.ERR_ONLOAN_RET) %]: <span>Item was on loan. It was checked in before being marked as seen.</span>[% END %]
66 [% IF (error.ERR_ONLOAN_NOT_RET) %]: <span>Item was on loan and could not be checked in.</span>[% END %]
71 <form method="post" id="inventory_form" action="/cgi-bin/koha/tools/inventory.pl" enctype="multipart/form-data">
72 <fieldset class="rows">
73 <legend>Use a barcode file</legend>
75 <li><label for="uploadbarcodes">Barcode file: </label> <input type="file" id="uploadbarcodes" name="uploadbarcodes" />
76 <input type="button" id="resetuploadbarcodes" name="resetuploadbarcodes" value="Reset" /></li>
79 <fieldset class="rows">
80 <legend>Or scan items one by one</legend>
83 <label for="barcodelist">Barcode list (one barcode per line): </label>
84 <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
88 <fieldset class="rows">
89 <legend>Parameters</legend>
91 <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | html %]" class="flatpickr" /></li>
92 <li><label for="compareinv2barcd">Compare barcodes list to results: </label><input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" disabled /></li>
93 <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>
94 <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>
97 <fieldset class="rows">
98 <legend>Item location filters</legend>
100 <label for="branch">Location: </label>
101 <input type="radio" name="branch" value="homebranch"> Home library</input>
102 <input type="radio" name="branch" value="holdingbranch"> Current library</input>
104 <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
105 <option value="">All libraries</option>
106 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
109 [% IF (authorised_values) %]
111 <label for="locationloop">Shelving location (items.location) is: </label>
112 <select id="locationloop" name="location">
113 <option value="">Filter location</option>
114 [% FOREACH value IN authorised_values %]
115 [% IF (value.selected) %]
116 <option value="[% value.authorised_value | html %]" selected="selected">[% value.lib | html %]</option>
118 <option value="[% value.authorised_value | html %]">[% value.lib | html %]</option>
123 [% SET ccodes = AuthorisedValues.GetAuthValueDropbox('CCODE') %]
124 [% IF ( ccodes.count > 0 ) %]
126 <label for="ccode">Collection code: </label>
127 <select id="ccodeloop" name="ccode">
128 <option value="">Filter collection</option>
129 [% FOREACH cc IN ccodes %]
130 [% IF (ccode == cc.authorised_value) %]
131 <option value="[% cc.authorised_value | html %]" selected="selected">[% cc.lib | html %]</option>
133 <option value="[% cc.authorised_value | html %]">[% cc.lib | html %]</option>
140 <label for="minlocation">Item call number between: </label>
141 <input type="text" name="minlocation" id="minlocation" value="[% minlocation | html %]" /> (items.itemcallnumber) </li>
142 <li><label for="maxlocation">...and: </label>
143 <input type="text" name="maxlocation" id="maxlocation" value="[% maxlocation | html %]" />
145 <label for="class_source">Call number classification scheme</label>
146 <select name="class_source">
147 [% FOREACH class_source IN class_sources %]
148 [% IF class_source.cn_source == pref_class %]
149 <option value="[% class_source.cn_source | html %]" selected="selected">[% class_source.description | html %] (default)</option>
151 <option value="[% class_source.cn_source | html %]">[% class_source.description | html %]</option>
159 <fieldset class="rows" id="optionalfilters">
160 <legend>Optional filters for inventory list or comparing barcodes</legend>
162 <div id="statuses" style="display: block;">
163 [% FOREACH status IN statuses %]
164 [% IF (status.values) %]
165 <fieldset style="float: left; padding: 5px; margin: 5px;text-align:right">
166 <legend>[% status.fieldname | html %]</legend>
167 <ul id="statuses-[% fieldname | html %]" style="display: inline;">
168 [% FOREACH value IN status.values %]
171 <label for="[% value.id | html %]">
172 [% IF ( status.fieldname == 'items.notforloan' && value.authorised_value == 0 && value.lib == '__IGNORE__' ) %]
175 [% value.lib | html %]
178 <input type="checkbox" name="status-[% status.fieldname | html %]-[% value.authorised_value | html %]" id="[% value.authorised_value | html %]" />
190 <label for="datelastseen">Last inventory date:</label>
191 <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | html %]" class="flatpickr" />
192 (Skip records marked as seen on or after this date.)
195 <label for="ignoreissued">Skip items on loan: </label>
196 [% IF (ignoreissued) %]
197 <input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" />
199 <input type="checkbox" id="ignoreissued" name="ignoreissued" />
203 <label for="ignore_waiting_holds">Skip items on hold awaiting pickup: </label>
204 <input type="checkbox" id="ignore_waiting_holds" name="ignore_waiting_holds" />
207 <label>Item types: </label>
208 <div class="branchselector">
209 <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>
210 <div class="branchgridrow">
211 [% FOREACH itemtype IN itemtypes %]
212 <div class="branchgriditem">
213 <input id="itemtype-[% itemtype.itemtype | html %]" class="branch_select" type="checkbox" name="itemtype-[% itemtype.itemtype | html %]" value="[% itemtype.itemtype | html %]" />
214 <label for="itemtype-[% itemtype.itemtype | html %]">[% itemtype.description | html %]</label>
216 [% IF loop.count() % 4 == 0 && !loop.last() %]
218 <div class="branchgridrow">
229 <fieldset class="rows">
230 <legend>Additional options</legend>
234 <label for="CSVexport">Export to CSV file: </label>
235 <input type="checkbox" name="CSVexport" id="CSVexport" />
239 <input type="hidden" name="op" value="do_it" />
241 <fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
246 <form method="post" action="/cgi-bin/koha/tools/inventory.pl">
247 <input type="hidden" name="minlocation" value="[% minlocation | html %]" />
248 <input type="hidden" name="maxlocation" value="[% maxlocation | html %]" />
249 <input type="hidden" name="location" value="[% location | html %]" />
250 <input type="hidden" name="branchcode" value="[% branchcode | html %]" />
251 <input type="hidden" name="datelastseen" value="[% datelastseen | html %]" />
252 <input type="hidden" name="ccode" value="[% ccode | html %]" />
254 [% UNLESS uploadedbarcodesflag %]
255 <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>
258 <table id="inventoryt">
261 [% UNLESS uploadedbarcodesflag %]<th>Seen</th>[% END %]
265 <th>Collection code</th>
266 <th class="anti-the">Title</th>
267 <th>Not for loan</th>
276 [% FOREACH result IN loop %]
278 [% UNLESS uploadedbarcodesflag %]
280 <input type="checkbox" name="SEEN-[% result.itemnumber | html %]" value="1" />
284 [% result.barcode | html %]
286 <td data-order="[% result.cn_sort | html %]">
287 [% result.itemcallnumber | html %]
290 [% Branches.GetName( result.homebranch ) | html %]
291 <span class="shelvingloc">[% result.location | html %]</span>
294 <span class="ccode">[% result.ccode | html %]</span>
297 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% result.biblionumber | uri %]" class="openWin">[% result.title | html %]</a>
298 [% IF ( result.author ) %]
299 by <span class="author">[% result.author | html %]</span>
303 [% result.notforloan | html %]
306 [% result.itemlost | html %]
309 [% result.damaged | html %]
312 [% result.withdrawn | html %]
314 <td data-order="[% result.datelastseen | html %]">
315 [% result.datelastseen | $KohaDates%]
318 [% FOREACH problem IN result.problems %]
319 [% IF problem.key == 'wrongplace' %]
320 <span>Found in wrong place</span><br/>
321 [% ELSIF problem.key == 'changestatus' %]
322 <span>Unknown not-for-loan status</span><br/>
323 [% ELSIF problem.key == 'not_scanned' %]
324 <span>Missing (not scanned)</span><br/>
325 [% ELSIF problem.key == 'checkedout' %]
326 <span>Still checked out</span><br/>
327 [% ELSIF problem.key == 'no_barcode' %]
328 <span>No barcode</span><br/>
329 [% ELSIF problem.key == 'out_of_order' %]
330 <span>Item may be shelved out of order</span><br/>
338 <div class="spacer"></div>
339 [% UNLESS uploadedbarcodesflag %]
340 <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>
341 <input type="submit" id="markseenandquit" value="Mark seen and quit" />
342 <input type="submit" value="Mark seen and continue >>" id="markseenandcontinuebutton" />
343 <input type="submit" value="Continue without marking >>" id="continuewithoutmarkingbutton" class="submit" />
351 </div> <!-- /.col-sm-10.col-sm-push-2 -->
353 <div class="col-sm-2 col-sm-pull-10">
355 [% INCLUDE 'cat-menu.inc' %]
357 </div> <!-- .col-sm-2.col-sm-pull-10 -->
358 </div> <!-- /.row -->
360 [% MACRO jsinclude BLOCK %]
361 [% INCLUDE 'datatables.inc' %]
362 [% INCLUDE 'calendar.inc' %]
364 function checkForm() {
365 if ( $('#uploadbarcodes').val() && $('#barcodelist').val() ) {
366 alert(_("You have uploaded a barcode file and scanned barcodes at the same time. Please choose one of the two options."));
369 if ( $('#uploadbarcodes').val() || $('#barcodelist').val() ) {
371 $('#branchloop').val() ||
372 $('#locationloop').val() ||
373 $('#minlocation').val() ||
374 $('#maxlocation').val() ||
375 $('#statuses input:checked').length
378 _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
379 _("For large catalogs this can result in unexpected behavior") + "\n\n" +
380 _("Are you sure you want to do this?")
388 function barcodesProvided() {
389 if( $("#uploadbarcodes").val() || $("#barcodelist").val() ) {
390 $("#setdate").prop('disabled',false);
391 $("#compareinv2barcd").prop('disabled',false);
392 $("#compareinv2barcd").attr('checked',true); // default
393 $("#dont_checkin").prop('disabled',false);
394 $("#out_of_order").prop('disabled',false);
395 if( $("#compareinv2barcd").attr('checked') ) {
396 $("fieldset#optionalfilters").show();
397 $("#ignoreissued").attr('checked',true); // default
399 $("fieldset#optionalfilters").hide();
400 $("#ignoreissued").attr('checked',false);
403 $("#setdate").prop('disabled',true);
404 $("#compareinv2barcd").prop('disabled',true);
405 $("#compareinv2barcd").attr('checked',false);
406 $("#dont_checkin").prop('disabled',true);
407 $("#dont_checkin").attr('checked',false);
408 $("#out_of_order").prop('disabled',true);
409 $("#out_of_order").attr('checked',false);
410 $("fieldset#optionalfilters").show();
414 $(document).ready(function(){
415 inventorydt = $('#inventoryt').dataTable($.extend(true, {}, dataTablesDefaults, {
416 'sPaginationType': 'full_numbers',
417 [% IF compareinv2barcd %]
418 // sort on callnumber
419 "aaSorting": [[ 1, "asc" ]],
421 // first column contains checkboxes
423 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
424 { "bSortable": false, "bSearchable": false, "aTargets": [ 0 ] }
426 // 3rd column is callnumber
427 "aaSorting": [[ 2, "asc" ]],
429 'fnDrawCallback': function() {
430 //bind the click handler script to the newly created elements held in the table
431 $('.openWin').bind('click',function(e){
433 openWindow(this.href,'marcview',800,600);
439 $("#continuewithoutmarkingbutton").click(function(){
440 inventorydt.fnPageChange( 'next' );
444 $("#markseenandcontinuebutton").click(function(){
446 $("input:checked").each(function() {
447 param += "|" + $(this).attr('name');
449 $.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param });
450 inventorydt.fnPageChange( 'next' );
454 $("#markseenandquit").click(function(){
456 $("input:checked").each(function() {
457 param += "|" + $(this).attr('name');
461 url: '/cgi-bin/koha/tools/ajax-inventory.pl',
462 data: { seen: param},
465 document.location.href = '/cgi-bin/koha/tools/inventory.pl';
469 $(".checkall").click(function(e){
471 $("#inventoryt input:checkbox").each(function(){
472 $(this).prop("checked", true);
475 $(".clearall").click(function(e){
477 $("#inventoryt input:checkbox").each(function(){
478 $(this).prop("checked", false);
481 $("#inventory_form").on("submit",function(){
485 $("#resetuploadbarcodes").click(function() {
486 $("#uploadbarcodes").val("");
490 // #uploadbarcodes and #compareinv2barcd determine the behavior of
491 // the controls within the barcode fieldset and the optional filters
492 $("#uploadbarcodes").change(barcodesProvided);
493 $("#barcodelist").on("change keyup paste", barcodesProvided);
495 $("#compareinv2barcd").click(function() {
496 if( $("#compareinv2barcd").attr('checked') ) {
497 $("fieldset#optionalfilters").show();
498 $("#ignoreissued").attr('checked',true); // default
500 $("#ignoreissued").attr('checked',false);
501 $("fieldset#optionalfilters").hide();
505 $("#checkallitemtypes").on("click",function(e){
507 $(".branch_select").prop("checked",1);
509 $("#checknoneitemtypes").on("click",function(e){
511 $(".branch_select").prop("checked",0);
517 [% INCLUDE 'intranet-bottom.inc' %]