Revision 85f9e495
Von Sven Schöling vor etwa 10 Jahren hinzugefügt
SL/Controller/CsvImport/Part.pm | ||
---|---|---|
428 | 428 |
} |
429 | 429 |
|
430 | 430 |
my %old_makemodels_by_mm = map { $_->make . $; . $_->model => $_ } $entry->{part}->makemodels; |
431 |
my @new_makemodels; |
|
431 | 432 |
|
432 | 433 |
foreach my $makemodel ($object->makemodels()) { |
433 | 434 |
my $makemodel_orig = $old_makemodels_by_mm{$makemodel->make,$makemodel->model}; |
... | ... | |
438 | 439 |
$makemodel_orig->lastcost($makemodel->lastcost); |
439 | 440 |
|
440 | 441 |
} else { |
441 |
$entry->{part}->add_makemodels($makemodel);
|
|
442 |
push @new_makemodels, $makemodel;
|
|
442 | 443 |
} |
443 | 444 |
} |
444 | 445 |
|
446 |
$entry->{part}->makemodels([ $entry->{part}->makemodels, @new_makemodels ]) if @new_makemodels; |
|
447 |
|
|
445 | 448 |
# reindex makemodels |
446 | 449 |
my $i = 0; |
447 | 450 |
$_->sortorder(++$i) for @{ $entry->{part}->makemodels }; |
Auch abrufbar als: Unified diff
CsvImport: Makemodels auch auf instabilen Datenbanken in der richtigen Reihenfolge speichern