mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-16 14:31:29 +01:00
* Update shipment reference handling in commondocgenerator * Refactor order reference assignment for clarity * Refactor origin object handling in shipment array * Refactor origin object handling in shipment array --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
@@ -1080,10 +1080,12 @@ abstract class CommonDocGenerator
|
|||||||
$array_shipment = $this->fill_substitutionarray_with_extrafields($object, $array_shipment, $extrafields, $array_key, $outputlangs);
|
$array_shipment = $this->fill_substitutionarray_with_extrafields($object, $array_shipment, $extrafields, $array_key, $outputlangs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add info from $object->xxx where xxx has been loaded by fetch_origin() of shipment
|
// Add info from $object->origin_object which has been loaded by fetch() of shipment
|
||||||
if (is_object($object->commande) && !empty($object->commande->ref)) {
|
if ($object->origin_type == 'commande' && is_object($object->origin_object) && !empty($object->origin_object->ref)) {
|
||||||
$array_shipment['order_ref'] = $object->commande->ref;
|
$originOrder = $object->origin_object;
|
||||||
$array_shipment['order_ref_customer'] = $object->commande->ref_customer;
|
'@phan-var-force Commande $originOrder';
|
||||||
|
$array_shipment['order_ref'] = $originOrder->ref;
|
||||||
|
$array_shipment['order_ref_customer'] = $originOrder->ref_customer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load dim data
|
// Load dim data
|
||||||
|
|||||||
Reference in New Issue
Block a user