clean code

This commit is contained in:
Frédéric FRANCE 2023-02-14 20:24:07 +01:00
parent adc7d1fae2
commit 6745860cac

View File

@ -2716,25 +2716,28 @@ class Societe extends CommonObject
if (!empty($this->code_client) && ($this->client == 1 || $this->client == 3)) {
$datas['customercode'] = '<br><b>'.$langs->trans('CustomerCode').':</b> '.$this->code_client;
}
if (isModEnabled('accounting') && ($this->client == 1 || $this->client == 3)) {
$langs->load('compta');
$datas['accountancycustomercode'] = '<br><b>'.$langs->trans('CustomerAccountancyCode').':</b> '.($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'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1);
}
if (!empty($this->code_fournisseur) && $this->fournisseur) {
$datas['suppliercode'] = '<br><b>'.$langs->trans('SupplierCode').':</b> '.$this->code_fournisseur;
}
if (isModEnabled('accounting') && ($this->client == 1 || $this->client == 3)) {
$datas['accountancycustomercode'] = '<br><b>'.$langs->trans('CustomerAccountancyCode').':</b> '.($this->code_compta ? $this->code_compta : $this->code_compta_client);
}
if (isModEnabled('accounting') && $this->fournisseur) {
$langs->load('compta');
$datas['accountancysuppliercode'] = '<br><b>'.$langs->trans('SupplierAccountancyCode').':</b> '.$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'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1);
}
if ($this->fournisseur) {
$datas['categories_supplier'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1);
}
$datas['categories_supplier'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1);
}
$datas['divclose'] = '</div>';