X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDATEV.pm;h=af188f70a4e911f433464217e59deaac3c146fef;hb=bb12dc4de040315cd8e4c77922df289f8d25449c;hp=026ec05cb5fa77c3f88ec368de85cd807d5ac599;hpb=46f028ef78a55580e7e33c2439cedd0e60bde998;p=kivitendo-erp.git 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'}; } }