]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DATEV/CSV.pm
Verkaufsbericht: Transportmittel in Bericht mitausgeben
[mfinanz.git] / SL / DATEV / CSV.pm
index 05cc309c2dd09423c676d8a808a194b6da3d5dda..05598b12a38880597c4325cc13aa54034402f554 100644 (file)
@@ -11,6 +11,7 @@ use SL::DB::Chart;
 use SL::Helper::DateTime;
 use SL::Locale::String qw(t8);
 use SL::Util qw(trim);
+use SL::VATIDNr;
 
 use Rose::Object::MakeMethods::Generic (
   scalar => [ qw(datev_lines from to locked warnings) ],
@@ -134,6 +135,7 @@ my @kivitendo_to_datev = (
                                                        my ($text) = @_; check_encoding($text); },
                               valid_check     => sub { return 1 if     $::instance_conf->get_datev_export_format eq 'cp1252';
                                                        my ($text) = @_; check_encoding($text); },
+                              formatter       => sub { my ($input) = @_; return substr($input, 0, 60) },
                             },  # pos 14
                             {
                               kivi_datev_name => 'not yet implemented',
@@ -239,14 +241,13 @@ my @kivitendo_to_datev = (
                               input_check     => sub {
                                                        my ($ustid) = @_;
                                                        return 1 if ('' eq $ustid);
-                                                       $ustid =~ s{\s+}{}g;
-                                                       return ($ustid =~ m/^CH|^[A-Z]{2}\w{5,13}$/);
+                                                       return SL::VATIDNr->validate($ustid);
                                                      },
                               formatter       => sub { my ($input) = @_; $input =~ s/\s//g; return $input },
                               valid_check     => sub {
                                                        my ($ustid) = @_;
                                                        return 1 if ('' eq $ustid);
-                                                       return ($ustid =~ m/^CH|^[A-Z]{2}\w{5,13}$/);
+                                                       return SL::VATIDNr->validate($ustid);
                                                      },
                             }, # pos 40
                             {