From: Bernd Bleßmann Date: Thu, 3 Dec 2020 11:21:53 +0000 (+0100) Subject: Preisanfrage/Aufträge: dort, wo es ein Liefertermin gibt, diesen f. Steuer nehmen X-Git-Tag: kivitendo-mebil_0.1-0~9^2~577^2~1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a6485c5822e13b6d0bda4bff0a003bfc569f778c;p=kivitendo-erp.git Preisanfrage/Aufträge: dort, wo es ein Liefertermin gibt, diesen f. Steuer nehmen --- diff --git a/SL/DB/Order.pm b/SL/DB/Order.pm index 35cfaea4f..f22c84d17 100644 --- a/SL/DB/Order.pm +++ b/SL/DB/Order.pm @@ -139,15 +139,17 @@ sub is_type { } sub deliverydate { - # oe doesn't have deliverydate, but PTC checks for deliverydate or transdate to determine tax - # oe can't deal with deviating tax rates, but at least make sure PTC doesn't barf - return shift->transdate; + # oe doesn't have deliverydate, but it does have reqdate. + # But this has a different meaning for sales quotations. + # deliverydate can be used to determine tax if tax_point isn't set. + + return $_[0]->reqdate if $_[0]->type ne 'sales_quotation'; } sub effective_tax_point { my ($self) = @_; - return $self->tax_point || $self->transdate; + return $self->tax_point || $self->deliverydate || $self->transdate; } sub displayable_type { diff --git a/SL/IC.pm b/SL/IC.pm index 46f0f542c..ca03e5144 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -744,7 +744,9 @@ sub retrieve_accounts { # also use deliverydate for credit notes $transdate = $form->{tax_point} || $form->{deliverydate} || $form->{invdate}; } else { - $transdate = $form->{tax_point} || $form->{transdate}; + my $deliverydate; + $deliverydate = $form->{reqdate} if any { $_ eq $form->{type} } qw(sales_order request_quotation purchase_order); + $transdate = $form->{tax_point} || $deliverydate || $form->{transdate}; } if ($transdate eq "") {