|
Lines 197-204
if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) {
Link Here
|
| 197 |
if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) { |
197 |
if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) { |
| 198 |
push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 }; |
198 |
push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 }; |
| 199 |
} else { |
199 |
} else { |
| 200 |
my $item = Koha::Items->find({barcode => $barcode}); |
200 |
my $barcode_nz = $barcode; |
| 201 |
if ( $item ) { |
201 |
$barcode_nz =~ s/^0*//; |
|
|
202 |
my $item_rs = Koha::Items->search({barcode => { 'regexp', "^0*${barcode_nz}\$" }}); |
| 203 |
if ( $item_rs->count == 1 ) { |
| 204 |
my $item = $item_rs->next; |
| 202 |
# Modify date last seen for scanned items, remove lost status |
205 |
# Modify date last seen for scanned items, remove lost status |
| 203 |
$item->set({ itemlost => 0, datelastseen => $date })->store; |
206 |
$item->set({ itemlost => 0, datelastseen => $date })->store; |
| 204 |
my $item_unblessed = $item->unblessed; |
207 |
my $item_unblessed = $item->unblessed; |
|
Lines 217-222
if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) {
Link Here
|
| 217 |
} |
220 |
} |
| 218 |
} |
221 |
} |
| 219 |
push @scanned_items, $item_unblessed; |
222 |
push @scanned_items, $item_unblessed; |
|
|
223 |
} elsif( $item_rs->count > 1 ) { # duplicates like 1 and 01 |
| 224 |
push @errorloop, { barcode => $barcode_nz, ERR_DUPLICATE_BARCODES => 1 }; |
| 220 |
} else { |
225 |
} else { |
| 221 |
push @errorloop, { barcode => $barcode, ERR_BARCODE => 1 }; |
226 |
push @errorloop, { barcode => $barcode, ERR_BARCODE => 1 }; |
| 222 |
} |
227 |
} |
| 223 |
- |
|
|