Lines 160-168
if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) {
Link Here
|
160 |
|
160 |
|
161 |
my $count = 0; |
161 |
my $count = 0; |
162 |
|
162 |
|
|
|
163 |
my @barcodes; |
164 |
my $err_length=0; |
165 |
my $err_data=0; |
163 |
while (my $barcode=<$uploadbarcodes>){ |
166 |
while (my $barcode=<$uploadbarcodes>){ |
164 |
$barcode =~ s/\r?\n$//; |
167 |
$barcode =~ s/\r?\n$//; |
165 |
next unless $barcode; |
168 |
next unless $barcode; |
|
|
169 |
if (length($barcode)>20) { |
170 |
$err_length += 1; |
171 |
} |
172 |
if ($barcode =~ /[^0-9a-zA-Z]/) { |
173 |
$err_data += 1; |
174 |
} |
175 |
next if length($barcode)>20; # 20 is the current length of barcode. |
176 |
next if ( $barcode =~ /[^0-9a-zA-Z]/ ); # Only 0-9a-zA-Z are valid. |
177 |
push @barcodes,$barcode; |
178 |
} |
179 |
if (! @barcodes) { |
180 |
push @errorloop, {'barcode'=>'No valid barcodes!'}; |
181 |
$op=''; # force the initial inventory screen again. |
182 |
} |
183 |
else { |
184 |
$template->param( err_length => $err_length, |
185 |
err_data => $err_data ); |
186 |
} |
187 |
foreach my $barcode (@barcodes) { |
166 |
if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) { |
188 |
if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) { |
167 |
push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 }; |
189 |
push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 }; |
168 |
} else { |
190 |
} else { |
169 |
- |
|
|