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);
|
dol_syslog(get_class($this)."::deleteline sql=".$sql);
|
||||||
if ($resql)
|
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();
|
$result=$this->update_price();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1259,18 +1259,6 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$error=0;
|
$error=0;
|
||||||
$this->db->begin();
|
$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)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Supprime ligne
|
// Supprime ligne
|
||||||
@ -1286,6 +1274,19 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Mise a jour prix facture
|
// Mise a jour prix facture
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user