From 9785e9b2988529c3e8bd626828866a7dd1194ce7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 May 2017 09:57:51 +0200 Subject: [PATCH] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f2e8f75f796..4b6c1263026 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2963,20 +2963,20 @@ abstract class CommonObject foreach ($this->lines as $line) { - $totalOrdered+=$line->qty_asked ?: 0; // defined for shipment only - $totalToShip+= $line->qty_shipped ?: 0; // defined for shipment only + $totalOrdered+=($line->qty_asked ? $line->qty_asked : 0); // defined for shipment only + $totalToShip+=($line->qty_shipped ? $line->qty_shipped : 0); // defined for shipment only // Define qty, weight, volume, weight_units, volume_units if ($this->element == 'shipping') { // for shipments - $qty = $line->qty_shipped ?: 0; + $qty = $line->qty_shipped ? $line->qty_shipped : 0; } else { - $qty = $line->qty ?: 0; + $qty = $line->qty ? $line->qty : 0; } - $weight = $line->weight ?: 0; - $volume = $line->volume ?: 0; + $weight = $line->weight ? $line->weight : 0; + $volume = $line->volume ? $line->volume : 0; $weight_units=$line->weight_units; $volume_units=$line->volume_units;