From: Bernd Bleßmann Date: Wed, 12 Dec 2018 16:19:42 +0000 (+0100) Subject: PTC: Rückgabe sellprice für items: Steuer und Rabatt berücksichtigen. X-Git-Tag: release-3.5.4~192 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=36bdd4875c67f916e4a885191f7870d301ae2c11;p=kivitendo-erp.git PTC: Rückgabe sellprice für items: Steuer und Rabatt berücksichtigen. So war das vor dem PTC-Rundungs-Patch … "PTC rundet nicht mehr Rabatt vor Mengenmultiplikation" --- 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, };