From 57b15c1821ff0c0e050221019f2c9c4e918213a3 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Mon, 29 Mar 2021 22:15:28 +0200 Subject: [PATCH] use dol_getIdFromCode for TE_PRIVATE --- htdocs/societe/class/societe.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index d23c2cdf06c..7e6f25d573d 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3795,7 +3795,8 @@ class Societe extends CommonObject $this->client = 1; // A member is a customer by default $this->code_client = ($customercode ? $customercode : -1); $this->code_fournisseur = -1; - $this->typent_id = ($member->morphy == 'phy' ? 8 : 0); // The type of thirdparty is private (individual) if the member is human (phy) + $this->typent_code = ($member->morphy == 'phy' ? 'TE_PRIVATE' : 0); + $this->typent_id = dol_getIdFromCode($this->db, $this->typent_code, 'c_typent', 'id', 'code'); $this->db->begin();