Merge pull request #1518 from altairis-fr/develop

add trigger CREATE_BUYPRICE
This commit is contained in:
Laurent Destailleur 2014-04-02 11:16:21 +02:00
commit 487a341a91

View File

@ -206,7 +206,7 @@ class ProductFournisseur extends Product
$result=$interface->run_triggers('UPDATE_BUYPRICE',$this,$user,$langs,$conf); $result=$interface->run_triggers('UPDATE_BUYPRICE',$this,$user,$langs,$conf);
if ($result < 0) if ($result < 0)
{ {
$error++; $this->errors=$interface->errors; $error++; $this->error=$interface->errors;
} }
if (empty($error)) if (empty($error))
@ -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->error=$interface->errors;
}
if (empty($error))
{
$this->db->commit();
return 0;
}
else
{
$this->db->rollback();
return 1;
}
} }
else else
{ {