From 0e7bcef86601664b5e4e6dcbdfed17f01f3e597a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Aug 2023 10:51:11 +0200 Subject: [PATCH] Clean code --- htdocs/compta/bank/class/account.class.php | 16 +++++----------- htdocs/user/class/userbankaccount.class.php | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index fc9288f54cb..dd27d39a8bc 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1539,25 +1539,19 @@ class Account extends CommonObject { require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; - $this->error_number = 0; - - // Call function to check BAN + $error = 0; + // Call functions to check BAN if (!checkIbanForAccount($this)) { - $this->error_number = 12; + $error++; $this->error_message = 'IBANNotValid'; } if (!checkSwiftForAccount($this)) { - $this->error_number = 12; + $error++; $this->error_message = 'SwiftNotValid'; } - /*if (! checkBanForAccount($this)) - { - $this->error_number = 12; - $this->error_message = 'BANControlError'; - }*/ - if ($this->error_number == 0) { + if (! $error) { return 1; } else { return 0; diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php index 85c8cbc7af7..e0bb67537b5 100644 --- a/htdocs/user/class/userbankaccount.class.php +++ b/htdocs/user/class/userbankaccount.class.php @@ -78,7 +78,7 @@ class UserBankAccount extends Account $this->userid = 0; $this->solde = 0; - $this->error_number = 0; + $this->balance = 0; }