Correction trigger on update product buyprice

This commit is contained in:
geoffrey.girard 2014-01-22 10:44:23 +01:00
parent 8729790016
commit 7f59def98b

View File

@ -200,8 +200,6 @@ class ProductFournisseur extends Product
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
$this->db->commit();
// Appel des triggers // Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db); $interface=new Interfaces($this->db);
@ -211,9 +209,18 @@ class ProductFournisseur extends Product
$error++; $this->errors=$interface->errors; $error++; $this->errors=$interface->errors;
} }
if (empty($error))
{
$this->db->commit();
return 0; return 0;
} }
else else
{
$this->db->rollback();
return 1;
}
}
else
{ {
$this->error=$this->db->error()." sql=".$sql; $this->error=$this->db->error()." sql=".$sql;
$this->db->rollback(); $this->db->rollback();