Add trigger on deleteline for supplier order and move trigger on deleteline for supplier invoice after delete sql query
This commit is contained in:
parent
efa7a16c07
commit
676101b02f
@ -1408,6 +1408,16 @@ class CommandeFournisseur extends CommonOrder
|
||||
dol_syslog(get_class($this)."::deleteline sql=".$sql);
|
||||
if ($resql)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$result = 0;
|
||||
$interface=new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('LINEORDER_SUPPLIER_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
|
||||
$result=$this->update_price();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1259,18 +1259,6 @@ class FactureFournisseur extends CommonInvoice
|
||||
$error=0;
|
||||
$this->db->begin();
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LINEBILL_SUPPLIER_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Supprime ligne
|
||||
@ -1285,6 +1273,19 @@ class FactureFournisseur extends CommonInvoice
|
||||
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('LINEBILL_SUPPLIER_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user