From 559e621fd281e322bb896ca425b777f34fe87913 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Dec 2015 19:54:56 +0100 Subject: [PATCH] Fix conflict with trigger to delete payment customer and supplier. --- htdocs/compta/paiement/class/paiement.class.php | 2 +- htdocs/fourn/class/paiementfourn.class.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 7e94a1f5448..f9a822fdfc8 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -376,7 +376,7 @@ class Paiement extends CommonObject if (! $notrigger) { // Appel des triggers - $result=$this->call_trigger('PAYMENT_DELETE', $user); + $result=$this->call_trigger('PAYMENT_CUSTOMER_DELETE', $user); if ($result < 0) { $this->db->rollback(); diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index df122ef1fff..7ca6e2c305c 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -319,6 +319,19 @@ class PaiementFourn extends Paiement return -4; } } + + if (! $notrigger) + { + // Appel des triggers + $result=$this->call_trigger('PAYMENT_SUPPLIER_DELETE', $user); + if ($result < 0) + { + $this->db->rollback(); + return -1; + } + // Fin appel triggers + } + $this->db->commit(); return 1; }