diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f2e8f75f7967e3494959bab421635b45333eec44..4b6c1263026b367e8e4a3e008fe3129e8a14a79c 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;