diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6348d8e1325..96d3d164756 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3728,6 +3728,7 @@ class Commande extends CommonOrder global $conf, $langs, $user; $datas = []; + $nofetch = !empty($params['nofetch']); if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { return ['optimize' => $langs->trans("Order")]; @@ -3739,7 +3740,13 @@ class Commande extends CommonOrder $datas[] = ' '.$this->getLibStatut(5); } $datas['Ref'] = '
'.$langs->trans('Ref').': '.$this->ref; - $datas['RefCustomer'] = '
'.$langs->trans('RefCustomer').': '.(empty($this->ref_customer) ? (empty($this->ref_client) ? '' : $this->ref_client) : $this->ref_customer); + if (!$nofetch) { + $langs->load('companies'); + if (empty($this->thirdparty)) { + $this->fetch_thirdparty(); + } + $datas['customer'] = '
'.$langs->trans('Customer').': '.$this->thirdparty->name; + } if (!empty($this->total_ht)) { $datas['AmountHT'] = '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); } @@ -3811,6 +3818,7 @@ class Commande extends CommonOrder 'id' => $this->id, 'objecttype' => $this->element, 'option' => $option, + 'nofetch' => 1, ]; $classfortooltip = 'classfortooltip'; $dataparams = '';