From: Bernd Bleßmann Date: Wed, 12 Dec 2018 15:16:58 +0000 (+0100) Subject: PTC: item->discount auf 0, wenn nicht definiert, um Warnungen zu vermeiden X-Git-Tag: release-3.5.4~191 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=faf42bec5d778fa8d35ad30a4c90e803d675753b;p=kivitendo-erp.git PTC: item->discount auf 0, wenn nicht definiert, um Warnungen zu vermeiden --- diff --git a/SL/DB/Helper/PriceTaxCalculator.pm b/SL/DB/Helper/PriceTaxCalculator.pm index 89173102a..d0412c2bb 100644 --- a/SL/DB/Helper/PriceTaxCalculator.pm +++ b/SL/DB/Helper/PriceTaxCalculator.pm @@ -96,6 +96,7 @@ sub _calculate_item { my $num_dec = max 2, _num_decimal_places($item->sellprice); + $item->discount(0) if !$item->discount; # 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