Fix alias

This commit is contained in:
Laurent Destailleur 2022-11-02 17:08:27 +01:00
parent 946624fd67
commit b4ecccfd9d

View File

@ -3604,14 +3604,14 @@ class Societe extends CommonObject
} }
//Verify duplicate entries //Verify duplicate entries
$sql = "SELECT COUNT(*) as idprof FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$this->db->escape($value)."' AND entity IN (".getEntity('societe').")"; $sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$this->db->escape($value)."' AND entity IN (".getEntity('societe').")";
if ($socid) { if ($socid) {
$sql .= " AND rowid <> ".$socid; $sql .= " AND rowid <> ".$socid;
} }
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$count = $obj->idprof; $count = $obj->nb;
} else { } else {
$count = 0; $count = 0;
print $this->db->error(); print $this->db->error();