X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FCsvImport.pm;h=0ebf141645117dd114b558efc4a8d16c6bcf7c4b;hb=cac2ae9bcd47fc55d35c37e25dbb03cd6ac6edeb;hp=f21cd2a46fc5d3f5dc720ffc1a5d3abff3b2b4d5;hpb=48da03126f83ad6f3406b8c70a077ab52e18823d;p=kivitendo-erp.git diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index f21cd2a46..0ebf14164 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -127,12 +127,12 @@ sub action_download_sample { my $csv = Text::CSV_XS->new({ binary => 1, map { ( $_ => $self->profile->get($_) ) } qw(sep_char escape_char quote_char),}); if ($self->worker->is_multiplexed) { - foreach my $ri (keys %{ $self->displayable_columns }) { - $csv->print($file->fh, [ map { $_->{name} } @{ $self->displayable_columns->{$ri} } ]); + foreach my $p (@{ $self->worker->profile }) { + $csv->print($file->fh, [ map { $_->{name} } @{ $self->displayable_columns->{$p->{row_ident}} } ]); $file->fh->print("\r\n"); } - foreach my $ri (keys %{ $self->displayable_columns }) { - $csv->print($file->fh, [ map { $_->{description} } @{ $self->displayable_columns->{$ri} } ]); + foreach my $p (@{ $self->worker->profile }) { + $csv->print($file->fh, [ map { $_->{description} } @{ $self->displayable_columns->{$p->{row_ident}} } ]); $file->fh->print("\r\n"); } } else { @@ -557,7 +557,7 @@ sub save_report_multi { my $row_ident = $self->worker->profile->[$i]->{row_ident}; my $n_info_methods = $info_methods->{$row_ident} ? scalar @{ $info_methods->{$row_ident} } : 0; my $n_methods = $methods->{$row_ident} ? scalar @{ $methods->{$row_ident} } : 0; - + $off1->{$row_ident} = $n_info_methods; $off2->{$row_ident} = $off1->{$row_ident} + $n_methods; } @@ -571,7 +571,7 @@ sub save_report_multi { my $o1 = $off1->{$row_ident}; my $o2 = $off2->{$row_ident}; - + $sth->execute($report->id, $_, $row + $n_header_rows, $data_row->{info_data}{ $info_methods->{$row_ident}->[$_] }) for 0 .. $#{ $info_methods->{$row_ident} }; $sth->execute($report->id, $o1 + $_, $row + $n_header_rows, $data_row->{object}->${ \ $methods->{$row_ident}->[$_] }) for 0 .. $#{ $methods->{$row_ident} }; $sth->execute($report->id, $o2 + $_, $row + $n_header_rows, $data_row->{raw_data}{ $raw_methods->{$row_ident}->[$_] }) for 0 .. $#{ $raw_methods->{$row_ident} };