Skip to content
Snippets Groups Projects
Commit 8194d434 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Si code compta ou code client non fourni on ne stocke rien plutot que chaine vide.

parent 6e9969c6
No related branches found
No related tags found
No related merge requests found
......@@ -310,37 +310,28 @@ class Societe {
if ($this->pays_id)
{ $sql .= ",fk_pays = '" . $this->pays_id ."'"; }
$sql .= ",tel = '" . $this->tel ."'";
$sql .= ",fax = '" . $this->fax ."'";
$sql .= ",url = '" . $this->url ."'";
$sql .= ",siren = '" . $this->siren ."'";
$sql .= ",siret = '" . $this->siret ."'";
$sql .= ",ape = '" . $this->ape ."'";
$sql .= ",tel = ".($this->tel?"'".$this->tel."'":"null");
$sql .= ",fax = ".($this->fax?"'".$this->fax."'":"null");
$sql .= ",url = ".($this->url?"'".$this->url."'":"null");
$sql .= ",siren = '". $this->siren ."'";
$sql .= ",siret = '". $this->siret ."'";
$sql .= ",ape = '". $this->ape ."'";
$sql .= ",tva_intra = '" . $this->tva_intra ."'";
$sql .= ",capital = '" . $this->capital ."'";
if ($this->prefix_comm)
{ $sql .= ",prefix_comm = '" . $this->prefix_comm ."'"; }
if ($this->prefix_comm) $sql .= ",prefix_comm = '" . $this->prefix_comm ."'";
if ($this->effectif_id)
{ $sql .= ",fk_effectif = '" . $this->effectif_id ."'"; }
if ($this->effectif_id) $sql .= ",fk_effectif = '" . $this->effectif_id ."'";
if ($this->typent_id)
{ $sql .= ",fk_typent = '" . $this->typent_id ."'"; }
if ($this->typent_id) $sql .= ",fk_typent = '" . $this->typent_id ."'";
if ($this->forme_juridique_code)
{
$sql .= ",fk_forme_juridique = '".$this->forme_juridique_code."'";
}
if ($this->forme_juridique_code) $sql .= ",fk_forme_juridique = '".$this->forme_juridique_code."'";
$sql .= ",client = " . $this->client;
$sql .= ",fournisseur = " . $this->fournisseur;
if ($user)
{
$sql .= ",fk_user_modif = '".$user->id."'";
}
if ($this->creation_bit || $this->codeclient_modifiable)
{
// Attention check_codeclient peut modifier le code
......@@ -348,16 +339,18 @@ class Societe {
$this->check_codeclient();
$sql .= ", code_client = '". $this->code_client ."'";
$sql .= ", code_client = ".($this->code_client?"'".$this->code_client."'":"null");
// Attention check_codecompta peut modifier le code
// suivant le module utilis
$this->check_codecompta();
$sql .= ", code_compta = '". $this->code_compta ."'";
$sql .= ", code_compta = ".($this->code_compta?"'".$this->code_compta."'":"null");
}
if ($user) $sql .= ",fk_user_modif = '".$user->id."'";
$sql .= " WHERE idp = '" . $id ."'";
if ($this->db->query($sql))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment