From: Sven Schöling Date: Tue, 10 Oct 2017 09:12:11 +0000 (+0200) Subject: Warnings: PTC - lastcost kann undefined sein X-Git-Tag: release-3.5.4~726 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=9a9b75c54e09a50186f45973d5420926c4a6eb94;p=kivitendo-erp.git Warnings: PTC - lastcost kann undefined sein --- 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);