X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/153719dfd5244cc0e6bb37954623269a8a666536..f7a1243e53114c1917ea0836a5839ed0918553b4:/SL/DATEV/CSV.pm diff --git a/SL/DATEV/CSV.pm b/SL/DATEV/CSV.pm index bc8f1bd01..6ac460c44 100644 --- a/SL/DATEV/CSV.pm +++ b/SL/DATEV/CSV.pm @@ -22,7 +22,7 @@ my @kivitendo_to_datev = ( max_length => 13, type => 'Value', required => 1, - input_check => sub { my ($input) = @_; return (looks_like_number($input) && length($input) <= 13 && $input > 0) }, + input_check => sub { my ($input) = @_; return (looks_like_number($input) && length($input) <= 13 && $input >= 0) }, formatter => \&_format_amount, valid_check => sub { my ($check) = @_; return ($check =~ m/^\d{1,10}(\,\d{1,2})?$/) }, }, @@ -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);