diff --git a/C4/Barcodes/ValueBuilder.pm b/C4/Barcodes/ValueBuilder.pm index ef9f28e057..edc5935f0f 100644 --- a/C4/Barcodes/ValueBuilder.pm +++ b/C4/Barcodes/ValueBuilder.pm @@ -26,7 +26,7 @@ sub get_barcode { my ($args) = @_; my $nextnum; # not the best, two catalogers could add the same barcode easily this way :/ - my $query = "select max(abs(barcode)) from items"; + my $query = "select max(cast(barcode as unsigned)) from items"; my $sth = C4::Context->dbh->prepare($query); $sth->execute(); while (my ($count)= $sth->fetchrow_array) {