X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/fdac215685fca7fbe271fa550275f1937ff85383..66daa8388cbb955df03835c57f9e410e0dd38b18:/SL/Controller/CsvImport/Part.pm diff --git a/SL/Controller/CsvImport/Part.pm b/SL/Controller/CsvImport/Part.pm index 763793243..75adc9778 100644 --- a/SL/Controller/CsvImport/Part.pm +++ b/SL/Controller/CsvImport/Part.pm @@ -436,13 +436,16 @@ sub handle_makemodel { if ($makemodel_orig) { $makemodel_orig->model($makemodel->model); $makemodel_orig->lastcost($makemodel->lastcost); - $makemodel_orig->sortorder(undef); } else { $entry->{part}->add_makemodels($makemodel); } } + # reindex makemodels + my $i = 0; + $_->sortorder(++$i) for @{ $entry->{part}->makemodels }; + $entry->{part}->makemodel($object->makemodel); $self->save_with_cascade(1) if $found_any;