X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ff159a4d47b9a2d10744dcfc23da2c63605c8a32..eeb5375ee7727c956cc357cc8f90b19d1bfe80b9:/SL/Controller/CsvImport/Order.pm diff --git a/SL/Controller/CsvImport/Order.pm b/SL/Controller/CsvImport/Order.pm index 503b4d185..b8adc456e 100644 --- a/SL/Controller/CsvImport/Order.pm +++ b/SL/Controller/CsvImport/Order.pm @@ -14,7 +14,6 @@ use SL::DB::PaymentTerm; use SL::DB::Contact; use SL::DB::Department; use SL::DB::PriceFactor; -use SL::DB::Pricegroup; use SL::DB::Project; use SL::DB::Shipto; use SL::DB::TaxZone; @@ -26,7 +25,7 @@ use parent qw(SL::Controller::CsvImport::BaseMulti); use Rose::Object::MakeMethods::Generic ( - 'scalar --get_set_init' => [ qw(settings languages_by all_parts parts_by part_counts_by contacts_by ct_shiptos_by price_factors_by pricegroups_by units_by) ], + 'scalar --get_set_init' => [ qw(settings languages_by all_parts parts_by part_counts_by contacts_by ct_shiptos_by price_factors_by units_by) ], ); @@ -250,13 +249,6 @@ sub init_price_factors_by { return { map { my $col = $_; ( $col => { map { ( $_->$col => $_ ) } @{ $all_price_factors } } ) } qw(id description) }; } -sub init_pricegroups_by { - my ($self) = @_; - - my $all_pricegroups = SL::DB::Manager::Pricegroup->get_all; - return { map { my $col = $_; ( $col => { map { ( $_->$col => $_ ) } @{ $all_pricegroups } } ) } qw(id pricegroup) }; -} - sub init_units_by { my ($self) = @_; @@ -648,31 +640,6 @@ sub check_price_factor { return 1; } -sub check_pricegroup { - my ($self, $entry) = @_; - - my $object = $entry->{object}; - - # Check whether or not pricegroup ID is valid. - if ($object->pricegroup_id && !$self->pricegroups_by->{id}->{ $object->pricegroup_id }) { - push @{ $entry->{errors} }, $::locale->text('Error: Invalid price group'); - return 0; - } - - # Map pricegroup to ID if given. - if (!$object->pricegroup_id && $entry->{raw_data}->{pricegroup}) { - my $pricegroup = $self->pricegroups_by->{pricegroup}->{ $entry->{raw_data}->{pricegroup} }; - if (!$pricegroup) { - push @{ $entry->{errors} }, $::locale->text('Error: Invalid price group'); - return 0; - } - - $object->pricegroup_id($pricegroup->id); - } - - return 1; -} - sub add_items_to_order { my ($self) = @_;