From 1515adf313ed82bd44b825621da74ffde2fcfc0f Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Tue, 15 Jul 2025 15:57:05 +0200 Subject: [PATCH] Revert "FIX when using THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT and direct link New prospect, New Customer or New Supplier (#34702)" This reverts commit 870979362e1c4e44da42863b28f2dcaeff4afcc0. --- htdocs/societe/card.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index f7c530e3129..eb9f28c26fc 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1032,7 +1032,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Prospect / Customer if (GETPOST("type", 'aZ') == 'c') { - $object->client = 1; + if (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')) { + $object->client = getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT'); + } else { + $object->client = 3; + } } if (GETPOST("type", 'aZ') == 'p') { $object->client = 2; @@ -1445,8 +1449,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Prospect/Customer/Supplier $selected = $object->client; - $selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0); - $selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0); + $selectedcustomer = (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==1 || getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 ? 1 : 0); + $selectedprospect = (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==2 || getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 ? 1 : 0); switch ($selected) { case 1: $selectedcustomer = 1;