From: Sven Schöling Date: Thu, 12 Apr 2012 09:58:39 +0000 (+0200) Subject: Besseres Handling von unvollständigen Preisgruppenimporten X-Git-Tag: release-3.0.0beta1~344^2~1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8ecc78d62b34b2c05ec6151e6e719a6a4df4f883;p=kivitendo-erp.git Besseres Handling von unvollständigen Preisgruppenimporten --- diff --git a/SL/Controller/CsvImport/Part.pm b/SL/Controller/CsvImport/Part.pm index ca9d22a93..387bdb5f2 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->$_ ) } 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}; }