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 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% IF (loop) %]<a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a> › Results[% ELSE %]Inventory[% END %]</div>
17 <div class="main container-fluid">
19 <div class="col-sm-10 col-sm-push-2">
23 [% IF (moddatecount) %]<div class="dialog message">[% moddatecount | html %] items modified : datelastseen set to [% date | $KohaDates %]</div>
24 <div class="dialog alert">Number of potential barcodes read: [% LinesRead | html %]</div>[% END %]
25 [% IF (errorfile) %]<div class="dialog alert">[% errorfile | html %] can't be opened</div>[% END %]
26 [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
27 [% IF (err_length && err_length>1) %]<div class="dialog alert">There were [% err_length | html %] barcodes that were too long.</div>[% END %]
28 [% IF (err_data && err_data==1) %]<div class="dialog alert">There was 1 barcode that contained at least one unprintable character.</div>[% END %]
29 [% 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 %]
30 [% FOREACH error IN errorloop %]
31 <div class="dialog alert">
32 [% error.barcode | html %]
33 [% IF (error.ERR_BARCODE) %]: barcode not found[% END %]
34 [% IF (error.ERR_WTHDRAWN) %]: item withdrawn[% END %]
35 [% IF (error.ERR_ONLOAN_RET) %]: item was on loan. It was returned before marked as seen[% END %]
36 [% IF (error.ERR_ONLOAN_NOT_RET) %]: item was on loan. couldn't be returned.[% END %]
41 <form method="post" id="inventory_form" action="/cgi-bin/koha/tools/inventory.pl" enctype="multipart/form-data">
42 <fieldset class="rows">
43 <legend>Use a barcode file</legend>
45 <li><label for="uploadbarcodes">Barcode file: </label> <input type="file" id="uploadbarcodes" name="uploadbarcodes" />
46 <input type="button" id="resetuploadbarcodes" name="resetuploadbarcodes" value="Reset" /></li>
49 <fieldset class="rows">
50 <legend>Or scan items one by one</legend>
53 <label for="barcodelist">Barcode list (one barcode per line): </label>
54 <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
58 <fieldset class="rows">
59 <legend>Parameters</legend>
61 <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="datepicker" disabled /></li>
62 <li><label for="compareinv2barcd">Compare barcodes list to results: </label><input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" disabled /></li>
63 <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>
64 <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>
67 <fieldset class="rows">
68 <legend>Item location filters</legend>
70 <label for="branch">Location: </label>
71 <input type="radio" name="branch" value="homebranch"> Home library</input>
72 <input type="radio" name="branch" value="holdingbranch"> Current library</input>
74 <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
75 <option value="">All libraries</option>
76 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
79 [% IF (authorised_values) %]
81 <label for="locationloop">Shelving location (items.location) is: </label>
82 <select id="locationloop" name="location">
83 <option value="">Filter location</option>
84 [% FOREACH value IN authorised_values %]
85 [% IF (value.selected) %]
86 <option value="[% value.authorised_value | html %]" selected="selected">[% value.lib | html %]</option>
88 <option value="[% value.authorised_value | html %]">[% value.lib | html %]</option>
94 <label for="minlocation">Item callnumber between: </label>
95 <input type="text" name="minlocation" id="minlocation" value="[% minlocation | html %]" /> (items.itemcallnumber) </li>
96 <li><label for="maxlocation">...and: </label>
97 <input type="text" name="maxlocation" id="maxlocation" value="[% maxlocation | html %]" />
99 <label for="class_source">Callnumber classification scheme</label>
100 <select name="class_source">
101 [% FOREACH class_source IN class_sources %]
102 [% IF class_source.cn_source == pref_class %]
103 <option value="[% class_source.cn_source | html %]" selected="selected">[% class_source.description | html %] (default)</option>
105 <option value="[% class_source.cn_source | html %]">[% class_source.description | html %]</option>
113 <fieldset class="rows" id="optionalfilters">
114 <legend>Optional filters for inventory list or comparing barcodes</legend>
116 <div id="statuses" style="display: block;">
117 [% FOREACH status IN statuses %]
118 [% IF (status.values) %]
119 <fieldset style="float: left; padding: 5px; margin: 5px;text-align:right">
120 <legend>[% status.fieldname | html %]</legend>
121 <ul id="statuses-[% fieldname | html %]" style="display: inline;">
122 [% FOREACH value IN status.values %]
125 <label for="[% value.id | html %]">
126 [% IF ( status.fieldname == 'items.notforloan' && value.authorised_value == 0 && value.lib == '__IGNORE__' ) %]
129 [% value.lib | html %]
132 <input type="checkbox" name="status-[% status.fieldname | html %]-[% value.authorised_value | html %]" id="[% value.authorised_value | html %]" />
144 <label for="datelastseen">Last inventory date:</label>
145 <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates %]" class="datepicker" />
146 (Skip records marked as seen on or after this date.)
149 <label for="ignoreissued">Skip items on loan: </label>
150 [% IF (ignoreissued) %]
151 <input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" />
153 <input type="checkbox" id="ignoreissued" name="ignoreissued" />
157 <label for="ignore_waiting_holds">Skip items on hold awaiting pickup: </label>
158 <input type="checkbox" id="ignore_waiting_holds" name="ignore_waiting_holds" />
163 <fieldset class="rows">
164 <legend>Additional options</legend>
168 <label for="CSVexport">Export to CSV file: </label>
169 <input type="checkbox" name="CSVexport" id="CSVexport" />
173 <input type="hidden" name="op" value="do_it" />
175 <fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
180 <form method="post" action="/cgi-bin/koha/tools/inventory.pl">
181 <input type="hidden" name="minlocation" value="[% minlocation | html %]" />
182 <input type="hidden" name="maxlocation" value="[% maxlocation | html %]" />
183 <input type="hidden" name="location" value="[% location | html %]" />
184 <input type="hidden" name="branchcode" value="[% branchcode | html %]" />
185 <input type="hidden" name="datelastseen" value="[% datelastseen | html %]" />
187 [% UNLESS uploadedbarcodesflag %]
188 <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>
191 <table id="inventoryt">
194 [% UNLESS uploadedbarcodesflag %]<th>Seen</th>[% END %]
196 <th class="title-string">Call number</th>
198 <th class="anti-the">Title</th>
199 <th>Not for loan</th>
203 <th class="title-string">Last seen</th>
208 [% FOREACH result IN loop %]
210 [% UNLESS uploadedbarcodesflag %]
212 <input type="checkbox" name="SEEN-[% result.itemnumber | html %]" value="1" />
216 [% result.barcode | html %]
219 <span title="[% result.cn_sort | html %]">[% result.itemcallnumber | html %]</span>
222 [% Branches.GetName( result.homebranch ) | html %]
223 <span class="shelvingloc">[% result.location | html %]</span>
226 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% result.biblionumber | uri %]" class="openWin">[% result.title | html %]</a>
227 [% IF ( result.author ) %]
228 by <span class="author">[% result.author | html %]</span>
232 [% result.notforloan | html %]
235 [% result.itemlost | html %]
238 [% result.damaged | html %]
241 [% result.withdrawn | html %]
244 <span title="[% result.datelastseen | html %]">[% result.datelastseen | $KohaDates%]</span>
247 [% FOREACH problem IN result.problems %]
248 [% IF problem.key == 'wrongplace' %]
249 Found in wrong place<br/>
250 [% ELSIF problem.key == 'changestatus' %]
251 Unknown not-for-loan status<br/>
252 [% ELSIF problem.key == 'not_scanned' %]
253 Missing (not scanned)<br/>
254 [% ELSIF problem.key == 'checkedout' %]
255 Still checked out<br/>
256 [% ELSIF problem.key == 'no_barcode' %]
258 [% ELSIF problem.key == 'out_of_order' %]
259 Item may be shelved out of order<br/>
267 <div class="spacer"></div>
268 [% UNLESS uploadedbarcodesflag %]
269 <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>
270 <input type="submit" id="markseenandquit" value="Mark seen and quit" />
271 <input type="submit" value="Mark seen and continue >>" id="markseenandcontinuebutton" />
272 <input type="submit" value="Continue without marking >>" id="continuewithoutmarkingbutton" class="submit" />
280 </div> <!-- /.col-sm-10.col-sm-push-2 -->
282 <div class="col-sm-2 col-sm-pull-10">
284 [% INCLUDE 'tools-menu.inc' %]
286 </div> <!-- .col-sm-2.col-sm-pull-10 -->
287 </div> <!-- /.row -->
289 [% MACRO jsinclude BLOCK %]
290 [% Asset.js("js/tools-menu.js") | $raw %]
291 [% INCLUDE 'datatables.inc' %]
292 [% INCLUDE 'calendar.inc' %]
293 <script type="text/javascript">
294 function checkForm() {
295 if ( $('#uploadbarcodes').val() && $('#barcodelist').val() ) {
296 alert(_("You have uploaded a barcode file and scanned barcodes at the same time. Please choose one of the two options."));
299 if ( $('#uploadbarcodes').val() || $('#barcodelist').val() ) {
301 $('#branchloop').val() ||
302 $('#locationloop').val() ||
303 $('#minlocation').val() ||
304 $('#maxlocation').val() ||
305 $('#statuses input:checked').length
308 _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
309 _("For large catalogs this can result in unexpected behavior") + "\n\n" +
310 _("Are you sure you want to do this?")
318 function barcodesProvided() {
319 if( $("#uploadbarcodes").val() || $("#barcodelist").val() ) {
320 $("#setdate").prop('disabled',false);
321 $("#compareinv2barcd").prop('disabled',false);
322 $("#compareinv2barcd").attr('checked',true); // default
323 $("#dont_checkin").prop('disabled',false);
324 $("#out_of_order").prop('disabled',false);
325 if( $("#compareinv2barcd").attr('checked') ) {
326 $("fieldset#optionalfilters").show();
327 $("#ignoreissued").attr('checked',true); // default
329 $("fieldset#optionalfilters").hide();
330 $("#ignoreissued").attr('checked',false);
333 $("#setdate").prop('disabled',true);
334 $("#compareinv2barcd").prop('disabled',true);
335 $("#compareinv2barcd").attr('checked',false);
336 $("#dont_checkin").prop('disabled',true);
337 $("#dont_checkin").attr('checked',false);
338 $("#out_of_order").prop('disabled',true);
339 $("#out_of_order").attr('checked',false);
340 $("fieldset#optionalfilters").show();
344 $(document).ready(function(){
345 inventorydt = $('#inventoryt').dataTable($.extend(true, {}, dataTablesDefaults, {
346 'sPaginationType': 'full_numbers',
347 [% IF compareinv2barcd %]
348 // sort on callnumber
349 "aaSorting": [[ 1, "asc" ]],
351 // first column contains checkboxes
353 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
354 { "bSortable": false, "bSearchable": false, "aTargets": [ 0 ] },
355 { "sType": "title-string", "aTargets" : [ "title-string" ] },
357 // 3rd column is callnumber
358 "aaSorting": [[ 2, "asc" ]],
360 'fnDrawCallback': function() {
361 //bind the click handler script to the newly created elements held in the table
362 $('.openWin').bind('click',function(e){
364 openWindow(this.href,'marcview',800,600);
370 $("#continuewithoutmarkingbutton").click(function(){
371 inventorydt.fnPageChange( 'next' );
375 $("#markseenandcontinuebutton").click(function(){
377 $("input:checked").each(function() {
378 param += "|" + $(this).attr('name');
380 $.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param });
381 inventorydt.fnPageChange( 'next' );
385 $("#markseenandquit").click(function(){
387 $("input:checked").each(function() {
388 param += "|" + $(this).attr('name');
392 url: '/cgi-bin/koha/tools/ajax-inventory.pl',
393 data: { seen: param},
396 document.location.href = '/cgi-bin/koha/tools/inventory.pl';
400 var checkboxes = $("#inventoryt input:checkbox");
401 $(".checkall").click(function(e){
403 checkboxes.each(function(){
404 $(this).prop("checked", true);
407 $(".clearall").click(function(e){
409 checkboxes.each(function(){
410 $(this).prop("checked", false);
413 $("#inventory_form").on("submit",function(){
417 $("#resetuploadbarcodes").click(function() {
418 $("#uploadbarcodes").val("");
422 // #uploadbarcodes and #compareinv2barcd determine the behavior of
423 // the controls within the barcode fieldset and the optional filters
424 $("#uploadbarcodes").change(barcodesProvided);
425 $("#barcodelist").on("change keyup paste", barcodesProvided);
427 $("#compareinv2barcd").click(function() {
428 if( $("#compareinv2barcd").attr('checked') ) {
429 $("fieldset#optionalfilters").show();
430 $("#ignoreissued").attr('checked',true); // default
432 $("#ignoreissued").attr('checked',false);
433 $("fieldset#optionalfilters").hide();
440 [% INCLUDE 'intranet-bottom.inc' %]