From 631f2bce1db171c83a3de872e6b62387334f4058 Mon Sep 17 00:00:00 2001 From: Joe Bidon Date: Thu, 27 Apr 2023 08:22:19 +0200 Subject: [PATCH 1/2] Add hidden option COMPANY_AQUARIUM_NO_PREFIX to ignore PREFIX --- .../modules/societe/mod_codecompta_aquarium.php | 14 ++++++++++++-- htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index 257bdf55e52..e3c6ad1600c 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -61,8 +61,14 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode if (!isset($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER) || trim($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER) == '') { $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER = '401'; } - $this->prefixcustomeraccountancycode = $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER; - $this->prefixsupplieraccountancycode = $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER; + + if (!empty($conf->global->COMPANY_AQUARIUM_NO_PREFIX)) { + $this->prefixcustomeraccountancycode = ''; + $this->prefixsupplieraccountancycode = ''; + }else{ + $this->prefixcustomeraccountancycode = $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER; + $this->prefixsupplieraccountancycode = $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER; + } } @@ -102,6 +108,10 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode if (!empty($conf->global->COMPANY_AQUARIUM_CLEAN_REGEX)) { $texte .= $langs->trans('COMPANY_AQUARIUM_CLEAN_REGEX').' = '.$conf->global->COMPANY_AQUARIUM_CLEAN_REGEX."
\n"; } + + if (!empty($conf->global->COMPANY_AQUARIUM_NO_PREFIX)) { + $texte .= $langs->trans('COMPANY_AQUARIUM_NO_PREFIX').' = '.$conf->global->COMPANY_AQUARIUM_NO_PREFIX."
\n"; + } $texte .= ''; $texte .= ''; $texte .= ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9c5d62fc38b..ed2551386b6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2085,6 +2085,7 @@ EnterCalculationRuleIfPreviousFieldIsYes=Enter calculation rule if previous fiel SeveralLangugeVariatFound=Several language variants found RemoveSpecialChars=Remove special characters COMPANY_AQUARIUM_CLEAN_REGEX=Regex filter to clean value (COMPANY_AQUARIUM_CLEAN_REGEX) +COMPANY_AQUARIUM_NO_PREFIX=Do not use prefix, only copy customer or supplier code COMPANY_DIGITARIA_CLEAN_REGEX=Regex filter to clean value (COMPANY_DIGITARIA_CLEAN_REGEX) COMPANY_DIGITARIA_UNIQUE_CODE=Duplicate not allowed RemoveSpecialWords=Clean certain words when generating sub-accounts for customers or suppliers From 9179d51c0ee38ffcc76aad04cc2488026cabcadb Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 7 May 2023 14:00:18 +0000 Subject: [PATCH 2/2] Fixing style errors. --- htdocs/core/modules/societe/mod_codecompta_aquarium.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index e3c6ad1600c..3805feee4ce 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -65,7 +65,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode if (!empty($conf->global->COMPANY_AQUARIUM_NO_PREFIX)) { $this->prefixcustomeraccountancycode = ''; $this->prefixsupplieraccountancycode = ''; - }else{ + } else { $this->prefixcustomeraccountancycode = $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER; $this->prefixsupplieraccountancycode = $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER; }