+ if ($self->settings->{article_number_policy} eq 'update_prices_sn' || $self->settings->{article_number_policy} eq 'update_parts_sn') {
+ if (!$entry->{part}) {
+ push(@{$entry->{errors}}, $::locale->text('Skipping non-existent article'));
+ return;
+ }
+ }
+
+ ## checking also doubles in csv !!
+ foreach my $csventry (@{ $self->controller->data }) {
+ if ( $entry != $csventry && $object->partnumber eq $csventry->{object}->partnumber ) {
+ if ( $csventry->{doublechecked} ) {
+ push(@{$entry->{errors}}, $::locale->text('Skipping due to same partnumber in csv file'));
+ return;
+ }
+ }
+ }
+ $entry->{doublechecked} = 1;
+
+ if ($entry->{part}) {
+ if ($self->settings->{article_number_policy} eq 'update_prices' || $self->settings->{article_number_policy} eq 'update_prices_sn') {
+ 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};
+ $entry->{dont_handle_cvars} = 1;
+ } elsif ( $self->settings->{article_number_policy} eq 'update_parts' || $self->settings->{article_number_policy} eq 'update_parts_sn') {
+
+ # Update parts table
+ # copy only the data which is not explicit copied by "methods"
+
+ map { $entry->{part}->$_( $object->$_ ) if defined $object->$_ } qw(description notes weight ean rop image
+ drawing ve gv
+ unit
+ has_sernumber not_discountable obsolete
+ payment_id
+ sellprice listprice lastcost);
+
+ if (defined $raw->{"sellprice"} || defined $raw->{"listprice"} || defined $raw->{"lastcost"}) {