X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/46f028ef78a55580e7e33c2439cedd0e60bde998..6f1ffd59a04dab30e87d6ea38c5884624f4b926a:/SL/DATEV.pm diff --git a/SL/DATEV.pm b/SL/DATEV.pm index 026ec05cb..af188f70a 100644 --- a/SL/DATEV.pm +++ b/SL/DATEV.pm @@ -1051,7 +1051,19 @@ sub generate_datev_lines { if (($transaction->[$haben]->{'duedate'} // '') ne "") { $datev_data{belegfeld2} = $transaction->[$haben]->{'duedate'}; } - if (($transaction->[$haben]->{'deliverydate'} // '') ne "") { + + # if deliverydate exists, add it to datev export if it is + # * an ar/ap booking that is not a payment + # * a gl booking + if ( ($transaction->[$haben]->{'deliverydate'} // '') ne '' + && ( + ( $transaction->[$haben]->{'table'} =~ /^(ar|ap)$/ + && $transaction->[$haben]->{'link'} !~ m/_paid/ + && $transaction->[$soll]->{'link'} !~ m/_paid/ + ) + || $transaction->[$haben]->{'table'} eq 'gl' + ) + ) { $datev_data{leistungsdatum} = $transaction->[$haben]->{'deliverydate'}; } }