diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e180d9ab13e..37d383e69a7 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2716,25 +2716,28 @@ class Societe extends CommonObject if (!empty($this->code_client) && ($this->client == 1 || $this->client == 3)) { $datas['customercode'] = '
'.$langs->trans('CustomerCode').': '.$this->code_client; } + if (isModEnabled('accounting') && ($this->client == 1 || $this->client == 3)) { + $langs->load('compta'); + $datas['accountancycustomercode'] = '
'.$langs->trans('CustomerAccountancyCode').': '.($this->code_compta ? $this->code_compta : $this->code_compta_client); + } + // show categories for this record only in ajax to not overload lists + if (!$nofetch && isModEnabled('categorie') && $this->client) { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $form = new Form($this->db); + $datas['categories_customer'] = '
' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1); + } if (!empty($this->code_fournisseur) && $this->fournisseur) { $datas['suppliercode'] = '
'.$langs->trans('SupplierCode').': '.$this->code_fournisseur; } - if (isModEnabled('accounting') && ($this->client == 1 || $this->client == 3)) { - $datas['accountancycustomercode'] = '
'.$langs->trans('CustomerAccountancyCode').': '.($this->code_compta ? $this->code_compta : $this->code_compta_client); - } if (isModEnabled('accounting') && $this->fournisseur) { + $langs->load('compta'); $datas['accountancysuppliercode'] = '
'.$langs->trans('SupplierAccountancyCode').': '.$this->code_compta_fournisseur; } // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (!$nofetch && isModEnabled('categorie') && $this->fournisseur) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); - if ($this->client) { - $datas['categories_customer'] = '
' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1); - } - if ($this->fournisseur) { - $datas['categories_supplier'] = '
' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1); - } + $datas['categories_supplier'] = '
' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1); } $datas['divclose'] = '';