X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/f16b77358a0cbedf9681c6ea95bd2a076b8b78a9..3bb3a4a56b0be39fd60f011137ffbadd9dba3fd7:/SL/GDPDU.pm diff --git a/SL/GDPDU.pm b/SL/GDPDU.pm index 7ba9b7425..23ba96158 100644 --- a/SL/GDPDU.pm +++ b/SL/GDPDU.pm @@ -1,7 +1,6 @@ package SL::GDPDU; # TODO: -# translations # optional: background jobable use strict; @@ -64,8 +63,8 @@ my $date_format = 'DD.MM.YYYY'; # callbacks that produce the xml spec for these column types my %column_types = ( - 'Rose::DB::Object::Metadata::Column::Integer' => sub { $_[0]->tag('Numeric', sub { $_[0]->tag('Accuracy', 0) }) }, - 'Rose::DB::Object::Metadata::Column::BigInt' => sub { $_[0]->tag('Numeric', sub { $_[0]->tag('Accuracy', 0) }) }, + 'Rose::DB::Object::Metadata::Column::Integer' => sub { $_[0]->tag('Numeric') }, # see Caveats for integer issues + 'Rose::DB::Object::Metadata::Column::BigInt' => sub { $_[0]->tag('Numeric') }, # see Caveats for integer issues 'Rose::DB::Object::Metadata::Column::Text' => sub { $_[0]->tag('AlphaNumeric') }, 'Rose::DB::Object::Metadata::Column::Varchar' => sub { $_[0]->tag('AlphaNumeric') }, 'Rose::DB::Object::Metadata::Column::Character' => sub { $_[0]->tag('AlphaNumeric') }, @@ -73,7 +72,8 @@ my %column_types = ( 'Rose::DB::Object::Metadata::Column::Date' => sub { $_[0]->tag('Date', sub { $_[0]->tag('Format', $date_format) }) }, 'Rose::DB::Object::Metadata::Column::Timestamp' => sub { $_[0]->tag('Date', sub { $_[0]->tag('Format', $date_format) }) }, 'Rose::DB::Object::Metadata::Column::Float' => sub { $_[0]->tag('Numeric') }, - 'Rose::DB::Object::Metadata::Column::Boolean' => sub { $_[0]->tag('AlphaNumeric', sub { $_[0] + 'Rose::DB::Object::Metadata::Column::Boolean' => sub { $_[0] + ->tag('AlphaNumeric') ->tag('Map', sub { $_[0] ->tag('From', 1) ->tag('To', t8('true')) @@ -83,10 +83,10 @@ my %column_types = ( ->tag('To', t8('false')) }) ->tag('Map', sub { $_[0] - ->tag('From', 0) + ->tag('From', '') ->tag('To', t8('false')) }) - }) }, + }, ); sub generate_export { @@ -180,8 +180,7 @@ sub table { ->tag('DecimalSymbol', '.') ->tag('DigitGroupingSymbol', '|') # see CAVEATS in documentation ->tag('VariableLength', sub { $self - ->tag('ColumnDelimiter', ',') - ->tag('RecordDelimiter', '&x0A;') + ->tag('ColumnDelimiter', ',') # see CAVEATS for missing RecordDelimiter ->tag('TextEncapsulator', '"') ->columns($table) ->foreign_keys($table) @@ -258,7 +257,7 @@ sub foreign_keys { sub do_csv_export { my ($self, $table) = @_; - my $csv = Text::CSV_XS->new({ binary => 1, eol => "\n", sep_char => ",", quote_char => '"' }); + my $csv = Text::CSV_XS->new({ binary => 1, eol => "\r\n", sep_char => ",", quote_char => '"' }); my ($fh, $filename) = File::Temp::tempfile(); binmode($fh, ':utf8'); @@ -452,8 +451,9 @@ and C