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 [% WRAPPER breadcrumbs %]
19 [% WRAPPER breadcrumb_item %]
20 <a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a>
24 [% WRAPPER breadcrumb_item %]
25 <a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a>
27 [% WRAPPER breadcrumb_item bc_active= 1 %]
31 [% WRAPPER breadcrumb_item bc_active= 1 %]
32 <span>Inventory</span>
35 [% END #/ WRAPPER breadcrumbs %]
36 [% END #/ WRAPPER sub-header.inc %]
38 <div class="main container-fluid">
40 <div class="col-sm-10 col-sm-push-2">
44 [% IF (moddatecount) %]<div class="dialog message">[% moddatecount | html %] items modified : datelastseen set to [% date | $KohaDates with_hours => 1 %]</div>
45 <div class="dialog alert">Number of potential barcodes read: [% LinesRead | html %]</div>[% END %]
46 [% IF (errorfile) %]<div class="dialog alert">[% errorfile | html %] can't be opened</div>[% END %]
47 [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
48 [% IF (err_length && err_length>1) %]<div class="dialog alert">There were [% err_length | html %] barcodes that were too long.</div>[% END %]
49 [% IF (err_data && err_data==1) %]<div class="dialog alert">There was 1 barcode that contained at least one unprintable character.</div>[% END %]
50 [% 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 %]
51 [% FOREACH error IN errorloop %]
52 <div class="dialog alert">
53 [% error.barcode | html %]
54 [% IF (error.ERR_BARCODE) %]: <span>Barcode not found.</span>[% END %]
55 [% IF (error.ERR_WTHDRAWN) %]: <span>Item withdrawn.</span>[% END %]
56 [% IF (error.ERR_ONLOAN_RET) %]: <span>Item was on loan. It was checked in before being marked as seen.</span>[% END %]
57 [% IF (error.ERR_ONLOAN_NOT_RET) %]: <span>Item was on loan and could not be checked in.</span>[% END %]
62 <form method="post" id="inventory_form" action="/cgi-bin/koha/tools/inventory.pl" enctype="multipart/form-data">
63 <fieldset class="rows">
64 <legend>Use a barcode file</legend>
66 <li><label for="uploadbarcodes">Barcode file: </label> <input type="file" id="uploadbarcodes" name="uploadbarcodes" />
67 <input type="button" id="resetuploadbarcodes" name="resetuploadbarcodes" value="Reset" /></li>
70 <fieldset class="rows">
71 <legend>Or scan items one by one</legend>
74 <label for="barcodelist">Barcode list (one barcode per line): </label>
75 <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
79 <fieldset class="rows">
80 <legend>Parameters</legend>
82 <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | html %]" class="flatpickr" /></li>
83 <li><label for="compareinv2barcd">Compare barcodes list to results: </label><input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" disabled /></li>
84 <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>
85 <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>
88 <fieldset class="rows">
89 <legend>Item location filters</legend>
91 <label for="branch">Location: </label>
92 <input type="radio" name="branch" value="homebranch"> Home library</input>
93 <input type="radio" name="branch" value="holdingbranch"> Current library</input>
95 <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
96 <option value="">All libraries</option>
97 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
100 [% IF (authorised_values) %]
102 <label for="locationloop">Shelving location (items.location) is: </label>
103 <select id="locationloop" name="location">
104 <option value="">Filter location</option>
105 [% FOREACH value IN authorised_values %]
106 [% IF (value.selected) %]
107 <option value="[% value.authorised_value | html %]" selected="selected">[% value.lib | html %]</option>
109 <option value="[% value.authorised_value | html %]">[% value.lib | html %]</option>
114 [% SET ccodes = AuthorisedValues.GetAuthValueDropbox('CCODE') %]
115 [% IF ( ccodes.count > 0 ) %]
117 <label for="ccode">Collection code: </label>
118 <select id="ccodeloop" name="ccode">
119 <option value="">Filter collection</option>
120 [% FOREACH cc IN ccodes %]
121 [% IF (ccode == cc.authorised_value) %]
122 <option value="[% cc.authorised_value | html %]" selected="selected">[% cc.lib | html %]</option>
124 <option value="[% cc.authorised_value | html %]">[% cc.lib | html %]</option>
131 <label for="minlocation">Item call number between: </label>
132 <input type="text" name="minlocation" id="minlocation" value="[% minlocation | html %]" /> (items.itemcallnumber) </li>
133 <li><label for="maxlocation">...and: </label>
134 <input type="text" name="maxlocation" id="maxlocation" value="[% maxlocation | html %]" />
136 <label for="class_source">Call number classification scheme</label>
137 <select name="class_source">
138 [% FOREACH class_source IN class_sources %]
139 [% IF class_source.cn_source == pref_class %]
140 <option value="[% class_source.cn_source | html %]" selected="selected">[% class_source.description | html %] (default)</option>
142 <option value="[% class_source.cn_source | html %]">[% class_source.description | html %]</option>
150 <fieldset class="rows" id="optionalfilters">
151 <legend>Optional filters for inventory list or comparing barcodes</legend>
152 <span class="hint">Scanned items are expected to match one of the selected "not for loan" criteria if any are checked.</span>
154 <div id="statuses" style="display: block;">
155 [% FOREACH status IN statuses %]
156 [% IF (status.values) %]
157 <fieldset style="float: left; padding: 5px; margin: 5px;text-align:right">
158 <legend>[% status.fieldname | html %]</legend>
159 <ul id="statuses-[% fieldname | html %]" style="display: inline;">
160 [% FOREACH value IN status.values %]
162 <li style="list-style: none;">
163 <label for="[% value.id | html %]">
164 [% IF ( status.fieldname == 'items.notforloan' && value.authorised_value == 0 && value.lib == '__IGNORE__' ) %]
167 [% value.lib | html %]
170 <input type="checkbox" name="status-[% status.fieldname | html %]-[% value.authorised_value | html %]" id="[% value.authorised_value | html %]" />
182 <label for="datelastseen">Last inventory date:</label>
183 <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | html %]" class="flatpickr" />
184 (Skip records marked as seen on or after this date.)
187 <label for="ignoreissued">Skip items on loan: </label>
188 [% IF (ignoreissued) %]
189 <input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" />
191 <input type="checkbox" id="ignoreissued" name="ignoreissued" />
195 <label for="ignore_waiting_holds">Skip items on hold awaiting pickup: </label>
196 <input type="checkbox" id="ignore_waiting_holds" name="ignore_waiting_holds" />
199 <label>Item types: </label>
200 <div class="branchselector">
201 <p><a href="#" id="checkallitemtypes"> <i class="fa fa-check"></i> Select all</a> | <a href="#" id="checknoneitemtypes"> <i class="fa fa-times"></i> Clear all</a></p>
202 <div class="branchgridrow">
203 [% FOREACH itemtype IN itemtypes %]
204 <div class="branchgriditem">
205 <input id="itemtype-[% itemtype.itemtype | html %]" class="branch_select" type="checkbox" name="itemtype-[% itemtype.itemtype | html %]" value="[% itemtype.itemtype | html %]" />
206 <label for="itemtype-[% itemtype.itemtype | html %]">[% itemtype.description | html %]</label>
208 [% IF loop.count() % 4 == 0 && !loop.last() %]
210 <div class="branchgridrow">
221 <fieldset class="rows">
222 <legend>Additional options</legend>
226 <label for="CSVexport">Export to CSV file: </label>
227 <input type="checkbox" name="CSVexport" id="CSVexport" />
230 <input type="hidden" name="op" value="do_it" />
233 <fieldset class="action"><input type="submit" class="btn btn-primary" value="Submit" /></fieldset>
238 <form method="post" action="/cgi-bin/koha/tools/inventory.pl">
239 <input type="hidden" name="minlocation" value="[% minlocation | html %]" />
240 <input type="hidden" name="maxlocation" value="[% maxlocation | html %]" />
241 <input type="hidden" name="location" value="[% location | html %]" />
242 <input type="hidden" name="branchcode" value="[% branchcode | html %]" />
243 <input type="hidden" name="datelastseen" value="[% datelastseen | html %]" />
244 <input type="hidden" name="ccode" value="[% ccode | html %]" />
246 [% UNLESS uploadedbarcodesflag %]
247 <div><a href="#" class="checkall"><i class="fa fa-check"></i> Select all</a> <a href="#" class="clearall"><i class="fa fa-times"></i> Clear all</a></div>
250 <div class="page-section">
251 <table id="inventoryt">
254 [% UNLESS uploadedbarcodesflag %]<th>Seen</th>[% END %]
258 <th>Collection code</th>
259 <th class="anti-the">Title</th>
260 <th>Not for loan</th>
269 [% FOREACH result IN loop %]
271 [% UNLESS uploadedbarcodesflag %]
273 <input type="checkbox" name="SEEN-[% result.itemnumber | html %]" value="1" />
277 [% result.barcode | html %]
279 <td data-order="[% result.cn_sort | html %]">
280 [% result.itemcallnumber | html %]
283 [% Branches.GetName( result.homebranch ) | html %]
284 <span class="shelvingloc">[% result.location | html %]</span>
287 <span class="ccode">[% result.ccode | html %]</span>
290 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% result.biblionumber | uri %]" class="openWin">[% result.title | html %]</a>
291 [% IF ( result.author ) %]
292 by <span class="author">[% result.author | html %]</span>
296 [% result.notforloan | html %]
299 [% result.itemlost | html %]
302 [% result.damaged | html %]
305 [% result.withdrawn | html %]
307 <td data-order="[% result.datelastseen | html %]">
308 [% result.datelastseen | $KohaDates with_hours => 1 %]
311 [% FOREACH problem IN result.problems %]
312 [% IF problem.key == 'wrongplace' %]
313 <span>Found in wrong place</span><br/>
314 [% ELSIF problem.key == 'changestatus' %]
315 [% IF result.notforloan %]
316 <span>Item has unselected "Not for loan" status "[% result.notforloan | html %]"/span><br/>
318 <span>Items has no "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/>
337 <div class="spacer"></div>
338 [% UNLESS uploadedbarcodesflag %]
339 <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-times"></i> Clear all</a></div>
340 <input type="submit" id="markseenandquit" class="btn btn-primary" value="Mark seen and quit" />
341 <input type="submit" value="Mark seen and continue >>" id="markseenandcontinuebutton" />
342 <input type="submit" value="Continue without marking >>" id="continuewithoutmarkingbutton" class="submit" />
350 </div> <!-- /.col-sm-10.col-sm-push-2 -->
352 <div class="col-sm-2 col-sm-pull-10">
354 [% INCLUDE 'cat-menu.inc' %]
356 </div> <!-- .col-sm-2.col-sm-pull-10 -->
357 </div> <!-- /.row -->
359 [% MACRO jsinclude BLOCK %]
360 [% INCLUDE 'datatables.inc' %]
361 [% INCLUDE 'calendar.inc' %]
363 function checkForm() {
364 if ( $('#uploadbarcodes').val() && $('#barcodelist').val() ) {
365 alert(_("You have uploaded a barcode file and scanned barcodes at the same time. Please choose one of the two options."));
368 if ( $('#uploadbarcodes').val() || $('#barcodelist').val() ) {
370 $('#branchloop').val() ||
371 $('#locationloop').val() ||
372 $('#minlocation').val() ||
373 $('#maxlocation').val() ||
374 $('#statuses input:checked').length
377 _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
378 _("For large catalogs this can result in unexpected behavior") + "\n\n" +
379 _("Are you sure you want to do this?")
387 function barcodesProvided() {
388 if( $("#uploadbarcodes").val() || $("#barcodelist").val() ) {
389 $("#setdate").prop('disabled',false);
390 $("#compareinv2barcd").prop('disabled',false);
391 $("#compareinv2barcd").attr('checked',true); // default
392 $("#dont_checkin").prop('disabled',false);
393 $("#out_of_order").prop('disabled',false);
394 if( $("#compareinv2barcd").attr('checked') ) {
395 $("fieldset#optionalfilters").show();
396 $("#ignoreissued").attr('checked',true); // default
398 $("fieldset#optionalfilters").hide();
399 $("#ignoreissued").attr('checked',false);
402 $("#setdate").prop('disabled',true);
403 $("#compareinv2barcd").prop('disabled',true);
404 $("#compareinv2barcd").attr('checked',false);
405 $("#dont_checkin").prop('disabled',true);
406 $("#dont_checkin").attr('checked',false);
407 $("#out_of_order").prop('disabled',true);
408 $("#out_of_order").attr('checked',false);
409 $("fieldset#optionalfilters").show();
413 $(document).ready(function(){
414 inventorydt = $('#inventoryt').dataTable($.extend(true, {}, dataTablesDefaults, {
415 'sPaginationType': 'full_numbers',
416 [% IF compareinv2barcd %]
417 // sort on callnumber
418 "aaSorting": [[ 1, "asc" ]],
420 // first column contains checkboxes
422 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
423 { "bSortable": false, "bSearchable": false, "aTargets": [ 0 ] }
425 // 3rd column is callnumber
426 "aaSorting": [[ 2, "asc" ]],
428 'fnDrawCallback': function() {
429 //bind the click handler script to the newly created elements held in the table
430 $('.openWin').bind('click',function(e){
432 openWindow(this.href,'marcview',800,600);
438 $("#continuewithoutmarkingbutton").click(function(){
439 inventorydt.fnPageChange( 'next' );
443 $("#markseenandcontinuebutton").click(function(){
445 $("input:checked").each(function() {
446 param += "|" + $(this).attr('name');
448 $.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param });
449 inventorydt.fnPageChange( 'next' );
453 $("#markseenandquit").click(function(){
455 $("input:checked").each(function() {
456 param += "|" + $(this).attr('name');
460 url: '/cgi-bin/koha/tools/ajax-inventory.pl',
461 data: { seen: param},
464 document.location.href = '/cgi-bin/koha/tools/inventory.pl';
468 $(".checkall").click(function(e){
470 $("#inventoryt input:checkbox").each(function(){
471 $(this).prop("checked", true);
474 $(".clearall").click(function(e){
476 $("#inventoryt input:checkbox").each(function(){
477 $(this).prop("checked", false);
480 $("#inventory_form").on("submit",function(){
484 $("#resetuploadbarcodes").click(function() {
485 $("#uploadbarcodes").val("");
489 // #uploadbarcodes and #compareinv2barcd determine the behavior of
490 // the controls within the barcode fieldset and the optional filters
491 $("#uploadbarcodes").change(barcodesProvided);
492 $("#barcodelist").on("change keyup paste", barcodesProvided);
494 $("#compareinv2barcd").click(function() {
495 if( $("#compareinv2barcd").attr('checked') ) {
496 $("fieldset#optionalfilters").show();
497 $("#ignoreissued").attr('checked',true); // default
499 $("#ignoreissued").attr('checked',false);
500 $("fieldset#optionalfilters").hide();
504 $("#checkallitemtypes").on("click",function(e){
506 $(".branch_select").prop("checked",1);
508 $("#checknoneitemtypes").on("click",function(e){
510 $(".branch_select").prop("checked",0);
516 [% INCLUDE 'intranet-bottom.inc' %]