Browse Source

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

Laurent Destailleur 4 years ago
parent
commit
c5449fdd66

+ 4 - 1
htdocs/core/modules/societe/mod_codecompta_digitaria.php

@@ -207,7 +207,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode
 			if (!isset($conf->global->COMPANY_DIGITARIA_UNIQUE_CODE) || !empty($conf->global->COMPANY_DIGITARIA_UNIQUE_CODE)) {
 				$disponibility = $this->checkIfAccountancyCodeIsAlreadyUsed($db, $this->code, $type);
 
-				while ($disponibility <> 0 && $i < 100) {
+				while ($disponibility <> 0 && $i < 1000) {
 					$widthsupplier = $this->supplieraccountancycodecharacternumber;
 					$widthcustomer = $this->customeraccountancycodecharacternumber;
 
@@ -217,6 +217,9 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode
 					if ($i >= 10 && $i <= 99) {
 						$a = 2;
 					}
+					if ($i >= 100 && $i <= 999) {
+						$a = 3;
+					}
 
 					if ($type == 'supplier') {
 						$this->code = $prefix.strtoupper(substr($codetouse, 0, $widthsupplier - $a)).$i;

+ 1 - 1
htdocs/knowledgemanagement/knowledgerecord_list.php

@@ -262,7 +262,7 @@ $sql .= $object->getFieldList('t');
 // Add fields from extrafields
 if (!empty($extrafields->attributes[$object->table_element]['label'])) {
 	foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
-		$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
+		$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ",ef.".$key.' as options_'.$key.', ' : '');
 	}
 }
 // Add fields from hooks