From 92a8fcccfee87b2524bdc25de0332546acd94bda Mon Sep 17 00:00:00 2001 From: iLLixM Date: Sun, 16 Feb 2025 18:54:51 +0100 Subject: [PATCH] New: Option to set Third Party Customer Code equal to Member Reference when using the function of creating third parties from members, you are able to set the customer code equal to the existing member reference by setting the parameter THIRDPARTY_CUSTOMERCODE_EQUALS_MEMBERREF --- htdocs/societe/class/societe.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index f734c3b7612..c72e72af3b5 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4486,7 +4486,11 @@ class Societe extends CommonObject $this->entity = $member->entity; $this->client = 1; // A member is a customer by default - $this->code_client = ($customercode ? $customercode : -1); + if (getDolGlobalString('THIRDPARTY_CUSTOMERCODE_EQUALS_MEMBERREF')) { + $this->code_client = $member->ref; // set Customer Code equal to existing Member Reference + } else { + $this->code_client = ($customercode ? $customercode : -1); // set new auto-incremented Customer Code + } $this->code_fournisseur = '-1'; $this->typent_code = ($member->morphy == 'phy' ? 'TE_PRIVATE' : 0); $this->typent_id = $this->typent_code ? dol_getIdFromCode($this->db, $this->typent_code, 'c_typent', 'id', 'code') : 0;