From c65d283cad3afe1faf5f8e07c4ac6071e4014121 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 9 Jan 2014 17:16:29 +0100 Subject: [PATCH] Nummerngenerator: undefinierte Startnummern auf 0 setzen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Passiert bei frisch angelegten Datenbanken, wenn die Zähler noch leer sind. Fixt #2432. --- SL/DB/Helper/TransNumberGenerator.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SL/DB/Helper/TransNumberGenerator.pm b/SL/DB/Helper/TransNumberGenerator.pm index b4e4e49f4..9684677c2 100644 --- a/SL/DB/Helper/TransNumberGenerator.pm +++ b/SL/DB/Helper/TransNumberGenerator.pm @@ -75,7 +75,7 @@ sub get_next_trans_number { my $range_table = $business ? $business : SL::DB::Default->get; my $start_number = $range_table->$number_range_column; $start_number = $range_table->articlenumber if ($number_range_column eq 'assemblynumber') && (length($start_number) < 1); - my $sequence = SL::PrefixedNumber->new(number => $start_number); + my $sequence = SL::PrefixedNumber->new(number => $start_number // 0); if (!$fill_holes_in_range) { my @numbers = map { $_->$number_column } @{ $self->_get_manager_class->get_all(%conditions) }; -- 2.20.1