From 982f53983fed52367985246082546fda053d59d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Mon, 4 Dec 2017 11:05:25 +0100 Subject: [PATCH] =?utf8?q?DATEV=20belegfeld2=20wieder=20als=20F=C3=A4lligk?= =?utf8?q?eitsfeld=20im=20Format=20DDMMYY=20implementiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DATEV/CSV.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SL/DATEV/CSV.pm b/SL/DATEV/CSV.pm index 6d6594582..1717bdf2e 100644 --- a/SL/DATEV/CSV.pm +++ b/SL/DATEV/CSV.pm @@ -106,12 +106,14 @@ my @kivitendo_to_datev = ( formatter => sub { my ($input) = @_; return substr($input, 0, 12) }, }, { - kivi_datev_name => 'not yet implemented', + kivi_datev_name => 'belegfeld2', csv_header_name => t8('Invoice Field 2'), max_length => 12, type => 'Text', default => '', - valid_check => sub { my ($check) = @_; return ($check =~ m/[ -~]{1,12}/) }, + input_check => sub { my ($check) = @_; return (ref (DateTime->from_kivitendo($check)) eq 'DateTime') }, + formatter => sub { my ($input) = @_; return DateTime->from_kivitendo($input)->strftime('%d%m') }, + valid_check => sub { my ($check) = @_; return ($check =~ m/^[0-9]{4}$/) }, }, { kivi_datev_name => 'not yet implemented', -- 2.20.1