]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/GDPDU.pm
GDPDU: Weitere fixes
[kivitendo-erp.git] / SL / GDPDU.pm
index 7ba9b74259621f212e17739adf88c2a4a65ec276..23ba96158080c519a1774ea431af67c00e9aee33 100644 (file)
@@ -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<DD> are supported, timestamps do not exist.
 
 =item *
 
-Number pasing seems to be fragile. Official docs state that behaviour for too
-low C<Accuracy> settings is undefined.
+Number parsing seems to be fragile. Official docs state that behaviour for too
+low C<Accuracy> 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.
 
@@ -491,6 +491,23 @@ response actually was:
 
 L<http://www.gdpdu-portal.com/forum/index.php?mode=thread&id=1392>
 
+=item *
+
+It is not possible to define a C<RecordDelimiter> with XML entities. &#x0A;
+generates the error message:
+
+  C<RecordDelimiter>-Wert (&#x0A;) 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