add commit or rollback if error
This commit is contained in:
parent
00c2b1a32a
commit
a658ff7e90
@ -138,22 +138,21 @@ class ProductFournisseur extends Product
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::remove_product_fournisseur_price", LOG_DEBUG);
|
dol_syslog(get_class($this)."::remove_product_fournisseur_price", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if (!$resql)
|
||||||
{
|
|
||||||
$this->db->commit();
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
$this->db->rollback();
|
$error++;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
if (empty($error)){
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}else{
|
||||||
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user