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 254-260
if ( $compareinv2barcd ) {
Link Here
|
254 |
# insert "wrongplace" to all scanned items that are not supposed to be in this range |
255 |
# insert "wrongplace" to all scanned items that are not supposed to be in this range |
255 |
# note this list is always displayed, whatever the librarian has choosen for comparison |
256 |
# note this list is always displayed, whatever the librarian has choosen for comparison |
256 |
my $moddatecount = 0; |
257 |
my $moddatecount = 0; |
257 |
foreach my $item ( @scanned_items ) { |
258 |
for ( my $i = 0; $i < @scanned_items; $i++ ) { |
|
|
259 |
my $item = $scanned_items[$i]; |
260 |
|
261 |
# Check for items shelved out of order |
262 |
if ($out_of_order) { |
263 |
unless ( $i == 0 ) { |
264 |
my $previous_item = $scanned_items[ $i - 1 ]; |
265 |
if ( $previous_item && $item->{cn_sort} lt $previous_item->{cn_sort} ) { |
266 |
$item->{problem} = 'out_of_order'; |
267 |
push( @items_with_problems, {%$item} ); |
268 |
} |
269 |
} |
270 |
unless ( $i == scalar(@scanned_items) ) { |
271 |
my $next_item = $scanned_items[ $i + 1 ]; |
272 |
if ( $next_item && $item->{cn_sort} gt $next_item->{cn_sort} ) { |
273 |
$item->{problem} = 'out_of_order'; |
274 |
push( @items_with_problems, {%$item} ); |
275 |
} |
276 |
} |
277 |
} |
258 |
|
278 |
|
259 |
# Saving notforloan code before it's replaced by it's authorised value for later comparison |
279 |
# Saving notforloan code before it's replaced by it's authorised value for later comparison |
260 |
$item->{notforloancode} = $item->{notforloan}; |
280 |
$item->{notforloancode} = $item->{notforloan}; |
Lines 276-284
foreach my $item ( @scanned_items ) {
Link Here
|
276 |
next if $item->{onloan}; # skip checked out items |
296 |
next if $item->{onloan}; # skip checked out items |
277 |
|
297 |
|
278 |
# If we have scanned items with a non-matching notforloan value |
298 |
# If we have scanned items with a non-matching notforloan value |
279 |
if (none { $item->{'notforloancode'} eq $_ } @notforloans) { |
299 |
if ( $item->{notforloancode} ) { |
280 |
$item->{problem} = 'changestatus'; |
300 |
if ( none { $item->{'notforloancode'} eq $_ } @notforloans ) { |
281 |
push @items_with_problems, { %$item }; |
301 |
$item->{problem} = 'changestatus'; |
|
|
302 |
push @items_with_problems, {%$item}; |
303 |
} |
282 |
} |
304 |
} |
283 |
if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$inventorylist) { |
305 |
if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$inventorylist) { |
284 |
$item->{problem} = 'wrongplace'; |
306 |
$item->{problem} = 'wrongplace'; |
Lines 309-319
for my $item ( @items_with_problems ) {
Link Here
|
309 |
|
331 |
|
310 |
# If a barcode file is given, we want to show problems, else all items |
332 |
# If a barcode file is given, we want to show problems, else all items |
311 |
my @results; |
333 |
my @results; |
312 |
@results = $uploadbarcodes |
334 |
@results = |
313 |
? @items_with_problems |
335 |
$uploadbarcodes ? @items_with_problems |
314 |
: $op |
336 |
: $op ? @$inventorylist |
315 |
? @$inventorylist |
337 |
: undef; |
316 |
: (); |
|
|
317 |
|
338 |
|
318 |
$template->param( |
339 |
$template->param( |
319 |
moddatecount => $moddatecount, |
340 |
moddatecount => $moddatecount, |
320 |
- |
|
|