New: add trigger PAYMENT_DELETE
This commit is contained in:
parent
b22a7ce335
commit
403302e5b5
@ -257,8 +257,12 @@ class Paiement extends CommonObject
|
|||||||
* Si le paiement porte sur au moins une facture a "payee", on refuse
|
* Si le paiement porte sur au moins une facture a "payee", on refuse
|
||||||
* @return int <0 si ko, >0 si ok
|
* @return int <0 si ko, >0 si ok
|
||||||
*/
|
*/
|
||||||
function delete()
|
function delete($notrigger=0)
|
||||||
{
|
{
|
||||||
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
|
||||||
$bank_line_id = $this->bank_line;
|
$bank_line_id = $this->bank_line;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -324,6 +328,16 @@ class Paiement extends CommonObject
|
|||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $notrigger)
|
||||||
|
{
|
||||||
|
// Appel des triggers
|
||||||
|
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||||
|
$interface=new Interfaces($this->db);
|
||||||
|
$result=$interface->run_triggers('PAYMENT_DELETE',$this,$user,$langs,$conf);
|
||||||
|
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
|
// Fin appel triggers
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@ -372,6 +372,10 @@ class InterfaceDemo
|
|||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
}
|
}
|
||||||
elseif ($action == 'PAYMENT_ADD_TO_BANK')
|
elseif ($action == 'PAYMENT_ADD_TO_BANK')
|
||||||
|
{
|
||||||
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
}
|
||||||
|
elseif ($action == 'PAYMENT_DELETE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user