Browse Source

Merge pull request #24705 from mrbidon/develop

Add hidden option COMPANY_AQUARIUM_NO_PREFIX to ignore PREFIX
Laurent Destailleur 2 years ago
parent
commit
ca18bfc587

+ 12 - 2
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."<br>\n";
 		}
+
+		if (!empty($conf->global->COMPANY_AQUARIUM_NO_PREFIX)) {
+			$texte .= $langs->trans('COMPANY_AQUARIUM_NO_PREFIX').' = '.$conf->global->COMPANY_AQUARIUM_NO_PREFIX."<br>\n";
+		}
 		$texte .= '</td>';
 		$texte .= '<td class="right"><input type="submit" class="button button-edit reposition" name="modify" value="'.$langs->trans("Modify").'"></td>';
 		$texte .= '</tr></table>';

+ 1 - 0
htdocs/langs/en_US/admin.lang

@@ -2086,6 +2086,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