X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/0ac8d01cb66f67974aea2a00cbccfa59d682752a..0b26e5752e295:/SL/DATEV/CSV.pm diff --git a/SL/DATEV/CSV.pm b/SL/DATEV/CSV.pm index c613267a7..908347a44 100644 --- a/SL/DATEV/CSV.pm +++ b/SL/DATEV/CSV.pm @@ -10,6 +10,7 @@ use SL::DB::Datev; use SL::DB::Chart; use SL::Helper::DateTime; use SL::Locale::String qw(t8); +use SL::Util qw(trim); use Rose::Object::MakeMethods::Generic ( scalar => [ qw(datev_lines from to locked warnings) ], @@ -112,8 +113,8 @@ my @kivitendo_to_datev = ( type => 'Text', default => '', 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}$/) }, + formatter => sub { my ($input) = @_; return trim(DateTime->from_kivitendo($input)->strftime('%e%m%y')) }, + valid_check => sub { my ($check) = @_; return ($check =~ m/^[0-9]{5,6}$/) }, }, { kivi_datev_name => 'not yet implemented', @@ -548,4 +549,3 @@ becaus warnings are generated after the call to lines: my $lines = $datev_csv->lines; die if @{ $datev_csv->warnings }; somethin_with($lines); -