diff --git a/htdocs/companybankaccount.class.php b/htdocs/companybankaccount.class.php index a4280ed8476..df8c395f12c 100644 --- a/htdocs/companybankaccount.class.php +++ b/htdocs/companybankaccount.class.php @@ -224,7 +224,19 @@ class CompanyBankAccount if (! empty($company->pays_code)) return $company->pays_code; return ''; + } + + /** + * \brief Return if a bank account is defined with detailed information (bank code, desk code, number and key) + * \return boolean true or false + */ + function useDetailedBBAN() + { + if ($this->getCountryCode() == 'FR') return true; + if ($this->getCountryCode() == 'ES') return true; + return false; } + } ?> diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php index 10f1bcc8ad6..fbf13f0885e 100644 --- a/htdocs/compta/bank/account.class.php +++ b/htdocs/compta/bank/account.class.php @@ -764,6 +764,20 @@ class Account extends CommonObject return ''; } + + /** + * \brief Return if a bank account is defined with detailed information (bank code, desk code, number and key) + * \return boolean true or false + */ + function useDetailedBBAN() + { + $country_code=$this->getCountryCode(); + + if ($country_code == 'FR') return true; + if ($country_code == 'ES') return true; + + return false; + } } diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php index 5bcd6a6ada7..5f3b6bfd4d9 100644 --- a/htdocs/compta/bank/bankid_fr.php +++ b/htdocs/compta/bank/bankid_fr.php @@ -260,7 +260,7 @@ if ($_GET["id"] && $_GET["action"] == 'edit' && $user->rights->banque->configure print ''; // BBAN - if ($account->getCountryCode() == 'FR') + if ($account->useDetailedBBAN()) { print '