Pflichtenheftversion nach Ă„nderung Basisdaten invalidieren
[kivitendo-erp.git] / SL / Helper / Csv / Dispatcher.pm
index a744892..3a725b5 100644 (file)
@@ -106,19 +106,14 @@ sub is_known {
 sub parse_profile {
   my ($self, %params) = @_;
 
-  my $profile;
-  my $class;
   my @specs;
 
+  my $csv_profile = $self->_csv->profile;
+  my $h_aref = ($self->_csv->is_multiplexed)? $self->_csv->header : [ $self->_csv->header ];
   my $i = 0;
-  foreach my $header (@{ $self->_csv->header }) {
-    if ($self->_csv->profile) {
-      $profile = $self->_csv->profile->[$i]->{profile};
-      $class   = $self->_csv->profile->[$i]->{class};
-    }
-
-    my $spec = $self->_parse_profile(profile => $profile,
-                                     class   => $class,
+  foreach my $header (@{ $h_aref }) {
+    my $spec = $self->_parse_profile(profile => $csv_profile->[$i]->{profile},
+                                     class   => $csv_profile->[$i]->{class},
                                      header  => $header);
     push @specs, $spec;
     $i++;