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