DATEV:CSV nicht gesetztes Fälligkeitsdatum für Belegfeld2 akzeptieren
authorJan Büren <jan@kivitendo-premium.de>
Mon, 4 Dec 2017 10:27:08 +0000 (11:27 +0100)
committerJan Büren <jan@kivitendo-premium.de>
Mon, 4 Dec 2017 10:27:08 +0000 (11:27 +0100)
Ferner Format auch WIRKLICH sechstellig DDMMYY (cherry-pick verdaddelt)

SL/DATEV/CSV.pm

index 1717bdf..9ac29c0 100644 (file)
@@ -111,9 +111,9 @@ my @kivitendo_to_datev = (
                               max_length      => 12,
                               type            => 'Text',
                               default         => '',
-                              input_check     => sub { my ($check) = @_; return (ref (DateTime->from_kivitendo($check)) eq 'DateTime') },
-                              formatter       => sub { my ($input) = @_; return DateTime->from_kivitendo($input)->strftime('%d%m') },
-                              valid_check     => sub { my ($check) = @_; return ($check =~ m/^[0-9]{4}$/) },
+                              input_check     => sub { my ($check) = @_; return 1 unless $check; return (ref (DateTime->from_kivitendo($check)) eq 'DateTime') },
+                              formatter       => sub { my ($input) = @_; return DateTime->from_kivitendo($input)->strftime('%d%m%y') },
+                              valid_check     => sub { my ($check) = @_; return ($check =~ m/^[0-9]{6}$/) },
                             },
                             {
                               kivi_datev_name => 'not yet implemented',