diff --git a/htdocs/includes/modules/societe/mod_codeclient_leopard.php b/htdocs/includes/modules/societe/mod_codeclient_leopard.php index 1393d43874c..bef0704422c 100644 --- a/htdocs/includes/modules/societe/mod_codeclient_leopard.php +++ b/htdocs/includes/modules/societe/mod_codeclient_leopard.php @@ -24,9 +24,26 @@ class mod_codeclient_leopard { + /* + * Attention ce module est utilisé par défaut si aucun module n'a + * été définit dans la configuration + * + * Le fonctionnement de celui-ci doit dont rester le plus ouvert + * possible + */ + function mod_codeclient_leopard() { $this->nom = "Léopard"; + $this->code_modifiable = 1; + + $this->code_modifiable_invalide = 1; // code modifiable si il est invalide + + $this->code_modifiable_null = 1; // code modifiable si il est null + + $this->code_null = 1; + + } function info() diff --git a/htdocs/includes/modules/societe/mod_codeclient_zebre.php b/htdocs/includes/modules/societe/mod_codeclient_zebre.php index 672ab4db4ee..c1ffcbce5d6 100644 --- a/htdocs/includes/modules/societe/mod_codeclient_zebre.php +++ b/htdocs/includes/modules/societe/mod_codeclient_zebre.php @@ -27,6 +27,15 @@ class mod_codeclient_zebre function mod_codeclient_zebre() { $this->nom = "Zèbre"; + + $this->code_modifiable = 0; // code modifiable + + $this->code_modifiable_invalide = 0; // code modifiable si il est invalide + + $this->code_modifiable_null = 1; // code modifiable si il est null + + $this->code_null = 0; // Saisi vide interdite + } /*! \brief Renvoi la description du module * \return string Texte descripif @@ -42,13 +51,13 @@ class mod_codeclient_zebre * */ - function verif($db, $code) + function verif($db, $code, $socid=0) { if ($this->verif_syntax($code) == 0) { $i = 1; - $is_dispo = $this->verif_dispo($db, $code); + $is_dispo = $this->verif_dispo($db, $code, $socid); while ( $is_dispo <> 0 && $i < 99) { diff --git a/htdocs/soc.php b/htdocs/soc.php index 679f518f442..92bd170c11a 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -47,30 +47,27 @@ $soc = new Societe($db); if ($_POST["action"] == 'add' or $_POST["action"] == 'update') { - $soc->nom = $_POST["nom"]; - $soc->adresse = $_POST["adresse"]; - $soc->cp = $_POST["cp"]; - $soc->ville = $_POST["ville"]; - $soc->pays_id = $_POST["pays_id"]; - $soc->departement_id = $_POST["departement_id"]; - $soc->tel = $_POST["tel"]; - $soc->fax = $_POST["fax"]; - $soc->url = ereg_replace( "http://", "", $_POST["url"] ); - $soc->siren = $_POST["siren"]; - $soc->siret = $_POST["siret"]; - $soc->ape = $_POST["ape"]; - $soc->prefix_comm = $_POST["prefix_comm"]; - - if (strlen(trim($_POST["code_client"]))) - { - $soc->code_client = $_POST["code_client"]; - } - $soc->capital = $_POST["capital"]; - $soc->tva_intra = $_POST["tva_intra_code"] . $_POST["tva_intra_num"]; - $soc->forme_juridique_code = $_POST["forme_juridique_code"]; - $soc->effectif_id = $_POST["effectif_id"]; - $soc->client = $_POST["client"]; - $soc->fournisseur = $_POST["fournisseur"]; + $soc->nom = $_POST["nom"]; + $soc->adresse = $_POST["adresse"]; + $soc->cp = $_POST["cp"]; + $soc->ville = $_POST["ville"]; + $soc->pays_id = $_POST["pays_id"]; + $soc->departement_id = $_POST["departement_id"]; + $soc->tel = $_POST["tel"]; + $soc->fax = $_POST["fax"]; + $soc->url = ereg_replace( "http://", "", $_POST["url"] ); + $soc->siren = $_POST["siren"]; + $soc->siret = $_POST["siret"]; + $soc->ape = $_POST["ape"]; + $soc->prefix_comm = $_POST["prefix_comm"]; + $soc->code_client = $_POST["code_client"]; + $soc->codeclient_modifiable = $_POST["codeclient_modifiable"]; + $soc->capital = $_POST["capital"]; + $soc->tva_intra = $_POST["tva_intra_code"] . $_POST["tva_intra_num"]; + $soc->forme_juridique_code = $_POST["forme_juridique_code"]; + $soc->effectif_id = $_POST["effectif_id"]; + $soc->client = $_POST["client"]; + $soc->fournisseur = $_POST["fournisseur"]; if ($_POST["action"] == 'update') { @@ -208,6 +205,7 @@ elseif ($_GET["action"] == 'edit') $soc->id = $_GET["socid"]; $soc->fetch($_GET["socid"]); } + if ($soc->error_message) { print '