X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/ab77e6ef5c003f4b3627f7c94d4b40c7eefb9478..e1f93c184a9f6fe0826306383f23c454011dc9b3:/SL/GDPDU.pm diff --git a/SL/GDPDU.pm b/SL/GDPDU.pm index ed3b6312d..8a2ae27bf 100644 --- a/SL/GDPDU.pm +++ b/SL/GDPDU.pm @@ -304,7 +304,7 @@ sub do_datev_xml_table { my $writer = $self->writer; $self->tag('Table', sub { $self - ->tag('URL', "transaction.csv") + ->tag('URL', "transactions.csv") ->tag('Name', t8('Transactions')) ->tag('Description', t8('Transactions')) ->tag('Validity', sub { $self @@ -405,8 +405,6 @@ sub do_datev_csv_export { $haben->{notes} = ($haben->{memo} || $soll->{memo}) if $haben->{memo} || $soll->{memo}; $haben->{notes} //= ''; $haben->{notes} = SL::HTML::Util->strip($haben->{notes}); - $haben->{notes} =~ s{\r}{}g; - $haben->{notes} =~ s{\n+}{ }g; my %row = ( amount => $::form->format_amount($myconfig, abs($amount->{amount}),5), @@ -420,6 +418,8 @@ sub do_datev_csv_export { (map { ($_ => ($haben->{$_} // $soll->{$_})) } qw(acc_trans_id invnumber name vcnumber transdate itime customer_id vendor_id)), ); + _normalize_cell($_) for values %row; # see CAVEATS + $csv->print($fh, [ map { $row{$_} } @datev_columns ]); } @@ -494,7 +494,7 @@ sub do_csv_export { $self->export_ids->{$table}{$keep_col} ||= {}; $self->export_ids->{$table}{$keep_col}{$row->[$col_index{$keep_col}]}++; } - s/\r\n/ /g for @$row; # see CAVEATS + _normalize_cell($_) for @$row; # see CAVEATS $csv->print($fh, $row) or $csv->error_diag; } @@ -550,6 +550,11 @@ sub all_tables { $self->tables(\@export_table_order) if $yesno; } +sub _normalize_cell { + $_[0] =~ s/\r\n/ /g; + $_[0] =~ s/,/;/g; +} + sub init_files { +{} } sub init_export_ids { +{} } sub init_tempfiles { [] } @@ -689,6 +694,17 @@ The CSV import library used in IDEA is not able to parse newlines (or more exactly RecordDelimiter) in data. So this export substites all of these with spaces. +=item * + +Neither it is able to parse escaped C in data. It just splits +on that symbol no matter what surrounds or preceeds it. + +=item * + +Fun fact: Some auditors do not have a full license of the IDEA software, and +can't do table joins. So it's best to provide denormalized data for them, so +that the auditor may infer which object is meant. + =back =head1 AUTHOR