From 5497ac6c0fa81bdce28c33b191a5348e10042fd6 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Mon, 20 Aug 2012 11:13:07 +0200 Subject: [PATCH] Waren-CSV-Import: Einlesen des Einkaufspreises ins makemodel --- SL/Controller/CsvImport/Part.pm | 9 ++++++--- locale/de/all | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/SL/Controller/CsvImport/Part.pm b/SL/Controller/CsvImport/Part.pm index 3a2bdbe92..5d203a9a5 100644 --- a/SL/Controller/CsvImport/Part.pm +++ b/SL/Controller/CsvImport/Part.pm @@ -129,7 +129,7 @@ sub check_objects { $self->add_cvar_raw_data_columns; map { $self->add_raw_data_columns("pricegroup_${_}") } (1..scalar(@{ $self->all_pricegroups })); map { $self->add_raw_data_columns($_) if exists $self->controller->data->[0]->{raw_data}->{$_} } @{ $self->translation_columns }; - map { $self->add_raw_data_columns("make_${_}", "model_${_}") } sort { $a <=> $b } keys %{ $self->makemodel_columns }; + map { $self->add_raw_data_columns("make_${_}", "model_${_}", "lastcost_${_}") } sort { $a <=> $b } keys %{ $self->makemodel_columns }; } sub check_duplicates { @@ -379,8 +379,10 @@ sub handle_makemodel { push @{ $entry->{errors} }, $::locale->text('Error: Invalid vendor in column make_#1', $idx); } else { - push @makemodels, SL::DB::MakeModel->new(make => $vendor->id, - model => $entry->{raw_data}->{"model_${idx}"}); + push @makemodels, SL::DB::MakeModel->new(make => $vendor->id, + model => $entry->{raw_data}->{"model_${idx}"}, + lastcost_as_number => $entry->{raw_data}->{"lastcost_${idx}"}); + $self->makemodel_columns->{$idx} = 1; $entry->{raw_data}->{"make_${idx}"} = $vendor->name; } @@ -438,6 +440,7 @@ sub setup_displayable_columns { { name => 'make_X', description => $::locale->text('Make (with X being a number)') }, { name => 'microfiche', description => $::locale->text('Microfiche') }, { name => 'model_X', description => $::locale->text('Model (with X being a number)') }, + { name => 'lastcost_X', description => $::locale->text('Lastcost (with X being a number)') }, { name => 'not_discountable', description => $::locale->text('Not Discountable') }, { name => 'notes', description => $::locale->text('Notes') }, { name => 'obsolete', description => $::locale->text('Obsolete') }, diff --git a/locale/de/all b/locale/de/all index 8060572ed..b3ab54bb8 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1065,6 +1065,7 @@ $self->{texts} = { 'Last Service Number' => 'Letzte Dienstleistungsnr.', 'Last Transaction' => 'Letzte Buchung', 'Last Vendor Number' => 'Letzte Lieferantennummer', + 'Lastcost (with X being a number)' => 'Einkaufspreis (X ist eine fortlaufende Zahl)', 'Lead' => 'Kundenquelle', 'Leave host and port field empty unless you want to make a remote connection.' => 'Für lokale Verbindungen "Rechner" und "Port" freilassen.', 'Left' => 'Links', -- 2.20.1