diff --git a/ChangeLog b/ChangeLog index 16ba71ffce9..a6fa992f319 100644 --- a/ChangeLog +++ b/ChangeLog @@ -56,6 +56,7 @@ For users: - New: Update libs/tools/logo for DoliWamp (now use PHP 5.3). - New: Added ODT Template tag {object_total_discount} - New: Add new import options: Third parties bank details, warehouses and stocks, categories and suppliers prices +- New: English bank account need a bank code (called sort code) to identify an account. New experimental modules: - New: Add margin management module. diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 43a21712b98..9a7380dd6e7 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -975,18 +975,19 @@ class Account extends CommonObject } /** - * Return if a bank account is defined with detailed information (bank code, desk code, number and key) + * Return if a bank account is defined with detailed information (bank code, desk code, number and key). + * More information on codes used by countries on page http://en.wikipedia.org/wiki/Bank_code * - * @return int 0=Use only an account number + * @return int 0=Use only an account number * 1=Need Bank, Desk, Number and Key (France, Spain, ...) - * 2=Neek Bank only (BSB for Australia) + * 2=Neek Bank only (Sort code for Great Britain, BSB for Australia) */ function useDetailedBBAN() { $country_code=$this->getCountryCode(); if (in_array($country_code,array('FR','ES','GA'))) return 1; // France, Spain, Gabon - if (in_array($country_code,array('AU'))) return 2; // Australia + if (in_array($country_code,array('AU','GB'))) return 2; // Australia, Great Britain return 0; } diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index 490b228f25a..75aaff172c5 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -78,17 +78,22 @@ if ($_POST["action"] == 'add') if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number)) { - $message='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountancyCode")).'
'; + setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), 'error'); $action='create'; // Force chargement page en mode creation $error++; } - - if (empty($account->label)) + if (empty($account->ref)) { - $message='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'
'; + setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), 'errors'); $action='create'; // Force chargement page en mode creation $error++; } + if (empty($account->label)) + { + setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), 'errors'); + $action='create'; // Force chargement page en mode creation + $error++; + } if (! $error) { @@ -98,7 +103,7 @@ if ($_POST["action"] == 'add') $_GET["id"]=$id; // Force chargement page en mode visu } else { - $message='
'.$account->error.'
'; + setEventMessage($account->error,'errors'); $action='create'; // Force chargement page en mode creation } } @@ -144,17 +149,22 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"]) if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number)) { - $message='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountancyCode")).'
'; + setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), 'error'); $action='edit'; // Force chargement page en mode creation $error++; } - - if (empty($account->label)) + if (empty($account->ref)) { - $message='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'
'; + setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), 'errors'); $action='edit'; // Force chargement page en mode creation $error++; } + if (empty($account->label)) + { + setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), 'errors'); + $action='edit'; // Force chargement page en mode creation + $error++; + } if (! $error) { @@ -256,7 +266,7 @@ if ($action == 'create') print ''; // Country - print ''.$langs->trans("Country").''; + print ''.$langs->trans("BankAccountCountry").''; print ''; $selectedcode=''; if (isset($_POST["account_country_id"])) @@ -396,7 +406,7 @@ else print ''.$account->getLibStatut(4).''; // Country - print ''.$langs->trans("Country").''; + print ''.$langs->trans("BankAccountCountry").''; if ($account->fk_pays > 0) { $img=picto_from_langcode($account->country_code); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index f267ab0a496..1c9db467dcf 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2879,8 +2879,8 @@ class Facture extends CommonInvoice $this->cond_reglement_id = 1; $this->cond_reglement_code = 'RECEP'; $this->date_lim_reglement=$this->calculate_date_lim_reglement(); - $this->mode_reglement_id = 7; - $this->mode_reglement_code = 'CHQ'; + $this->mode_reglement_id = 0; // Not forced to show payment mode CHQ + VIR + $this->mode_reglement_code = ''; // Not forced to show payment mode CHQ + VIR $this->note_public='This is a comment (public)'; $this->note_private='This is a comment (private)'; $this->note='This is a comment (private)'; diff --git a/htdocs/langs/en_GB/bills.lang b/htdocs/langs/en_GB/bills.lang index 60c38ade196..d019dcb93be 100644 --- a/htdocs/langs/en_GB/bills.lang +++ b/htdocs/langs/en_GB/bills.lang @@ -14,6 +14,7 @@ ChequesReceipts=Cheques receipts ChequesArea=Cheques deposits area ChequeDeposits=Cheques deposits Cheques=Cheques +BankCode=Sort code # PaymentConditions PaymentConditionShortRECEP=Due on Receipt diff --git a/htdocs/langs/en_GB/exports.lang b/htdocs/langs/en_GB/exports.lang new file mode 100644 index 00000000000..60436970774 --- /dev/null +++ b/htdocs/langs/en_GB/exports.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - en_GB - exports +CHARSET=UTF-8 +BankCode=Sort code \ No newline at end of file