Correction conflit CVS

This commit is contained in:
Rodolphe Quiedeville 2005-02-28 15:23:33 +00:00
parent 7d06600479
commit f332032fac

View File

@ -127,9 +127,12 @@ class Societe {
$ret = $this->update($this->id); $ret = $this->update($this->id);
if ($ret == 0) { if ($ret == 0)
{
$this->db->commit(); $this->db->commit();
} else { }
else
{
dolibarr_syslog("Societe::create echec update"); dolibarr_syslog("Societe::create echec update");
$this->db->rollback(); $this->db->rollback();
return -3; return -3;
@ -138,12 +141,15 @@ class Societe {
return $ret; return $ret;
} }
else else
{ {
if ($this->db->errno() == DB_ERROR_RECORD_ALREADY_EXISTS) if ($this->db->errno() == DB_ERROR_RECORD_ALREADY_EXISTS)
{ {
$this->error=$langs->trans("ErrorCompanyNameAlreadyExists",$this->nom); $this->error=$langs->trans("ErrorCompanyNameAlreadyExists",$this->nom);
} }
else { else
{
dolibarr_syslog("Societe::create echec insert sql=$sql"); dolibarr_syslog("Societe::create echec insert sql=$sql");
} }
$this->db->rollback(); $this->db->rollback();
@ -151,15 +157,14 @@ class Societe {
} }
} }
else { else
{
$this->db->rollback(); $this->db->rollback();
dolibarr_syslog("Societe::Create echec verify sql=$sql"); dolibarr_syslog("Societe::Create echec verify sql=$sql");
return -1; return -1;
} }
} }
/** /**
* \brief Verification lors de la modification * \brief Verification lors de la modification
* \return 0 si ok, < 0 en cas d'erreur * \return 0 si ok, < 0 en cas d'erreur
@ -300,13 +305,12 @@ class Societe {
$sql .= ",siren = '" . $this->siren ."'"; $sql .= ",siren = '" . $this->siren ."'";
$sql .= ",siret = '" . $this->siret ."'"; $sql .= ",siret = '" . $this->siret ."'";
$sql .= ",ape = '" . $this->ape ."'"; $sql .= ",ape = '" . $this->ape ."'";
$sql .= ",tva_intra = '" . $this->tva_intra ."'";
$sql .= ",capital = '" . $this->capital ."'";
if ($this->prefix_comm) if ($this->prefix_comm)
{ $sql .= ",prefix_comm = '" . $this->prefix_comm ."'"; } { $sql .= ",prefix_comm = '" . $this->prefix_comm ."'"; }
if ($this->tva_intra)
{ $sql .= ",tva_intra = '" . $this->tva_intra ."'"; }
if ($this->capital)
{ $sql .= ",capital = '" . $this->capital ."'"; }
if ($this->effectif_id) if ($this->effectif_id)
{ $sql .= ",fk_effectif = '" . $this->effectif_id ."'"; } { $sql .= ",fk_effectif = '" . $this->effectif_id ."'"; }