Merge pull request #678 from atm-maxime/develop

Supplier order : add trigger on product dispatch
This commit is contained in:
Laurent Destailleur 2013-02-21 12:44:43 -08:00
commit 4a8883dc92

View File

@ -1292,7 +1292,22 @@ class CommandeFournisseur extends CommonOrder
dol_syslog(get_class($this)."::DispatchProduct sql=".$sql);
$resql = $this->db->query($sql);
if (! $resql)
if ($resql)
{
if (! $notrigger)
{
global $conf, $langs, $user;
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('LINEORDER_SUPPLIER_DISPATCH',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
}
$this->db->commit();
}
else
{
$this->error=$this->db->lasterror();
$error++;