Lines 53-58
my $branch = $input->param('branch');
Link Here
|
53 |
my $op = $input->param('op'); |
53 |
my $op = $input->param('op'); |
54 |
my $compareinv2barcd = $input->param('compareinv2barcd'); |
54 |
my $compareinv2barcd = $input->param('compareinv2barcd'); |
55 |
my $dont_checkin = $input->param('dont_checkin'); |
55 |
my $dont_checkin = $input->param('dont_checkin'); |
|
|
56 |
my $out_of_order = $input->param('out_of_order'); |
56 |
|
57 |
|
57 |
my ( $template, $borrowernumber, $cookie ) = get_template_and_user( |
58 |
my ( $template, $borrowernumber, $cookie ) = get_template_and_user( |
58 |
{ template_name => "tools/inventory.tt", |
59 |
{ template_name => "tools/inventory.tt", |
Lines 297-303
if ( $compareinv2barcd ) {
Link Here
|
297 |
# insert "wrongplace" to all scanned items that are not supposed to be in this range |
298 |
# insert "wrongplace" to all scanned items that are not supposed to be in this range |
298 |
# note this list is always displayed, whatever the librarian has chosen for comparison |
299 |
# note this list is always displayed, whatever the librarian has chosen for comparison |
299 |
my $moddatecount = 0; |
300 |
my $moddatecount = 0; |
300 |
foreach my $item ( @scanned_items ) { |
301 |
for ( my $i = 0; $i < @scanned_items; $i++ ) { |
|
|
302 |
my $item = $scanned_items[$i]; |
303 |
|
304 |
# Check for items shelved out of order |
305 |
if ($out_of_order) { |
306 |
unless ( $i == 0 ) { |
307 |
my $previous_item = $scanned_items[ $i - 1 ]; |
308 |
if ( $previous_item && $item->{cn_sort} lt $previous_item->{cn_sort} ) { |
309 |
$item->{problem} = 'out_of_order'; |
310 |
push( @items_with_problems, {%$item} ); |
311 |
} |
312 |
} |
313 |
unless ( $i == scalar(@scanned_items) ) { |
314 |
my $next_item = $scanned_items[ $i + 1 ]; |
315 |
if ( $next_item && $item->{cn_sort} gt $next_item->{cn_sort} ) { |
316 |
$item->{problem} = 'out_of_order'; |
317 |
push( @items_with_problems, {%$item} ); |
318 |
} |
319 |
} |
320 |
} |
301 |
|
321 |
|
302 |
# Saving notforloan code before it's replaced by it's authorised value for later comparison |
322 |
# Saving notforloan code before it's replaced by it's authorised value for later comparison |
303 |
$item->{notforloancode} = $item->{notforloan}; |
323 |
$item->{notforloancode} = $item->{notforloan}; |
Lines 319-327
foreach my $item ( @scanned_items ) {
Link Here
|
319 |
next if $item->{onloan}; # skip checked out items |
339 |
next if $item->{onloan}; # skip checked out items |
320 |
|
340 |
|
321 |
# If we have scanned items with a non-matching notforloan value |
341 |
# If we have scanned items with a non-matching notforloan value |
322 |
if (none { $item->{'notforloancode'} eq $_ } @notforloans) { |
342 |
if ( $item->{notforloancode} ) { |
323 |
$item->{problem} = 'changestatus'; |
343 |
if ( none { $item->{'notforloancode'} eq $_ } @notforloans ) { |
324 |
push @items_with_problems, { %$item }; |
344 |
$item->{problem} = 'changestatus'; |
|
|
345 |
push @items_with_problems, {%$item}; |
346 |
} |
325 |
} |
347 |
} |
326 |
if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$wrongplacelist) { |
348 |
if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$wrongplacelist) { |
327 |
$item->{problem} = 'wrongplace'; |
349 |
$item->{problem} = 'wrongplace'; |
Lines 352-362
for my $item ( @items_with_problems ) {
Link Here
|
352 |
|
374 |
|
353 |
# If a barcode file is given, we want to show problems, else all items |
375 |
# If a barcode file is given, we want to show problems, else all items |
354 |
my @results; |
376 |
my @results; |
355 |
@results = $uploadbarcodes |
377 |
@results = |
356 |
? @items_with_problems |
378 |
$uploadbarcodes ? @items_with_problems |
357 |
: $op |
379 |
: $op ? @$inventorylist |
358 |
? @$inventorylist |
380 |
: undef; |
359 |
: (); |
|
|
360 |
|
381 |
|
361 |
$template->param( |
382 |
$template->param( |
362 |
moddatecount => $moddatecount, |
383 |
moddatecount => $moddatecount, |
363 |
- |
|
|