From 9a9b75c54e09a50186f45973d5420926c4a6eb94 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 10 Oct 2017 11:12:11 +0200 Subject: [PATCH] Warnings: PTC - lastcost kann undefined sein --- SL/DB/Helper/PriceTaxCalculator.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SL/DB/Helper/PriceTaxCalculator.pm b/SL/DB/Helper/PriceTaxCalculator.pm index c36633d64..9a2718415 100644 --- a/SL/DB/Helper/PriceTaxCalculator.pm +++ b/SL/DB/Helper/PriceTaxCalculator.pm @@ -112,7 +112,7 @@ sub _calculate_item { $item->marge_percent(0); } else { - my $lastcost = ! ($item->lastcost * 1) ? ($part->lastcost || 0) : $item->lastcost; + my $lastcost = !(($item->lastcost // 0) * 1) ? ($part->lastcost || 0) : $item->lastcost; $linetotal_cost = _round($lastcost * $item->qty / $item->marge_price_factor, 2); $item->marge_total( $linetotal - $linetotal_cost); -- 2.20.1