Merge pull request #8491 from hregis/develop_multicompany
Fix: possibility to change entity for new thirdparty
This commit is contained in:
commit
5b50b8bd40
@ -1643,6 +1643,7 @@ else
|
|||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="socid" value="'.$object->id.'">';
|
print '<input type="hidden" name="socid" value="'.$object->id.'">';
|
||||||
|
print '<input type="hidden" name="entity" value="'.$object->entity.'">';
|
||||||
if ($modCodeClient->code_auto || $modCodeFournisseur->code_auto) print '<input type="hidden" name="code_auto" value="1">';
|
if ($modCodeClient->code_auto || $modCodeFournisseur->code_auto) print '<input type="hidden" name="code_auto" value="1">';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -772,6 +772,7 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
|
$this->entity = ((isset($this->entity) && is_numeric($this->entity))?$this->entity:$conf->entity);
|
||||||
$this->name = $this->name?trim($this->name):trim($this->nom);
|
$this->name = $this->name?trim($this->name):trim($this->nom);
|
||||||
$this->nom = $this->name; // For backward compatibility
|
$this->nom = $this->name; // For backward compatibility
|
||||||
$this->name_alias = trim($this->name_alias);
|
$this->name_alias = trim($this->name_alias);
|
||||||
@ -896,7 +897,8 @@ class Societe extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::update verify ok or not done");
|
dol_syslog(get_class($this)."::update verify ok or not done");
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET ";
|
||||||
$sql .= "nom = '" . $this->db->escape($this->name) ."'"; // Required
|
$sql .= "entity = " . $this->entity;
|
||||||
|
$sql .= ",nom = '" . $this->db->escape($this->name) ."'"; // Required
|
||||||
$sql .= ",name_alias = '" . $this->db->escape($this->name_alias) ."'";
|
$sql .= ",name_alias = '" . $this->db->escape($this->name_alias) ."'";
|
||||||
$sql .= ",ref_ext = " .(! empty($this->ref_ext)?"'".$this->db->escape($this->ref_ext) ."'":"null");
|
$sql .= ",ref_ext = " .(! empty($this->ref_ext)?"'".$this->db->escape($this->ref_ext) ."'":"null");
|
||||||
$sql .= ",address = '" . $this->db->escape($this->address) ."'";
|
$sql .= ",address = '" . $this->db->escape($this->address) ."'";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user