diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ec4f1e89606..f8c7f75b848 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -737,10 +737,9 @@ class Societe extends CommonObject $sql = "SELECT l.rowid, l.label, l.fk_soc, l.name, l.address, l.cp"; $sql .= ", l.tms as dm, l.datec as dc"; $sql .= ", l.ville, l.fk_pays, l.note, l.tel, l.fax"; - $sql .= ", p.libelle as pays, p.code as pays_code, s.nom as socname"; + $sql .= ", p.libelle as pays, p.code as pays_code"; $sql .= " FROM ".MAIN_DB_PREFIX."societe_address as l"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON l.fk_pays = p.rowid"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON l.fk_soc = s.rowid"; $sql .= " WHERE l.rowid = ".$id; $result = $this->db->query($sql) ; @@ -749,22 +748,25 @@ class Societe extends CommonObject { $obj = $this->db->fetch_object($result); - $this->id = $obj->rowid; - $this->datec = $this->db->jdate($obj->dc); - $this->datem = $this->db->jdate($obj->dm); - $this->label = $obj->label; - $this->socid = $obj->fk_soc; - $this->societe = $obj->socname; - $this->name = $obj->name; - $this->address = $obj->address; - $this->cp = $obj->cp; - $this->ville = $obj->ville; - $this->pays_id = $obj->fk_pays; - $this->pays_code = $obj->fk_pays?$obj->pays_code:''; - $this->pays = $obj->fk_pays?($langs->trans('Country'.$obj->pays_code)!='Country'.$obj->pays_code?$langs->trans('Country'.$obj->pays_code):$obj->pays):''; - $this->tel = $obj->tel; - $this->fax = $obj->fax; - $this->note = $obj->note; + $this->id = $obj->rowid; + $this->datec = $this->db->jdate($obj->dc); + $this->datem = $this->db->jdate($obj->dm); + $this->label = $obj->label; + $this->socid = $obj->fk_soc; + $this->name = $obj->name; + $this->address = $obj->address; + $this->cp = $obj->cp; // TODO deprecated + $this->zip = $obj->cp; + $this->ville = $obj->ville; // TODO deprecated + $this->town = $obj->ville; + $this->pays_id = $obj->fk_pays; + $this->pays_code = $obj->fk_pays?$obj->pays_code:''; + $this->pays = $obj->fk_pays?($langs->trans('Country'.$obj->pays_code)!='Country'.$obj->pays_code?$langs->trans('Country'.$obj->pays_code):$obj->pays):''; // TODO deprecated + $this->country = $obj->fk_pays?($langs->trans('Country'.$obj->pays_code)!='Country'.$obj->pays_code?$langs->trans('Country'.$obj->pays_code):$obj->pays):''; + $this->tel = $obj->tel; // TODO deprecated + $this->phone = $obj->tel; + $this->fax = $obj->fax; + $this->note = $obj->note; $this->db->free($result);