Lines 244-258
if ($op eq "show"){
Link Here
|
244 |
|
244 |
|
245 |
@contentlist = uniq @contentlist; |
245 |
@contentlist = uniq @contentlist; |
246 |
if ($filecontent eq 'barcode_file') { |
246 |
if ($filecontent eq 'barcode_file') { |
247 |
foreach my $barcode (@contentlist) { |
247 |
my $existing_items = Koha::Items->search({ itemnumber => \@contentlist })->get_column('itemnumber'); |
248 |
|
248 |
@itemnumbers = $existing_items->get_column('itemnumber'); |
249 |
my $itemnumber = GetItemnumberFromBarcode($barcode); |
249 |
my %exists = map {$_=>1} @{$existing_items->get_column('barcode')}; |
250 |
if ($itemnumber) { |
250 |
@notfoundbarcodes = grep { !$exists{$_} } @contentlist; |
251 |
push @itemnumbers,$itemnumber; |
|
|
252 |
} else { |
253 |
push @notfoundbarcodes, $barcode; |
254 |
} |
255 |
} |
256 |
} |
251 |
} |
257 |
elsif ( $filecontent eq 'itemid_file') { |
252 |
elsif ( $filecontent eq 'itemid_file') { |
258 |
@itemnumbers = @contentlist; |
253 |
@itemnumbers = @contentlist; |
Lines 267-282
if ($op eq "show"){
Link Here
|
267 |
if ( my $list=$input->param('barcodelist')){ |
262 |
if ( my $list=$input->param('barcodelist')){ |
268 |
push my @barcodelist, uniq( split(/\s\n/, $list) ); |
263 |
push my @barcodelist, uniq( split(/\s\n/, $list) ); |
269 |
|
264 |
|
270 |
foreach my $barcode (@barcodelist) { |
265 |
my $existing_items = Koha::Items->search({ itemnumber => \@barcodelist })->get_column('itemnumber'); |
271 |
|
266 |
@itemnumbers = $existing_items->get_column('itemnumber'); |
272 |
my $itemnumber = GetItemnumberFromBarcode($barcode); |
267 |
my %exists = map {$_=>1} @{$existing_items->get_column('barcode')}; |
273 |
if ($itemnumber) { |
268 |
@notfoundbarcodes = grep { !$exists{$_} } @barcodelist; |
274 |
push @itemnumbers,$itemnumber; |
|
|
275 |
} else { |
276 |
push @notfoundbarcodes, $barcode; |
277 |
} |
278 |
} |
279 |
|
280 |
} |
269 |
} |
281 |
} |
270 |
} |
282 |
|
271 |
|
283 |
- |
|
|