X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FHelper%2FTransNumberGenerator.pm;h=fab4a7c0015d87ec6f0b1ee13c3411544c07862b;hb=03facf5ab7c76dda121669574aacfe7f30f417ca;hp=c9ed09fc013aeaa007dce7a0a8259ce43ff1236d;hpb=46990042df471ed188c89cbb20f966b74e29602d;p=kivitendo-erp.git diff --git a/SL/DB/Helper/TransNumberGenerator.pm b/SL/DB/Helper/TransNumberGenerator.pm index c9ed09fc0..fab4a7c00 100644 --- a/SL/DB/Helper/TransNumberGenerator.pm +++ b/SL/DB/Helper/TransNumberGenerator.pm @@ -35,6 +35,7 @@ my %specs = ( ar => { number_column => 'invnumber', part => { number_column => 'partnumber', number_range_column => 'articlenumber', scoping => \&parts_scoping, }, service => { number_column => 'partnumber', number_range_column => 'servicenumber', scoping => \&parts_scoping, }, assembly => { number_column => 'partnumber', number_range_column => 'assemblynumber', scoping => \&parts_scoping, }, + assortment => { number_column => 'partnumber', number_range_column => 'assortmentnumber', scoping => \&parts_scoping, }, ); sub get_next_trans_number { @@ -86,7 +87,7 @@ sub get_next_trans_number { dbh => $self->db->dbh, select => $number_column, tables => [ $self->meta->table ], - columns => { $self->meta->table => [ $number_column ] }, + columns => { $self->meta->table => [ $self->meta->column_names ] }, query_is_sql => 1, %conditions_for_in_use, ); @@ -97,7 +98,7 @@ sub get_next_trans_number { my $range_table = ($business ? $business : SL::DB::Default->get)->load(for_update => 1); my $start_number = $range_table->$number_range_column; - $start_number = $range_table->articlenumber if ($number_range_column eq 'assemblynumber') && (length($start_number) < 1); + $start_number = $range_table->articlenumber if ($number_range_column =~ /^(assemblynumber|assortmentnumber)$/) && (length($start_number) < 1); my $sequence = SL::PrefixedNumber->new(number => $start_number // 0); if (!$fill_holes_in_range) {