From bfc8bb85a3d82b6ac989c740e0c515178b3f19e1 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Mon, 6 Dec 2021 18:23:47 +0100 Subject: [PATCH] FIX: thirparty ajax selector: no name or highlighting if at least ref and/or address displayed --- htdocs/societe/ajax/ajaxcompanies.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/ajax/ajaxcompanies.php b/htdocs/societe/ajax/ajaxcompanies.php index 89aa4f524b6..cbbcb14f361 100644 --- a/htdocs/societe/ajax/ajaxcompanies.php +++ b/htdocs/societe/ajax/ajaxcompanies.php @@ -125,15 +125,17 @@ if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn', 'int if ($resql) { while ($row = $db->fetch_array($resql)) { $label = ''; - if ($conf->global->SOCIETE_ADD_REF_IN_LIST) { + if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { if (($row['client']) && (!empty($row['code_client']))) { $label = $row['code_client'].' - '; } if (($row['fournisseur']) && (!empty($row['code_fournisseur']))) { $label .= $row['code_fournisseur'].' - '; } - $label .= ' '.$row['name']; } + + $label .= $row['nom']; + if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { $label .= ($row['address'] ? ' - '.$row['address'] : '').($row['zip'] ? ' - '.$row['zip'] : '').($row['town'] ? ' '.$row['town'] : ''); if (!empty($row['country_code'])) {