mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
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
This commit is contained in:
parent
574273bbf3
commit
92a8fcccfe
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user