Merge remote-tracking branch 'upstream/develop' into fix_phpstan_2025_01_05_01
This commit is contained in:
commit
ef103e55dd
1 changed files with 36 additions and 0 deletions
|
|
@ -1081,6 +1081,42 @@ abstract class CommonDocGenerator
|
|||
$array_shipment['order_ref_customer'] = $object->commande->ref_customer;
|
||||
}
|
||||
|
||||
// Load dim data
|
||||
$tmparray = $object->getTotalWeightVolume();
|
||||
$totalWeight = $tmparray['weight'];
|
||||
$totalVolume = $tmparray['volume'];
|
||||
$totalOrdered = $tmparray['ordered'];
|
||||
$totalToShip = $tmparray['toship'];
|
||||
|
||||
// Set trueVolume and volume_units not currently stored into database
|
||||
if ($object->trueWidth && $object->trueHeight && $object->trueDepth) {
|
||||
$object->trueVolume = $object->trueWidth * $object->trueHeight * $object->trueDepth;
|
||||
$object->volume_units = $object->size_units * 3;
|
||||
}
|
||||
|
||||
$array_shipment[$array_key.'_total_ordered'] = (string) $totalOrdered;
|
||||
$array_shipment[$array_key.'_total_toship'] = (string) $totalToShip;
|
||||
|
||||
if ($object->trueWeight) {
|
||||
$array_shipment[$array_key.'_total_weight'] = (empty($totalWeight)) ? '' : showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
|
||||
} elseif (!empty($totalWeight)) {
|
||||
$array_shipment[$array_key.'_total_weight'] = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1);
|
||||
} else {
|
||||
$array_shipment[$array_key.'_total_weight'] = "";
|
||||
}
|
||||
|
||||
if (!empty($object->trueVolume)) {
|
||||
if ($object->volume_units < 50) {
|
||||
$array_shipment[$array_key.'_total_volume'] = (empty($totalVolume)) ? '' : showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs);
|
||||
} else {
|
||||
$array_shipment[$array_key.'_total_volume'] = (empty($totalVolume)) ? '' : price($object->trueVolume, 0, $outputlangs, 0, 0).' '.measuringUnitString(0, "volume", $object->volume_units);
|
||||
}
|
||||
} elseif (!empty($totalVolume)) {
|
||||
$array_shipment[$array_key.'_total_volume'] = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1);
|
||||
} else {
|
||||
$array_shipment[$array_key.'_total_volume'] = "";
|
||||
}
|
||||
|
||||
return $array_shipment;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue