X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FCsvImport%2FOrder.pm;h=2f6b4e7a3cd9fd1d17a8098bd0133cf00fb135da;hb=38f974a2140303118c2241ba95bde1703be5a237;hp=31c786fde52ea54f4907ba5afed95114e5fed3fe;hpb=1d61ec90d7377633c8cd846526f2ef88603fd3f0;p=kivitendo-erp.git diff --git a/SL/Controller/CsvImport/Order.pm b/SL/Controller/CsvImport/Order.pm index 31c786fde..2f6b4e7a3 100644 --- a/SL/Controller/CsvImport/Order.pm +++ b/SL/Controller/CsvImport/Order.pm @@ -25,7 +25,7 @@ use parent qw(SL::Controller::CsvImport::BaseMulti); use Rose::Object::MakeMethods::Generic ( - 'scalar --get_set_init' => [ qw(settings languages_by parts_by contacts_by departments_by projects_by ct_shiptos_by taxzones_by price_factors_by pricegroups_by) ], + 'scalar --get_set_init' => [ qw(settings languages_by parts_by contacts_by departments_by projects_by ct_shiptos_by price_factors_by pricegroups_by) ], ); @@ -227,13 +227,6 @@ sub init_ct_shiptos_by { return $sby; } -sub init_taxzones_by { - my ($self) = @_; - - my $all_taxzones = SL::DB::Manager::TaxZone->get_all; - return { map { my $col = $_; ( $col => { map { ( $_->$col => $_ ) } @{ $all_taxzones } } ) } qw(id description) }; -} - sub init_price_factors_by { my ($self) = @_; @@ -574,31 +567,6 @@ sub check_ct_shipto { return 1; } -sub check_taxzone { - my ($self, $entry) = @_; - - my $object = $entry->{object}; - - # Check wether or not taxzone ID is valid. - if ($object->taxzone_id && !$self->taxzones_by->{id}->{ $object->taxzone_id }) { - push @{ $entry->{errors} }, $::locale->text('Error: Invalid tax zone'); - return 0; - } - - # Map description to ID if given. - if (!$object->taxzone_id && $entry->{raw_data}->{taxzone}) { - my $taxzone = $self->taxzones_by->{description}->{ $entry->{raw_data}->{taxzone} }; - if (!$taxzone) { - push @{ $entry->{errors} }, $::locale->text('Error: Invalid tax zone'); - return 0; - } - - $object->taxzone_id($taxzone->id); - } - - return 1; -} - sub check_price_factor { my ($self, $entry) = @_;