From: G. Richardson Date: Fri, 19 Jun 2020 21:39:28 +0000 (+0200) Subject: PTC: Steuer nach Lieferdatum oder Rechnungsdatum X-Git-Tag: release-3.5.6.1~169 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d04f241a1cc93b3917f375731fdc0bef608beeb7;p=kivitendo-erp.git PTC: Steuer nach Lieferdatum oder Rechnungsdatum sollte nur für Rechnungen/Gutschriften gelten, nicht für Aufträge. --- diff --git a/SL/DB/Helper/PriceTaxCalculator.pm b/SL/DB/Helper/PriceTaxCalculator.pm index b0876da23..f5bc61c4a 100644 --- a/SL/DB/Helper/PriceTaxCalculator.pm +++ b/SL/DB/Helper/PriceTaxCalculator.pm @@ -54,7 +54,7 @@ sub calculate_prices_and_taxes { $self->netamount( 0); $self->marge_total(0); - SL::DB::Manager::Chart->cache_taxkeys(date => $self->transdate); + SL::DB::Manager::Chart->cache_taxkeys(date => $self->deliverydate // $self->transdate); my $idx = 0; foreach my $item (@{ $self->items_sorted }) { @@ -110,7 +110,7 @@ sub _calculate_item { $data->{invoicediff} += $sellprice * (1 - $item->discount) * $item->qty * $data->{exchangerate} / $item->price_factor - $linetotal if $self->taxincluded; - my $taxkey = $part->get_taxkey(date => $self->transdate, is_sales => $data->{is_sales}, taxzone => $self->taxzone_id); + my $taxkey = $part->get_taxkey(date => $self->deliverydate // $self->transdate, is_sales => $data->{is_sales}, taxzone => $self->taxzone_id); my $tax_rate = $taxkey->tax->rate; my $tax_amount = undef;