Bug 37070: (QA follow-up) Fix qa script issues

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Kyle M Hall 2024-10-04 13:00:26 -04:00 committed by Katrin Fischer
parent 898cb34fef
commit bfe67da62d
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 7 additions and 10 deletions

View File

@ -94,11 +94,12 @@ sub max {
return $self->db_max;
}
sub db_max {
my $self = shift;
my $query = "SELECT max(abs(CAST(barcode AS UNSIGNED))) FROM items LIMIT 1"; # Possible problem if multiple barcode types populated
my $sth = C4::Context->dbh->prepare($query);
$sth->execute();
return $sth->fetchrow_array || $self->initial;
my $self = shift;
my $query = "SELECT max(abs(CAST(barcode AS UNSIGNED))) FROM items LIMIT 1"
; # Possible problem if multiple barcode types populated
my $sth = C4::Context->dbh->prepare($query);
$sth->execute();
return $sth->fetchrow_array || $self->initial;
}
sub next_value {
my $self = shift;

View File

@ -141,11 +141,7 @@ subtest 'Test generation of incremental barcodes from DB values' => sub {
$builder->schema->resultset('Item')->delete_all;
my $barcodeobj;
my $item_1 = $builder->build_sample_item(
{
barcode => '1000000000000000'
}
);
my $item_1 = $builder->build_sample_item( { barcode => '1000000000000000' } );
$barcodeobj = C4::Barcodes->new('incremental');