diff --git a/ChangeLog.md b/ChangeLog.md index 5df34c5..17037fe 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,8 @@ # ChangeLog +## 4.1.59.0 +- Ajout d'une option pour ne pas chercher le tiers grace a son nom et code postal + ## 4.1.58.0 - Ignore la synchronisation de l'entrepot distant s'il n'est pas associé avec un entrepôt dolibarr. - Correction du script de synchronisation des produits vers le site diff --git a/VERSION b/VERSION index eda8458..7373926 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.58 \ No newline at end of file +4.1.59 \ No newline at end of file diff --git a/admin/thirdparty.php b/admin/thirdparty.php index c495e59..f031d9c 100644 --- a/admin/thirdparty.php +++ b/admin/thirdparty.php @@ -110,6 +110,7 @@ $object->fk_anonymous_thirdparty = GETPOST('fk_anonymous_thirdparty', 'int'); $object->fk_anonymous_thirdparty = $object->fk_anonymous_thirdparty > 0 ? $object->fk_anonymous_thirdparty : 0; $object->parameters['customer_roles'] = GETPOST('customer_roles', 'alphanohtml'); + $object->parameters['dont_search_company_by_name_and_zip'] = GETPOST('dont_search_company_by_name_and_zip', 'int') ? 1 : 0; $object->parameters['dont_update_dolibarr_company'] = GETPOST('dont_update_dolibarr_company', 'int') ? 1 : 0; if(empty($object->fk_cat_societe)) { @@ -216,6 +217,14 @@ print '' . "\n"; print '' . "\n"; +// Don't search company by name and zip +print '' . "\n"; +print '' . $langs->trans("ECommerceDontSearchCompanyByNameAndZip") . '' . "\n"; +print '' . $langs->trans("ECommerceDontSearchCompanyByNameAndZipDescription") . '' . "\n"; +print '' . "\n"; +print 'parameters['dont_search_company_by_name_and_zip']) ? ' checked' : '') . ' />' . "\n"; +print '' . "\n"; + // Don't update the third party print '' . "\n"; print '' . $langs->trans("ECommerceDontUpdateDolibarrCompany") . '' . "\n"; diff --git a/class/business/eCommerceSynchro.class.php b/class/business/eCommerceSynchro.class.php index 08f24bd..acb99f6 100755 --- a/class/business/eCommerceSynchro.class.php +++ b/class/business/eCommerceSynchro.class.php @@ -2946,7 +2946,7 @@ public function synchronizeCustomer($customer_data, $only_not_synchronized = fal // Search customer by name if it's a company if (!$error && !($third_party_id > 0) && (!isset($customer_data['type']) || $customer_data['type'] == 'company')) { - $result = $this->getThirdPartyByInfos($customer_data['name'], $customer_data['zip']); + $result = $this->getThirdPartyByNameAndZip($customer_data['name'], $customer_data['zip']); if ($result < 0) { if ($result != -2) $error++; } else { @@ -7655,7 +7655,7 @@ public function getFirstThirdPartyWhoNotAnonymousByEmail($email, $site_id = 0) */ public function getThirdPartyByNameAndZip($name, $zip = '', $site_id = 0) { - if (empty($name)) { + if (empty($name) || !empty($this->eCommerceSite->parameters['dont_search_company_by_name_and_zip'])) { return 0; } diff --git a/langs/fr_FR/ecommerce.lang b/langs/fr_FR/ecommerce.lang index 699e354..9c36f91 100644 --- a/langs/fr_FR/ecommerce.lang +++ b/langs/fr_FR/ecommerce.lang @@ -184,6 +184,8 @@ ECommerceUpdateLevelPrice ECommerceConfirmUpdatePriceLevel =Vous avez modifié le niveau de prix. Les produits sur le site E-Commerce vont être mis à jour.\nCette opération peut être longue, merci de confirmer. ThirdPartyForNonLoggedUsers =Tiers générique de recueil des clients sans compte créé SynchUnkownCustomersOnThirdParty =Tiers générique auquel seront rattachées les commandes de clients sans compte +ECommerceDontSearchCompanyByNameAndZip =Recherche par nom et code postal +ECommerceDontSearchCompanyByNameAndZipDescription =Ne pas rechercher le tiers Dolibarr graçe au nom et code postal fournit par WooCommerce ECommerceDontUpdateDolibarrCompany =Mise à jour du tiers ECommerceDontUpdateDolibarrCompanyDescription =Ne pas mettre à jour le tiers de Dolibarr lorsqu'il existe déja dans dolibarr