@@ -, +, @@ --- tools/batchMod.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- a/tools/batchMod.pl +++ a/tools/batchMod.pl @@ -282,9 +282,15 @@ if ($op eq "show"){ my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list ); @barcodelist = uniq @barcodelist; - my $existing_items = Koha::Items->search({ barcode => \@barcodelist }); - @itemnumbers = $existing_items->get_column('itemnumber'); - my @barcodes = $existing_items->get_column('barcode'); + my $order = "field(" . join(",","barcode",@barcodelist) . ")"; + my $existing_items = Koha::Items->search({ barcode => \@barcodelist }, + { order_by => \[$order] } )->unblessed; + + my @barcodes; + foreach my $itm (@$existing_items) { + push @itemnumbers, $itm->{'itemnumber'}; + push @barcodes, $itm->{'barcode'}; + } my %exists = map {lc($_)=>1} @barcodes; # to avoid problems with case sensitivity foreach my $barcode (@barcodelist) { --