Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-01-26 14:08:20 +01:00
commit 0d66646052

View File

@ -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());