Merge pull request #20522 from ATM-Consulting/FIX_16.0_missing_triggers_facturerec_facturefournisseurrec
FIX: missing trigger DELETE for FactureRec, FactureFournisseurRec
This commit is contained in:
commit
2eaae819f2
@ -39,6 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
*/
|
||||
class FactureRec extends CommonInvoice
|
||||
{
|
||||
const TRIGGER_PREFIX = 'BILLREC';
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
@ -501,7 +502,7 @@ class FactureRec extends CommonInvoice
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('BILLREC_UPDATE', $user);
|
||||
$result = $this->call_trigger('BILLREC_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
@ -816,7 +817,14 @@ class FactureRec extends CommonInvoice
|
||||
$this->error = $this->db->lasterror();
|
||||
$error = -2;
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('BILLREC_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
|
||||
@ -39,6 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
*/
|
||||
class FactureFournisseurRec extends CommonInvoice
|
||||
{
|
||||
const TRIGGER_PREFIX = 'SUPPLIERBILLREC';
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
@ -524,7 +525,7 @@ class FactureFournisseurRec extends CommonInvoice
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('BILLREC_UPDATE', $user);
|
||||
$result = $this->call_trigger('SUPPLIERBILLREC_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
@ -820,8 +821,15 @@ class FactureFournisseurRec extends CommonInvoice
|
||||
$this->error = $this->db->lasterror();
|
||||
$error = -2;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('SUPPLIERBILLREC_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
if (! $error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user