diff --git a/htdocs/soc.php b/htdocs/soc.php index 8ec945d5e73..0a9740800b8 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -93,6 +93,7 @@ if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"]) && ($_POST["action"] == 'add' || $_POST["action"] == 'update') && $user->rights->societe->creer) { $soc->nom = $_POST["nom"]; + $soc->prenom = $_POST["prenom"]; $soc->adresse = $_POST["adresse"]; $soc->cp = $_POST["cp"]; $soc->ville = $_POST["ville"]; @@ -118,7 +119,14 @@ if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"]) $soc->forme_juridique_code = $_POST["forme_juridique_code"]; $soc->effectif_id = $_POST["effectif_id"]; - $soc->typent_id = $_POST["typent_id"]; + if ($_POST["private"] == 1) + { + $soc->typent_id = 8; //todo prévoir autre méthode si le champs "particulier" change de rowid + } + else + { + $soc->typent_id = $_POST["typent_id"]; + } $soc->client = $_POST["client"]; $soc->fournisseur = $_POST["fournisseur"]; $soc->fournisseur_categorie = $_POST["fournisseur_categorie"]; @@ -253,6 +261,8 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || if ($_POST["nom"]) { $soc->nom=$_POST["nom"]; + $soc->prenom=$_POST["prenom"]; + $soc->particulier=$_POST["private"]; $soc->prefix_comm=$_POST["prefix_comm"]; $soc->client=$_POST["client"]; $soc->code_client=$_POST["code_client"]; @@ -319,6 +329,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || print '