From eeb8907f332fa3619db3e90f87c8a32c666a3652 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 14 Feb 2025 02:09:59 +0100 Subject: [PATCH] Fix missing properties --- htdocs/adherents/class/adherent.class.php | 5 ++--- htdocs/core/class/commonobject.class.php | 6 ++++++ htdocs/societe/class/societe.class.php | 15 +++++++++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index bcd8753aa95..34ef215eb13 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -96,13 +96,12 @@ class Adherent extends CommonObject /** * @var string - * @deprecated Use $civility_code - * @see $civility_code + * @deprecated Use $civility_code */ public $civility_id; /** - * @var string The civility code, not an integer (ex: 'MR', 'MME', 'MLE', etc.) + * @var string The civility code, not an integer (ex: 'MR', 'MME', 'MLE', 'DR', etc.) */ public $civility_code; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f6373bb2c14..a4f954cbaff 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -653,9 +653,15 @@ abstract class CommonObject /** * @var string The civility code, not an integer + * @deprecated Use $civlity_code */ public $civility_id; + /** + * @var string The civility code, not an integer + */ + public $civility_code; + // Dates /** * @var integer|''|null Object creation date diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5a92c78ff08..9419c5898c3 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -849,6 +849,16 @@ class Societe extends CommonObject */ public $accountancy_code_buy; + /** + * @var string Main currency code of company + */ + public $currency_code; + + /** + * @var string Main currency label of company + */ + public $currency; + // Multicurrency /** * @var int Multicurrency ID @@ -4442,7 +4452,7 @@ class Societe extends CommonObject public function create_from_member(Adherent $member, $socname = '', $socalias = '', $customercode = '') { // phpcs:enable - global $conf, $user, $langs; + global $user, $langs; dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); $fullname = $member->getFullName($langs); @@ -4497,7 +4507,8 @@ class Societe extends CommonObject // Fill fields needed by contact $this->name_bis = $member->lastname; $this->firstname = $member->firstname; - $this->civility_id = $member->civility_id; + $this->civility_id = (empty($member->civility_code) ? $member->civility_id : $member->civility_code); + $this->civility_code = (empty($member->civility_code) ? $member->civility_id : $member->civility_code); dol_syslog("We ask to create a contact/address too", LOG_DEBUG); $result = $this->create_individual($user);