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
|
class FactureRec extends CommonInvoice
|
||||||
{
|
{
|
||||||
|
const TRIGGER_PREFIX = 'BILLREC';
|
||||||
/**
|
/**
|
||||||
* @var string ID to identify managed object
|
* @var string ID to identify managed object
|
||||||
*/
|
*/
|
||||||
@ -501,7 +502,7 @@ class FactureRec extends CommonInvoice
|
|||||||
|
|
||||||
if (!$error && !$notrigger) {
|
if (!$error && !$notrigger) {
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result = $this->call_trigger('BILLREC_UPDATE', $user);
|
$result = $this->call_trigger('BILLREC_MODIFY', $user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -2;
|
return -2;
|
||||||
@ -816,7 +817,14 @@ class FactureRec extends CommonInvoice
|
|||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
$error = -2;
|
$error = -2;
|
||||||
}
|
}
|
||||||
|
if (!$error && !$notrigger) {
|
||||||
|
// Call trigger
|
||||||
|
$result = $this->call_trigger('BILLREC_DELETE', $user);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@ -39,6 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||||||
*/
|
*/
|
||||||
class FactureFournisseurRec extends CommonInvoice
|
class FactureFournisseurRec extends CommonInvoice
|
||||||
{
|
{
|
||||||
|
const TRIGGER_PREFIX = 'SUPPLIERBILLREC';
|
||||||
/**
|
/**
|
||||||
* @var string ID to identify managed object
|
* @var string ID to identify managed object
|
||||||
*/
|
*/
|
||||||
@ -524,7 +525,7 @@ class FactureFournisseurRec extends CommonInvoice
|
|||||||
|
|
||||||
if (!$error && !$notrigger) {
|
if (!$error && !$notrigger) {
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result = $this->call_trigger('BILLREC_UPDATE', $user);
|
$result = $this->call_trigger('SUPPLIERBILLREC_MODIFY', $user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -2;
|
return -2;
|
||||||
@ -820,7 +821,14 @@ class FactureFournisseurRec extends CommonInvoice
|
|||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
$error = -2;
|
$error = -2;
|
||||||
}
|
}
|
||||||
|
if (!$error && !$notrigger) {
|
||||||
|
// Call trigger
|
||||||
|
$result = $this->call_trigger('SUPPLIERBILLREC_DELETE', $user);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user