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 |
|
165 |
my $sth = $dbh->column_info(undef,undef,"items","barcode"); |
166 |
my $barcode_def = $sth->fetchall_hashref('COLUMN_NAME'); |
167 |
my $barcode_size = $barcode_def->{barcode}->{COLUMN_SIZE}; |
168 |
my $err_length=0; |
169 |
my $err_data=0; |
163 |
while (my $barcode=<$uploadbarcodes>){ |
170 |
while (my $barcode=<$uploadbarcodes>){ |
164 |
$barcode =~ s/\r?\n$//; |
171 |
$barcode =~ s/\r?\n$//; |
165 |
next unless $barcode; |
172 |
next unless $barcode; |
|
|
173 |
if (length($barcode)>$barcode_size) { |
174 |
$err_length += 1; |
175 |
} |
176 |
if ($barcode =~ /[^[:print:]]/) { # Only printable characters allowed. |
177 |
$err_data += 1; |
178 |
} |
179 |
next if length($barcode)>$barcode_size; |
180 |
next if ( $barcode =~ /[^[:print:]]/ ); |
181 |
push @barcodes,$barcode; |
182 |
} |
183 |
if (! @barcodes) { |
184 |
push @errorloop, {'barcode'=>'No valid barcodes!'}; |
185 |
$op=''; # force the initial inventory screen again. |
186 |
} |
187 |
else { |
188 |
$template->param( err_length => $err_length, |
189 |
err_data => $err_data ); |
190 |
} |
191 |
foreach my $barcode (@barcodes) { |
166 |
if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) { |
192 |
if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) { |
167 |
push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 }; |
193 |
push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 }; |
168 |
} else { |
194 |
} else { |
169 |
- |
|
|