From 78e1b4730c308085742a65b5e31838169b6bfba1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Aug 2006 22:56:54 +0000 Subject: [PATCH] =?UTF-8?q?On=20s=E9pare=20les=20caract=E9risitque=20de=20?= =?UTF-8?q?comptes=20financiers=20en=202=20onglets.=20Un=20pour=20les=20ca?= =?UTF-8?q?rac=20g=E9n=E9rales=20et=20un=20pour=20les=20carac=20propres=20?= =?UTF-8?q?au=20pays.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/bank/bankid_fr.php | 2 - htdocs/compta/bank/fiche.php | 55 +++--------- htdocs/compta/facture.php | 2 +- htdocs/html.form.class.php | 87 ++++++++++--------- .../menus/barre_left/eldy_backoffice.php | 4 +- htdocs/langs/en_US/banks.lang | 7 +- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/fr_FR/banks.lang | 7 +- htdocs/langs/fr_FR/main.lang | 1 + mysql/migration/2.0.0-2.1.0.sql | 6 +- mysql/tables/llx_bank_account.sql | 8 +- 11 files changed, 83 insertions(+), 97 deletions(-) diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php index 8637ee360eb..42ad1553593 100644 --- a/htdocs/compta/bank/bankid_fr.php +++ b/htdocs/compta/bank/bankid_fr.php @@ -246,8 +246,6 @@ $form = new Form($db); if ($account->type == 0 || $account->type == 1) { // If bank account - print ''.$langs->trans("IfBankAccount").'...'; - print ''.$langs->trans("Bank").''; print ''; print ''; diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index bd38dc1ac00..94d3002fa3e 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -53,24 +53,13 @@ if ($_POST["action"] == 'add') $account->rappro = $_POST["norappro"]?1:0; $account->url = $_POST["url"]; - $account->bank = trim($_POST["bank"]); - $account->code_banque = $_POST["code_banque"]; - $account->code_guichet = $_POST["code_guichet"]; - $account->number = $_POST["number"]; - $account->cle_rib = $_POST["cle_rib"]; - $account->bic = $_POST["bic"]; - $account->iban_prefix = $_POST["iban_prefix"]; - $account->domiciliation = trim($_POST["domiciliation"]); - - $account->proprio = trim($_POST["proprio"]); - $account->adresse_proprio = trim($_POST["adresse_proprio"]); - $account->account_number = trim($_POST["account_number"]); $account->solde = $_POST["solde"]; $account->date_solde = mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); $account->currency_code = trim($_POST["account_currency_code"]); + $account->country_code = trim($_POST["account_country_code"]); $account->min_allowed = $_POST["account_min_allowed"]; $account->min_desired = $_POST["account_min_desired"]; @@ -121,6 +110,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"]) $account->account_number = trim($_POST["account_number"]); $account->currency_code = trim($_POST["account_currency_code"]); + $account->country_code = trim($_POST["account_country_code"]); $account->min_allowed = $_POST["account_min_allowed"]; $account->min_desired = $_POST["account_min_desired"]; @@ -213,6 +203,14 @@ if ($_GET["action"] == 'create') print $langs->trans("Currency".$conf->monnaie); print ''; + // Pays + print ''.$langs->trans("Country").''; + print ''; + $selectedcode=$account->account_country_code; + if (! $selectedcode) $selectedcode=$mysoc->pays_code; + $form->select_pays($selectedcode, 'account_country_code'); + print ''; + // Web print ''.$langs->trans("Web").''; print ''; @@ -237,39 +235,6 @@ if ($_GET["action"] == 'create') print ''.$langs->trans("BalanceMinimalDesired").''; print ''; - - // If bank account - print ''.$langs->trans("IfBankAccount").'...'; - - print ''.$langs->trans("Conciliation").''; - print ' '.$langs->trans("DisableConciliation").''; - - print ''.$langs->trans("Bank").''; - print ''; - - print 'Code BanqueCode GuichetNuméroClé RIB'; - print ''; - print ''; - print ''; - print ''; - - print ''.$langs->trans("IBAN").''; - print ''; - - print ''.$langs->trans("BIC").''; - print ''; - - print ''.$langs->trans("BankAccountDomiciliation").''; - print ""; - - print ''.$langs->trans("BankAccountOwner").''; - print ''; - - print ''.$langs->trans("BankAccountOwnerAddress").''; - print ""; - print ''; print ''; print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4a49c05e950..11964dde851 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1423,7 +1423,7 @@ else $head = facture_prepare_head($fac); - dolibarr_fiche_head($head, 0, $langs->trans('InvoiceCustomer')); + dolibarr_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer')); /* * Confirmation de la suppression de la facture diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index cc1ac676c6d..9a1d1698b82 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -291,55 +291,56 @@ class Form /** * \brief Retourne la liste déroulante des pays actifs, dans la langue de l'utilisateur - * \param selected Code pays pré-sélectionné + * \param selected Id ou code pays pré-sélectionné * \param htmlname Nom de la liste deroulante * \param htmloption Options html sur le select * \todo trier liste sur noms après traduction plutot que avant */ function select_pays($selected='',$htmlname='pays_id',$htmloption='') { - global $conf,$langs; - $langs->load("dict"); - - $sql = "SELECT rowid, libelle, code, active FROM ".MAIN_DB_PREFIX."c_pays"; - $sql .= " WHERE active = 1"; - $sql .= " ORDER BY code ASC;"; - - if ($this->db->query($sql)) - { - print ''; - return 0; - } - else { - dolibarr_print_error($this->db); - return 1; - } - } + global $conf,$langs; + $langs->load("dict"); + + $sql = "SELECT rowid, code, libelle, active"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; + $sql.= " WHERE active = 1"; + $sql.= " ORDER BY code ASC;"; + + if ($this->db->query($sql)) + { + print ''; + return 0; + } + else { + dolibarr_print_error($this->db); + return 1; + } + } /** diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index 47cc25c051a..e5cb8029c98 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -419,7 +419,7 @@ class MenuLeft { if ($conf->banque->enabled) { $langs->load("banks"); - $newmenu->add(DOL_URL_ROOT."/compta/bank/index.php?leftmenu=bank&mainmenu=bank",$langs->trans("Bank"),0,$user->rights->banque->lire); + $newmenu->add(DOL_URL_ROOT."/compta/bank/index.php?leftmenu=bank&mainmenu=bank",$langs->trans("MenuBankCash"),0,$user->rights->banque->lire); } // Rapports @@ -448,6 +448,8 @@ class MenuLeft { if ($leftmenu=="ca") $newmenu->add_submenu(DOL_URL_ROOT."/compta/stats/cabyuser.php?leftmenu=ca",$langs->trans("ByUsers"),2,$user->rights->compta->resultat->lire||$user->rights->comptaexpert->comptarapport->lire); } + $newmenu->add(DOL_URL_ROOT."/compta/bank/config.php",$langs->trans("MenuSetupBank"),0,$user->rights->banque->configurer); + } diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 2ad8a86bc8f..5f2bba4f589 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -1,6 +1,9 @@ # Dolibarr language file - en_US - banks Bank=Bank Banks=Banks +MenuBankCash=Bank/Cash +MenuSetupBank=Bank/Cash setup +BankName=Bank name FinancialAccount=Account FinancialAccounts=Accounts BankAccount=Bank account @@ -14,6 +17,8 @@ SavingAccount=Saving account SavingAccounts=Saving accounts ErrorBankLabelAlreadyExists=Financial account label already exists BankBalance=Balance +BalanceMinimalAllowed=Minimum allowed balance +BalanceMinimalDesired=Minimum desired balance InitialBankBalance=Initial balance EndBankBalance=End balance CurrentBalance=Current balance @@ -43,7 +48,7 @@ NewCurrentAccount=New current account NewSavingAccount=New saving account NewCashAccount=New cash account EditFinancialAccount=Edit account -AccountSetup=Account setup +AccountSetup=Financial accounts setup SearchBankMovement=Search bank movement Debts=Debts LabelBankCashAccount=Bank or cash label diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 30e26b9c29c..f2a79aaa6bd 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -319,6 +319,7 @@ ShowCustomerPreview=Show customer preview ShowSupplierPreview=Show supplier preview ShowAccountancyPreview=Show accountancy preview RefCustomer=Ref. customer +Currency=Currency # Countries CountryFR=France CountryBE=Belgium diff --git a/htdocs/langs/fr_FR/banks.lang b/htdocs/langs/fr_FR/banks.lang index 0ac3a9b9dfe..139d61c1b4d 100644 --- a/htdocs/langs/fr_FR/banks.lang +++ b/htdocs/langs/fr_FR/banks.lang @@ -1,6 +1,9 @@ # Dolibarr language file - fr_FR - banks Bank=Banque Banks=Banques +MenuBankCash=Banques/Caisses +MenuSetupBank=Param. banque/caisse +BankName=Nom de la banque FinancialAccount=Compte FinancialAccounts=Comptes BankAccount=Compte bancaire @@ -14,6 +17,8 @@ SavingAccount=Compte SavingAccounts=Comptes épargnes/placements ErrorBankLabelAlreadyExists=Libellé de compte financier déjà existant BankBalance=Solde +BalanceMinimalAllowed=Solde minimum autorisé +BalanceMinimalDesired=Solde minimum désiré InitialBankBalance=Solde initial EndBankBalance=Solde final CurrentBalance=Solde actuel @@ -43,7 +48,7 @@ NewCurrentAccount=Nouveau compte courant NewSavingAccount=Nouveau compte épargne NewCashAccount=Nouveau compte caisse EditFinancialAccount=Edition compte -AccountSetup=Configuration des comptes +AccountSetup=Configuration des comptes financiers SearchBankMovement=Recherche écriture bancaire Debts=Dettes LabelBankCashAccount=Libellé compte ou caisse diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index fe72263acc7..3c21b30de0c 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -319,6 +319,7 @@ ShowCustomerPreview=Afficher aper ShowSupplierPreview=Afficher aperçu fournisseur ShowAccountancyPreview=Afficher aperçu compta RefCustomer=Réf. client +Currency=Devise # Countries CountryFR=France CountryBE=Belgique diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql index 129dd4f947b..93aa282f462 100644 --- a/mysql/migration/2.0.0-2.1.0.sql +++ b/mysql/migration/2.0.0-2.1.0.sql @@ -296,7 +296,11 @@ insert into llx_c_pays (rowid,code,libelle) values (30, 'SG', 'Singapoure'); alter table llx_bank_account add column ref varchar(12) NOT NULL; alter table llx_bank_account add column url varchar(128); - +alter table llx_bank_account add column currency_code varchar(2) NOT NULL; +alter table llx_bank_account add column min_allowed integer DEFAULT 0; +alter table llx_bank_account add column min_desired integer DEFAULT 0; +alter table llx_bank_account add column comment varchar(254); +update llx_bank_account set currency_code='EU'; alter table llx_accountingsystem_det rename to llx_accountingaccount; diff --git a/mysql/tables/llx_bank_account.sql b/mysql/tables/llx_bank_account.sql index 5613eaf8e64..d65e5909e36 100644 --- a/mysql/tables/llx_bank_account.sql +++ b/mysql/tables/llx_bank_account.sql @@ -1,6 +1,6 @@ -- ============================================================================= -- Copyright (C) 2000-2004 Rodolphe Quiedeville --- Copyright (C) 2004-2005 Laurent Destailleur +-- Copyright (C) 2004-2006 Laurent Destailleur -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -46,5 +46,9 @@ create table llx_bank_account clos smallint DEFAULT 0 NOT NULL, rappro smallint DEFAULT 1, url varchar(128), - account_number varchar(8) + account_number varchar(8), + currency_code varchar(2) NOT NULL, + min_allowed integer DEFAULT 0, + min_desired integer DEFAULT 0, + comment comment varchar(254) )type=innodb;