From e1f93c184a9f6fe0826306383f23c454011dc9b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 4 Nov 2015 10:19:20 +0100 Subject: [PATCH] =?utf8?q?GDPDU:=20Zellennormalisierung=20auch=20f=C3=BCr?= =?utf8?q?=20transactions?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ausserdem , durch ; ersetzt. --- SL/GDPDU.pm | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/SL/GDPDU.pm b/SL/GDPDU.pm index 8d86bc483..8a2ae27bf 100644 --- a/SL/GDPDU.pm +++ b/SL/GDPDU.pm @@ -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,7 +418,7 @@ sub do_datev_csv_export { (map { ($_ => ($haben->{$_} // $soll->{$_})) } qw(acc_trans_id invnumber name vcnumber transdate itime customer_id vendor_id)), ); - $row{$_} =~ s/\r?\n/ /g for @datev_columns; # see CAVEATS + _normalize_cell($_) for values %row; # see CAVEATS $csv->print($fh, [ map { $row{$_} } @datev_columns ]); } @@ -496,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; } @@ -552,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 { [] } @@ -691,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 -- 2.20.1