From 36bdd4875c67f916e4a885191f7870d301ae2c11 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 12 Dec 2018 17:19:42 +0100 Subject: [PATCH] =?utf8?q?PTC:=20R=C3=BCckgabe=20sellprice=20f=C3=BCr=20it?= =?utf8?q?ems:=20Steuer=20und=20Rabatt=20ber=C3=BCcksichtigen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit So war das vor dem PTC-Rundungs-Patch … "PTC rundet nicht mehr Rabatt vor Mengenmultiplikation" --- SL/DB/Helper/PriceTaxCalculator.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SL/DB/Helper/PriceTaxCalculator.pm b/SL/DB/Helper/PriceTaxCalculator.pm index 2a81586fc..89173102a 100644 --- a/SL/DB/Helper/PriceTaxCalculator.pm +++ b/SL/DB/Helper/PriceTaxCalculator.pm @@ -96,7 +96,8 @@ sub _calculate_item { my $num_dec = max 2, _num_decimal_places($item->sellprice); - # don't include rounded discount into sellprice + + # don't include rounded discount into sellprice for calculation # any time the sellprice is multiplied with qty discount has to be considered as part of the multiplication my $sellprice = $item->sellprice; @@ -161,10 +162,12 @@ sub _calculate_item { $data->{last_incex_chart_id} = $chart->id if $data->{is_sales}; + my $item_sellprice = _round($sellprice * (1 - $item->discount), $num_dec); + push @{ $data->{items} }, { linetotal => $linetotal, linetotal_cost => $linetotal_cost, - sellprice => $sellprice, + sellprice => $item_sellprice, tax_amount => $tax_amount, taxkey_id => $taxkey->id, }; -- 2.20.1