Lines 213-220
if ( ($uploadbarcodes && length($uploadbarcodes) > 0) || ($barcodelist && length
Link Here
|
213 |
if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) { |
213 |
if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) { |
214 |
push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 }; |
214 |
push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 }; |
215 |
} else { |
215 |
} else { |
216 |
my $item = Koha::Items->find({barcode => $barcode}); |
216 |
my $barcode_nz = $barcode; |
217 |
if ( $item ) { |
217 |
$barcode_nz =~ s/^0*//; |
|
|
218 |
my $item_rs = Koha::Items->search({barcode => { 'regexp', "^0*${barcode_nz}\$" }}); |
219 |
if ( $item_rs->count == 1 ) { |
220 |
my $item = $item_rs->next; |
218 |
# Modify date last seen for scanned items, remove lost status |
221 |
# Modify date last seen for scanned items, remove lost status |
219 |
$item->set({ itemlost => 0, datelastseen => $date_dt })->store; |
222 |
$item->set({ itemlost => 0, datelastseen => $date_dt })->store; |
220 |
my $item_unblessed = $item->unblessed; |
223 |
my $item_unblessed = $item->unblessed; |
Lines 233-238
if ( ($uploadbarcodes && length($uploadbarcodes) > 0) || ($barcodelist && length
Link Here
|
233 |
} |
236 |
} |
234 |
} |
237 |
} |
235 |
push @scanned_items, $item_unblessed; |
238 |
push @scanned_items, $item_unblessed; |
|
|
239 |
} elsif( $item_rs->count > 1 ) { # duplicates like 1 and 01 |
240 |
push @errorloop, { barcode => $barcode_nz, ERR_DUPLICATE_BARCODES => 1 }; |
236 |
} else { |
241 |
} else { |
237 |
push @errorloop, { barcode => $barcode, ERR_BARCODE => 1 }; |
242 |
push @errorloop, { barcode => $barcode, ERR_BARCODE => 1 }; |
238 |
} |
243 |
} |
239 |
- |
|
|