From 46f028ef78a55580e7e33c2439cedd0e60bde998 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Thu, 18 Jun 2020 13:53:56 +0200 Subject: [PATCH] S:DATEV:CSV: Lieferdatum als Leistungsdatum exportieren --- SL/DATEV.pm | 5 ++++- SL/DATEV/CSV.pm | 11 +++++++++-- locale/de/all | 1 + locale/en/all | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/SL/DATEV.pm b/SL/DATEV.pm index 3766c1b60..026ec05cb 100644 --- a/SL/DATEV.pm +++ b/SL/DATEV.pm @@ -575,7 +575,7 @@ sub generate_datev_data { UNION ALL SELECT ac.acc_trans_id, ac.transdate, ac.gldate, ac.trans_id,gl.id, ac.amount, ac.taxkey, ac.memo, - gl.reference AS invnumber, NULL AS duedate, ac.amount as umsatz, NULL as deliverydate, gl.itime::date, + gl.reference AS invnumber, NULL AS duedate, ac.amount as umsatz, gl.deliverydate, gl.itime::date, gl.description AS name, NULL as ustid, '' AS vcname, NULL AS customer_id, NULL AS vendor_id, c.accno, c.description AS accname, c.taxkey_id as charttax, c.datevautomatik, c.id, ac.chart_link AS link, FALSE AS invoice, @@ -1051,6 +1051,9 @@ sub generate_datev_lines { if (($transaction->[$haben]->{'duedate'} // '') ne "") { $datev_data{belegfeld2} = $transaction->[$haben]->{'duedate'}; } + if (($transaction->[$haben]->{'deliverydate'} // '') ne "") { + $datev_data{leistungsdatum} = $transaction->[$haben]->{'deliverydate'}; + } } $datev_data{umsatz} = abs($umsatz); # sales invoices without tax have a different sign??? diff --git a/SL/DATEV/CSV.pm b/SL/DATEV/CSV.pm index 05598b12a..8b8e88598 100644 --- a/SL/DATEV/CSV.pm +++ b/SL/DATEV/CSV.pm @@ -478,8 +478,15 @@ my @kivitendo_to_datev = ( valid_check => sub { my ($check) = @_; return ($check =~ m/^(0|1)$/) }, }, # pos 114 { - kivi_datev_name => 'not yet implemented', - }, + kivi_datev_name => 'leistungsdatum', + csv_header_name => t8('Payment Date'), + max_length => 8, + type => 'Date', + default => '', + input_check => sub { my ($check) = @_; return 1 if ('' eq $check); return (ref (DateTime->from_kivitendo($check)) eq 'DateTime') }, + formatter => sub { my ($input) = @_; return '' if ('' eq $input); return DateTime->from_kivitendo($input)->strftime('%d%m%Y') }, + valid_check => sub { my ($check) = @_; return 1 if ('' eq $check); return ($check =~ m/^[0-9]{8}$/) }, + }, # pos 115 { kivi_datev_name => 'not yet implemented', }, diff --git a/locale/de/all b/locale/de/all index 4b8df10eb..c5f2a36c7 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2300,6 +2300,7 @@ $self->{texts} = { 'Payables' => 'Verbindlichkeiten', 'Payment' => 'Zahlungsausgang', 'Payment / Delivery Options' => 'Zahlungs- und Lieferoptionen', + 'Payment Date' => 'Leistungsdatum', 'Payment Reminder' => 'Zahlungserinnerung', 'Payment Terms' => 'Zahlungsbedingungen', 'Payment Terms missing in row ' => 'Zahlungsfrist fehlt in Zeile ', diff --git a/locale/en/all b/locale/en/all index ac3dbed15..8415c1498 100644 --- a/locale/en/all +++ b/locale/en/all @@ -2300,6 +2300,7 @@ $self->{texts} = { 'Payables' => '', 'Payment' => '', 'Payment / Delivery Options' => '', + 'Payment Date' => '', 'Payment Reminder' => '', 'Payment Terms' => '', 'Payment Terms missing in row ' => '', -- 2.20.1