Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
- Ajout d'une option pour ne pas chercher le tiers grace a son nom et…
Browse files Browse the repository at this point in the history
… code postal
  • Loading branch information
kkhelifa-opendsi committed Oct 2, 2023
1 parent 824433a commit f876cf6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.58
4.1.59
9 changes: 9 additions & 0 deletions admin/thirdparty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -216,6 +217,14 @@
print '<input type="text" class="flat centpercent" name="customer_roles" value="' . dol_escape_htmltag($value) . '">' . "\n";
print '</td></tr>' . "\n";

// Don't search company by name and zip
print '<tr class="oddeven">' . "\n";
print '<td>' . $langs->trans("ECommerceDontSearchCompanyByNameAndZip") . '</td>' . "\n";
print '<td>' . $langs->trans("ECommerceDontSearchCompanyByNameAndZipDescription") . '</td>' . "\n";
print '<td class="right">' . "\n";
print '<input type="checkbox" name="dont_search_company_by_name_and_zip" value="1"' . (!empty($object->parameters['dont_search_company_by_name_and_zip']) ? ' checked' : '') . ' />' . "\n";
print '</td></tr>' . "\n";

// Don't update the third party
print '<tr class="oddeven">' . "\n";
print '<td>' . $langs->trans("ECommerceDontUpdateDolibarrCompany") . '</td>' . "\n";
Expand Down
4 changes: 2 additions & 2 deletions class/business/eCommerceSynchro.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions langs/fr_FR/ecommerce.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f876cf6

Please sign in to comment.