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) };
Now the number itself is increased as often as neccessary to create a
unique one by comparing the generated numbers with the existing ones
retrieved in the first step. In this step gaps in the assigned numbers
-are filled for some tables (e.g. invoices) but not for others
-(e.g. sales orders).
+are filled for all currently supported tables.
After creating the unique record number this function can update
C<$self> and the C<defaults> table if requested. This is controlled