|
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 220-226
if ( $compareinv2barcd ) {
Link Here
|
| 220 |
# insert "wrongplace" to all scanned items that are not supposed to be in this range |
221 |
# insert "wrongplace" to all scanned items that are not supposed to be in this range |
| 221 |
# note this list is always displayed, whatever the librarian has choosen for comparison |
222 |
# note this list is always displayed, whatever the librarian has choosen for comparison |
| 222 |
my $moddatecount = 0; |
223 |
my $moddatecount = 0; |
| 223 |
foreach my $item ( @scanned_items ) { |
224 |
for ( my $i = 0; $i < @scanned_items; $i++ ) { |
|
|
225 |
my $item = $scanned_items[$i]; |
| 226 |
|
| 227 |
# Check for items shelved out of order |
| 228 |
if ($out_of_order) { |
| 229 |
unless ( $i == 0 ) { |
| 230 |
my $previous_item = $scanned_items[ $i - 1 ]; |
| 231 |
if ( $previous_item && $item->{cn_sort} lt $previous_item->{cn_sort} ) { |
| 232 |
$item->{problem} = 'out_of_order'; |
| 233 |
push( @items_with_problems, {%$item} ); |
| 234 |
} |
| 235 |
} |
| 236 |
unless ( $i == scalar(@scanned_items) ) { |
| 237 |
my $next_item = $scanned_items[ $i + 1 ]; |
| 238 |
if ( $next_item && $item->{cn_sort} gt $next_item->{cn_sort} ) { |
| 239 |
$item->{problem} = 'out_of_order'; |
| 240 |
push( @items_with_problems, {%$item} ); |
| 241 |
} |
| 242 |
} |
| 243 |
} |
| 224 |
|
244 |
|
| 225 |
# Saving notforloan code before it's replaced by it's authorised value for later comparison |
245 |
# Saving notforloan code before it's replaced by it's authorised value for later comparison |
| 226 |
$item->{notforloancode} = $item->{notforloan}; |
246 |
$item->{notforloancode} = $item->{notforloan}; |
|
Lines 242-250
foreach my $item ( @scanned_items ) {
Link Here
|
| 242 |
next if $item->{onloan}; # skip checked out items |
262 |
next if $item->{onloan}; # skip checked out items |
| 243 |
|
263 |
|
| 244 |
# If we have scanned items with a non-matching notforloan value |
264 |
# If we have scanned items with a non-matching notforloan value |
| 245 |
if (none { $item->{'notforloancode'} eq $_ } @notforloans) { |
265 |
if ( $item->{notforloancode} ) { |
| 246 |
$item->{problem} = 'changestatus'; |
266 |
if ( none { $item->{'notforloancode'} eq $_ } @notforloans ) { |
| 247 |
push @items_with_problems, { %$item }; |
267 |
$item->{problem} = 'changestatus'; |
|
|
268 |
push @items_with_problems, {%$item}; |
| 269 |
} |
| 248 |
} |
270 |
} |
| 249 |
if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$inventorylist) { |
271 |
if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$inventorylist) { |
| 250 |
$item->{problem} = 'wrongplace'; |
272 |
$item->{problem} = 'wrongplace'; |
|
Lines 275-285
for my $item ( @items_with_problems ) {
Link Here
|
| 275 |
|
297 |
|
| 276 |
# If a barcode file is given, we want to show problems, else all items |
298 |
# If a barcode file is given, we want to show problems, else all items |
| 277 |
my @results; |
299 |
my @results; |
| 278 |
@results = $uploadbarcodes |
300 |
@results = |
| 279 |
? @items_with_problems |
301 |
$uploadbarcodes ? @items_with_problems |
| 280 |
: $op |
302 |
: $op ? @$inventorylist |
| 281 |
? @$inventorylist |
303 |
: undef; |
| 282 |
: (); |
|
|
| 283 |
|
304 |
|
| 284 |
$template->param( |
305 |
$template->param( |
| 285 |
moddatecount => $moddatecount, |
306 |
moddatecount => $moddatecount, |
| 286 |
- |
|
|