diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 8c35c6c9e1f..6481c891d45 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -92,7 +92,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes') $newdiscount2->fk_facture=$discount->fk_facture; $newdiscount1->fk_facture_line=$discount->fk_facture_line; $newdiscount2->fk_facture_line=$discount->fk_facture_line; - if ($discount->description == '(CREDIT_NOTE)') + if ($discount->description == '(CREDIT_NOTE)' || $discount->description == '(DEPOSIT)') { $newdiscount1->description=$discount->description; $newdiscount2->description=$discount->description; diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 72f237999f8..398cf41bdaa 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -130,7 +130,9 @@ class CompanyBankAccount extends Account */ function update(User $user = null, $notrigger = 0) { - global $conf; + global $conf; + $error = 0; + if (! $this->id) { @@ -167,12 +169,33 @@ class CompanyBankAccount extends Account $result = $this->db->query($sql); if ($result) { - return 1; + + + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('COMPANY_RIB_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers + if(! $error ) + { + return 1; + } + else + { + return -1; + } + } + else + { + return 1; + } + } else { dol_print_error($this->db); - return 0; + return -1; } }