+ if (grep{$_ == 0} @items) {
+ warn sprintf('create_labelbatch_from_importbatch() : Call to C4::ImportBatch::GetItemNumbersFromImportBatch returned no item number(s) from import batch #%s.', $batch_id);
+ return -1;
+ }
+ foreach my $item_number (@items) {
+ $err = $batch->add_item($item_number);
+ if ($err == -1) {
+ warn sprintf('create_labelbatch_from_importbatch() : Error attempting to add item #%s of import batch #%s to label batch.', $item_number, $batch_id);
+ return -1;
+ }
+ }
+ return $batch->get_attr('batch_id');