From: Sven Schöling Date: Mon, 29 Jan 2018 16:54:11 +0000 (+0100) Subject: CsvImport: Makemodels bei bestehenden Waren stabil sortieren X-Git-Tag: release-3.5.4~487 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a7f02ca024d1fb4154c31381600081f7a7bf4039;p=kivitendo-erp.git CsvImport: Makemodels bei bestehenden Waren stabil sortieren --- diff --git a/SL/Controller/CsvImport/Part.pm b/SL/Controller/CsvImport/Part.pm index d337550b0..f04e7d632 100644 --- a/SL/Controller/CsvImport/Part.pm +++ b/SL/Controller/CsvImport/Part.pm @@ -667,7 +667,7 @@ sub handle_makemodel { my %old_makemodels_by_mm = map { $_->make . $; . $_->model => $_ } $entry->{part}->makemodels; my @new_makemodels; - foreach my $makemodel ($object->makemodels()) { + foreach my $makemodel (@{ $object->makemodels_sorted }) { my $makemodel_orig = $old_makemodels_by_mm{$makemodel->make,$makemodel->model}; $found_any = 1; @@ -680,11 +680,11 @@ sub handle_makemodel { } } - $entry->{part}->makemodels([ $entry->{part}->makemodels, @new_makemodels ]) if @new_makemodels; + $entry->{part}->makemodels([ $entry->{part}->makemodels_sorted, @new_makemodels ]) if @new_makemodels; # reindex makemodels my $i = 0; - $_->sortorder(++$i) for @{ $entry->{part}->makemodels }; + $_->sortorder(++$i) for @{ $entry->{part}->makemodels_sorted }; $self->save_with_cascade(1) if $found_any; }