add trigger CREATE_BUYPRICE
This commit is contained in:
parent
d452624ebc
commit
ea74c4738e
@ -199,7 +199,7 @@ class ProductFournisseur extends Product
|
|||||||
dol_syslog(get_class($this).'::update_buyprice sql='.$sql);
|
dol_syslog(get_class($this).'::update_buyprice sql='.$sql);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
// 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);
|
||||||
@ -208,7 +208,7 @@ class ProductFournisseur extends Product
|
|||||||
{
|
{
|
||||||
$error++; $this->errors=$interface->errors;
|
$error++; $this->errors=$interface->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($error))
|
if (empty($error))
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
@ -286,8 +286,25 @@ class ProductFournisseur extends Product
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
// Appel des triggers
|
||||||
return 0;
|
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||||
|
$interface=new Interfaces($this->db);
|
||||||
|
$result=$interface->run_triggers('CREATE_BUYPRICE',$this,$user,$langs,$conf);
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
$error++; $this->errors=$interface->errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($error))
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->rollback();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user