X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FCsvImport%2FPart.pm;h=d707aaafd3603898198fcf2475015ae691c1d82f;hb=60e09e25d76ec7c0a4f8431df0bc7a3b25e9041a;hp=ca9d22a93427a2eb97677e2e32968a5a07c688ad;hpb=d0535d474013611f57691dee2e4542115a4f0123;p=kivitendo-erp.git diff --git a/SL/Controller/CsvImport/Part.pm b/SL/Controller/CsvImport/Part.pm index ca9d22a93..d707aaafd 100644 --- a/SL/Controller/CsvImport/Part.pm +++ b/SL/Controller/CsvImport/Part.pm @@ -198,7 +198,12 @@ sub check_existing { if ($self->settings->{article_number_policy} eq 'update_prices') { if ($entry->{part}) { - map { $entry->{part}->$_( $object->$_ ) } qw(sellprice listprice lastcost prices); + map { $entry->{part}->$_( $object->$_ ) if defined $object->$_ } qw(sellprice listprice lastcost); + + # merge prices + my %prices_by_pricegroup_id = map { $_->pricegroup->id => $_ } $entry->{part}->prices, $object->prices; + $entry->{part}->prices(grep { $_ } map { $prices_by_pricegroup_id{$_->id} } @{ $self->all_pricegroups }); + push @{ $entry->{information} }, $::locale->text('Updating prices of existing entry in database'); $entry->{object_to_save} = $entry->{part}; }