]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/CsvImport/Order.pm
kivitendo 3.9.2-0.2
[mfinanz.git] / SL / Controller / CsvImport / Order.pm
index 503b4d18547cce5dd8d66ec616b3e01650a3e1ea..b8adc456e1902018ff8ec4f0261be7bc2bf85c79 100644 (file)
@@ -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) = @_;