From d04f241a1cc93b3917f375731fdc0bef608beeb7 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Fri, 19 Jun 2020 23:39:28 +0200 Subject: [PATCH] PTC: Steuer nach Lieferdatum oder Rechnungsdatum MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit sollte nur für Rechnungen/Gutschriften gelten, nicht für Aufträge. --- SL/DB/Helper/PriceTaxCalculator.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1