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 }); |
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 = Koha::Items->search({ itemnumber => \@contentlist })->get_column('itemnumber'); |
253 |
@itemnumbers = Koha::Items->search({ itemnumber => \@contentlist })->get_column('itemnumber'); |
Lines 269-284
if ($op eq "show"){
Link Here
|
269 |
if ( my $list=$input->param('barcodelist')){ |
264 |
if ( my $list=$input->param('barcodelist')){ |
270 |
push my @barcodelist, uniq( split(/\s\n/, $list) ); |
265 |
push my @barcodelist, uniq( split(/\s\n/, $list) ); |
271 |
|
266 |
|
272 |
foreach my $barcode (@barcodelist) { |
267 |
my $existing_items = Koha::Items->search({ barcode => \@barcodelist }); |
273 |
|
268 |
@itemnumbers = $existing_items->get_column('itemnumber'); |
274 |
my $itemnumber = GetItemnumberFromBarcode($barcode); |
269 |
my %exists = map {$_=>1} @{$existing_items->get_column('barcode')}; |
275 |
if ($itemnumber) { |
270 |
@notfoundbarcodes = grep { !$exists{$_} } @barcodelist; |
276 |
push @itemnumbers,$itemnumber; |
|
|
277 |
} else { |
278 |
push @notfoundbarcodes, $barcode; |
279 |
} |
280 |
} |
281 |
|
282 |
} |
271 |
} |
283 |
} |
272 |
} |
284 |
|
273 |
|
285 |
- |
|
|