Skip to content

Commit

Permalink
Supplier order : add trigger on product dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Kohlhaas committed Feb 21, 2013
1 parent ec3dab2 commit 2f5bf06
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion htdocs/fourn/class/fournisseur.commande.class.php
Expand Up @@ -1292,7 +1292,22 @@ function DispatchProduct($user, $product, $qty, $entrepot, $price=0, $comment=''

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++;
Expand Down

0 comments on commit 2f5bf06

Please sign in to comment.