<li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="datepicker" disabled /></li>
<li><label for="compareinv2barcd">Compare barcodes list to results: </label><input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" disabled /></li>
<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>
+ <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>
</ol>
</fieldset>
Still checked out<br/>
[% ELSIF problem.key == 'no_barcode' %]
No barcode<br/>
+ [% ELSIF problem.key == 'out_of_order' %]
+ Item may be shelved out of order<br/>
[% END %]
[% END %]
</td>
my $op = $input->param('op');
my $compareinv2barcd = $input->param('compareinv2barcd');
my $dont_checkin = $input->param('dont_checkin');
+my $out_of_order = $input->param('out_of_order');
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{ template_name => "tools/inventory.tt",
# Report scanned items that are on the wrong place, or have a wrong notforloan
# status, or are still checked out.
-foreach my $item ( @scanned_items ) {
+for ( my $i = 0; $i < @scanned_items; $i++ ) {
+
+ my $item = $scanned_items[$i];
+
$item->{notforloancode} = $item->{notforloan}; # save for later use
my $fc = $item->{'frameworkcode'} || '';
additemtoresults( $item, $results );
}
+ # Check for items shelved out of order
+ if ($out_of_order) {
+ unless ( $i == 0 ) {
+ my $previous_item = $scanned_items[ $i - 1 ];
+ if ( $previous_item && $item->{cn_sort} lt $previous_item->{cn_sort} ) {
+ $item->{problems}->{out_of_order} = 1;
+ additemtoresults( $item, $results );
+ }
+ }
+ unless ( $i == scalar(@scanned_items) ) {
+ my $next_item = $scanned_items[ $i + 1 ];
+ if ( $next_item && $item->{cn_sort} gt $next_item->{cn_sort} ) {
+ $item->{problems}->{out_of_order} = 1;
+ additemtoresults( $item, $results );
+ }
+ }
+ }
+
# Report an item that is checked out (unusual!) or wrongly placed
if( $item->{onloan} ) {
$item->{problems}->{checkedout} = 1;