diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1345320f08a..c17e07bd17b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2269,7 +2269,10 @@ abstract class CommonObject */ public function setPaymentMethods($id) { + $error = 0; $notrigger = 0; + dol_syslog(get_class($this).'::setPaymentMethods('.$id.')'); + if ($this->statut >= 0 || $this->element == 'societe') { // TODO uniformize field name $fieldname = 'fk_mode_reglement'; @@ -2296,6 +2299,15 @@ abstract class CommonObject if (get_class($this) == 'Fournisseur') { $this->mode_reglement_supplier_id = $id; } + // Triggers + if (!$error && !$notrigger) { + // Call triggers + $result = $this->call_trigger(strtoupper(get_class($this)).'_MODIFY', $user); + if ($result < 0) { + $error++; + } + // End call triggers + } return 1; } else { dol_syslog(get_class($this).'::setPaymentMethods Error '.$this->db->error());