Waren-CSV-Import: Einlesen des Einkaufspreises ins makemodel
authorThomas Heck <theck@linet-services.de>
Mon, 20 Aug 2012 09:13:07 +0000 (11:13 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 22 Aug 2012 12:03:17 +0000 (14:03 +0200)
SL/Controller/CsvImport/Part.pm
locale/de/all

index 3a2bdbe..5d203a9 100644 (file)
@@ -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')                                             },
index 8060572..b3ab54b 100644 (file)
@@ -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&uuml;r lokale Verbindungen "Rechner" und "Port" freilassen.',
   'Left'                        => 'Links',