View | Details | Raw Unified | Return to bug 37070
Collapse All | Expand All

(-)a/C4/Barcodes.pm (-5 / +6 lines)
Lines 94-104 sub max { Link Here
94
	return $self->db_max;
94
	return $self->db_max;
95
}
95
}
96
sub db_max {
96
sub db_max {
97
	my $self = shift;
97
    my $self  = shift;
98
	my $query = "SELECT max(abs(CAST(barcode AS UNSIGNED))) FROM items LIMIT 1"; # Possible problem if multiple barcode types populated
98
    my $query = "SELECT max(abs(CAST(barcode AS UNSIGNED))) FROM items LIMIT 1"
99
	my $sth = C4::Context->dbh->prepare($query);
99
        ;    # Possible problem if multiple barcode types populated
100
	$sth->execute();
100
    my $sth = C4::Context->dbh->prepare($query);
101
	return $sth->fetchrow_array || $self->initial;
101
    $sth->execute();
102
    return $sth->fetchrow_array || $self->initial;
102
}
103
}
103
sub next_value {
104
sub next_value {
104
	my $self = shift;
105
	my $self = shift;
(-)a/t/db_dependent/Barcodes.t (-6 / +1 lines)
Lines 141-151 subtest 'Test generation of incremental barcodes from DB values' => sub { Link Here
141
    $builder->schema->resultset('Item')->delete_all;
141
    $builder->schema->resultset('Item')->delete_all;
142
    my $barcodeobj;
142
    my $barcodeobj;
143
143
144
    my $item_1 = $builder->build_sample_item(
144
    my $item_1 = $builder->build_sample_item( { barcode => '1000000000000000' } );
145
        {
146
            barcode => '1000000000000000'
147
        }
148
    );
149
145
150
    $barcodeobj = C4::Barcodes->new('incremental');
146
    $barcodeobj = C4::Barcodes->new('incremental');
151
147
152
- 

Return to bug 37070