X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/6f1b36cfb8b26f6c8540ba5f36e48b9188d9470a..0c537bffbf60f078202ca72977b3e35f2e0f0fd7:/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;