From 43aedb0020c0060cb7955bf4a54ca891d166d4db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Nov 2008 07:50:47 +0000 Subject: [PATCH] Spanish bank account use full detailed informations --- htdocs/companybankaccount.class.php | 12 ++++++++++++ htdocs/compta/bank/account.class.php | 14 ++++++++++++++ htdocs/compta/bank/bankid_fr.php | 10 +++++----- htdocs/lib/bank.lib.php | 18 +++++++----------- htdocs/lib/company.lib.php | 4 ++-- htdocs/societe/rib.php | 8 ++++---- 6 files changed, 44 insertions(+), 22 deletions(-) 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 ''.$langs->trans("BankCode").''; print ''; @@ -272,10 +272,10 @@ if ($_GET["id"] && $_GET["action"] == 'edit' && $user->rights->banque->configure } print ''.$langs->trans("BankAccountNumber").''; - print ''; + print ''; print ''; - if ($account->getCountryCode() == 'FR') + if ($account->useDetailedBBAN()) { print ''.$langs->trans("BankAccountNumberKey").''; print ''; @@ -284,10 +284,10 @@ if ($_GET["id"] && $_GET["action"] == 'edit' && $user->rights->banque->configure // IBAN print ''.$langs->trans("IBAN").''; - print ''; + print ''; print ''.$langs->trans("BIC").''; - print ''; + print ''; print ''.$langs->trans("BankAccountDomiciliation").''; print "