]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Warnings: PTC - lastcost kann undefined sein
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 10 Oct 2017 09:12:11 +0000 (11:12 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 10 Oct 2017 09:12:11 +0000 (11:12 +0200)
SL/DB/Helper/PriceTaxCalculator.pm

index c36633d648bf10a787a15d109bb3cd7ab4ad1218..9a271841531d26e81f2a6283ab570a190833910f 100644 (file)
@@ -112,7 +112,7 @@ sub _calculate_item {
     $item->marge_percent(0);
 
   } else {
     $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);
     $linetotal_cost    = _round($lastcost * $item->qty / $item->marge_price_factor, 2);
 
     $item->marge_total(  $linetotal - $linetotal_cost);