FIX add "nofetch" parameters

This commit is contained in:
Regis Houssin 2023-03-23 12:02:16 +01:00
parent 8bc0e46e87
commit d923ad2340

View File

@ -873,10 +873,9 @@ class CommandeFournisseur extends CommonOrder
$langs->loadLangs(['bills', 'orders']);
$datas = [];
$nofetch = !empty($params['nofetch']);
if ($user->hasRight("fournisseur", "commande", "read")) {
if (!is_object($this->thirdparty)) {
$this->fetch_thirdparty();
}
$datas['picto'] = '<u class="paddingrightonly">'.$langs->trans("SupplierOrder").'</u>';
if (isset($this->statut)) {
$datas['picto'] .= ' '.$this->getLibStatut(5);
@ -887,8 +886,12 @@ class CommandeFournisseur extends CommonOrder
if (!empty($this->ref_supplier)) {
$datas['refsupplier'] = '<br><b>'.$langs->trans('RefSupplier').':</b> '.$this->ref_supplier;
}
if (!empty($this->thirdparty->name)) {
$datas['suppliername'] = '<br><b>'.$langs->trans('Supplier').':</b> '.$this->thirdparty->name;
if (!$nofetch) {
$langs->load('companies');
if (empty($this->thirdparty)) {
$this->fetch_thirdparty();
}
$datas['supplier'] = '<br><b>'.$langs->trans('Supplier').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1);
}
if (!empty($this->total_ht)) {
$datas['totalht'] = '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);