From: Thomas Heck Date: Thu, 16 Aug 2012 13:32:26 +0000 (+0200) Subject: CsvImport::Parts: Option zum Überspringen von Artikeln mit existierenden Nummern X-Git-Tag: release-3.0.0beta1~292 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=1428ab015e63e9ff087a12e5e70d406313997573;p=kivitendo-erp.git CsvImport::Parts: Option zum Überspringen von Artikeln mit existierenden Nummern implementiert #1965 --- diff --git a/SL/Controller/CsvImport/Part.pm b/SL/Controller/CsvImport/Part.pm index 3be6f2a44..3a2bdbe92 100644 --- a/SL/Controller/CsvImport/Part.pm +++ b/SL/Controller/CsvImport/Part.pm @@ -201,7 +201,7 @@ sub check_existing { if ($self->settings->{article_number_policy} eq 'update_prices') { if ($entry->{part}) { - map { $entry->{part}->$_( $object->$_ ) if defined $object->$_ } qw(sellprice listprice lastcost); + 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; @@ -210,7 +210,8 @@ sub check_existing { push @{ $entry->{information} }, $::locale->text('Updating prices of existing entry in database'); $entry->{object_to_save} = $entry->{part}; } - + } elsif ( $self->settings->{article_number_policy} eq 'skip' ) { + push(@{$entry->{errors}}, $::locale->text('Skipping due to existing entry in database')) if ( $entry->{part} ); } else { $object->partnumber('####') if $entry->{part}; } diff --git a/locale/de/all b/locale/de/all index 077f23e41..c0b483809 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1676,6 +1676,8 @@ $self->{texts} = { 'Single quotes' => 'Einfache Anführungszeichen', 'Single values in item mode, cumulated values in invoice mode' => 'Einzelwerte im Artikelmodus, kumulierte Werte im Rechnungsmodus', 'Skip' => 'Überspringen', + 'Skip entry' => 'Eintrag überspringen', + 'Skipping due to existing entry in database' => 'Übersprungen, wegen existierender Artikelnummer', 'Skonto' => 'Skonto', 'Skonto Terms' => 'Zahlungsziel Skonto', 'Sold' => 'Verkauft', diff --git a/templates/webpages/csv_import/_form_parts.html b/templates/webpages/csv_import/_form_parts.html index 4962981b1..0eea2d14f 100644 --- a/templates/webpages/csv_import/_form_parts.html +++ b/templates/webpages/csv_import/_form_parts.html @@ -3,7 +3,7 @@ [%- LxERP.t8('Parts with existing part numbers') %]: - [% opts = [ [ 'update_prices', LxERP.t8('Update prices of existing entries') ], [ 'insert_new', LxERP.t8('Insert with new part number') ] ] %] + [% opts = [ [ 'update_prices', LxERP.t8('Update prices of existing entries') ], [ 'insert_new', LxERP.t8('Insert with new part number') ], [ 'skip', LxERP.t8('Skip entry') ] ] %] [% L.select_tag('settings.article_number_policy', L.options_for_select(opts, default => SELF.profile.get('article_number_policy')), style => 'width: 300px') %]