diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index eedcd449c0d..02543d46993 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -783,10 +783,14 @@ else $modCodeFournisseur = new $module; // Define if customer/prospect or supplier status is set or not - if (GETPOST("type")!='f' && empty($conf->global->THIRDPARTY_NOTCUSTOMERPROSPECT_BY_DEFAULT)) { $object->client=3; } - if (GETPOST("type")=='c') { $object->client=1; } + if (GETPOST("type")!='f') + { + $object->client=-1; + if (! empty($conf->global->THIRDPARTY_CUSTOMERPROSPECT_BY_DEFAULT)) { $object->client=3; } + } + if (GETPOST("type")=='c') { $object->client=3; } // Prospect / Customer if (GETPOST("type")=='p') { $object->client=2; } - if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || (GETPOST("type")=='' && empty($conf->global->THIRDPARTY_NOTSUPPLIER_BY_DEFAULT)))) { $object->fournisseur=1; } + if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || (GETPOST("type")=='' && ! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { $object->fournisseur=1; } $object->name = GETPOST('name', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); @@ -983,8 +987,9 @@ else // Prospect/Customer print '