X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/11e509315cee0449974caa6d681fa26e730bbeca..3bb3a4a56b0be39fd60f011137ffbadd9dba3fd7:/SL/GDPDU.pm diff --git a/SL/GDPDU.pm b/SL/GDPDU.pm index cccc0527e..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 { @@ -178,8 +178,10 @@ sub table { ->tag('Format', $date_format) }) ->tag('DecimalSymbol', '.') - ->tag('DigitGroupingSymbol', '') + ->tag('DigitGroupingSymbol', '|') # see CAVEATS in documentation ->tag('VariableLength', sub { $self + ->tag('ColumnDelimiter', ',') # see CAVEATS for missing RecordDelimiter + ->tag('TextEncapsulator', '"') ->columns($table) ->foreign_keys($table) }) @@ -255,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'); @@ -449,8 +451,9 @@ and C
are supported, timestamps do not exist. =item * -Number pasing seems to be fragile. Official docs state that behaviour for too -low C settings is undefined. +Number parsing seems to be fragile. Official docs state that behaviour for too +low C settings is undefined. Accuracy of 0 is not taken to mean +Integer but instead generates a warning for redudancy. There is no dedicated integer type. @@ -475,6 +478,36 @@ Hopefully there are no bugs there. It's currently disallowed to export the whole dataset. It's not clear if this is wanted. +=item * + +It is not possible to set an empty C since then the import +will just work with the default. This was asked in their forum, and the +response actually was: + + Einfache Lösung: Definieren Sie das Tausendertrennzeichen als Komma, auch + wenn es nicht verwendet wird. Sollten Sie das Komma bereits als Feldtrenner + verwenden, so wählen Sie als Tausendertrennzeichen eine Alternative wie das + Pipe-Symbol |. + +L + +=item * + +It is not possible to define a C with XML entities. +generates the error message: + + C-Wert ( ) sollte immer aus ein oder zwei Zeichen + bestehen. + +Instead we just use the implicit default RecordDelimiter CRLF. + +=item * + +Not confirmed yet: + +Foreign keys seem only to work with previously defined tables (which would be +utterly insane). + =back =head1 AUTHOR