DATEV: auch Punkte in UStID-Nummern automatisch entfernen
[kivitendo-erp.git] / SL / DATEV / CSV.pm
index bc8f1bd..5c1e7ec 100644 (file)
@@ -228,8 +228,13 @@ my @kivitendo_to_datev = (
                               max_length      => 15,
                               type            => 'Text',
                               default         => '',
-                              input_check     => sub { my ($check) = @_; return ($check eq '' || $check =~ m/[A-Z]{2}\w{5,13}/) },
-                              formatter       => sub { my ($input) = @_; $input =~ s/\s//g; return $input },
+                              input_check     => sub {
+                                                       my ($ustid) = @_;
+                                                       return 1 if ('' eq $ustid);
+                                                       $ustid =~ s{[\s.]+}{}g;
+                                                       return ($ustid =~ m/^CH|^[A-Z]{2}\w{5,13}$/);
+                                                     },
+                              formatter       => sub { my ($input) = @_; $input =~ s/[\s.]+//g; return $input },
                               valid_check     => sub {
                                                        my ($ustid) = @_;
                                                        return 1 if ('' eq $ustid);