From 80fad2fdbd0c7b23f7eba1b46ad49a4207780946 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Tue, 21 Aug 2018 15:47:14 +0200 Subject: [PATCH] DATEV-CSV-Export Belegfeld 2 6- oder 5-stellig formatieren MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ansonsten gibt es bei führenden 0en immer eine Warnung beim DATEV-Import. --- SL/DATEV/CSV.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SL/DATEV/CSV.pm b/SL/DATEV/CSV.pm index c613267a7..faa2b8ddb 100644 --- a/SL/DATEV/CSV.pm +++ b/SL/DATEV/CSV.pm @@ -112,8 +112,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) = @_; my $date = DateTime->from_kivitendo($input)->strftime('%e%m%y'); $date =~ s/^\s+//; return $date }, + valid_check => sub { my ($check) = @_; return ($check =~ m/^[0-9]{5,6}$/) }, }, { kivi_datev_name => 'not yet implemented', -- 2.20.1