On spare les caractrisitque de comptes financiers en 2 onglets. Un pour les carac gnrales et un pour les carac propres au pays.

This commit is contained in:
Laurent Destailleur 2006-08-11 22:56:54 +00:00
parent f894bc0f3e
commit 78e1b4730c
11 changed files with 83 additions and 97 deletions

View File

@ -246,8 +246,6 @@ $form = new Form($db);
if ($account->type == 0 || $account->type == 1)
{
// If bank account
print '<tr><td colspan="4"><b>'.$langs->trans("IfBankAccount").'...</b></td></tr>';
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.$account->bank.'"></td>';
print '</tr>';

View File

@ -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 '</td></tr>';
// Pays
print '<tr><td valign="top">'.$langs->trans("Country").'</td>';
print '<td colspan="3">';
$selectedcode=$account->account_country_code;
if (! $selectedcode) $selectedcode=$mysoc->pays_code;
$form->select_pays($selectedcode, 'account_country_code');
print '</td></tr>';
// Web
print '<tr><td valign="top">'.$langs->trans("Web").'</td>';
print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.$_POST["url"].'"></td></tr>';
@ -237,39 +235,6 @@ if ($_GET["action"] == 'create')
print '<tr><td valign="top">'.$langs->trans("BalanceMinimalDesired").'</td>';
print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_desired" value="'.$account->account_min_desired.'"></td></tr>';
// If bank account
print '<tr><td colspan="4"><b>'.$langs->trans("IfBankAccount").'...</b></td></tr>';
print '<tr><td valign="top">'.$langs->trans("Conciliation").'</td>';
print '<td colspan="3"><input type="checkbox" name="norappro" value="'.$_POST["norappro"].'"> '.$langs->trans("DisableConciliation").'</td></tr>';
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.$_POST["bank"].'"></td></tr>';
print '<tr><td>Code Banque</td><td>Code Guichet</td><td>Numéro</td><td>Clé RIB</td></tr>';
print '<tr><td><input size="8" type="text" class="flat" name="code_banque" value="'.$_POST["code_banque"].'"></td>';
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$_POST["code_guichet"].'"></td>';
print '<td><input size="15" type="text" class="flat" name="number" value="'.$_POST["number"].'"></td>';
print '<td><input size="3" type="text" class="flat" name="cle_rib" value="'.$_POST["cle_rib"].'"></td></tr>';
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
print '<td colspan="3"><input size="24" type="text" class="flat" name="iban_prefix" value="'.$_POST["iban_prefix"].'"></td></tr>';
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
print '<td colspan="3"><input size="24" type="text" class="flat" name="bic" value="'.$_POST["bic"].'"></td></tr>';
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">';
print "<textarea class=\"flat\" name=\"domiciliation\" rows=\"2\" cols=\"40\">".$_POST["domiciliation"];
print "</textarea></td></tr>";
print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td>';
print '<td colspan="3"><input size="30" type="text" class="flat" name="proprio" value="'.$_POST["proprio"].'"></td></tr>';
print '<tr><td valign="top">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="3">';
print "<textarea class=\"flat\" name=\"adresse_proprio\" rows=\"2\" cols=\"40\">".$_POST["adresse_proprio"];
print "</textarea></td></tr>";
print '<tr><td align="center" colspan="4"><input value="'.$langs->trans("CreateAccount").'" type="submit" class="button"></td></tr>';
print '</form>';
print '</table>';

View File

@ -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

View File

@ -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 '<select class="flat" name="'.$htmlname.'" '.$htmloption.'>';
$num = $this->db->num_rows();
$i = 0;
if ($num)
{
$foundselected=false;
while ($i < $num)
{
$obj = $this->db->fetch_object();
if ($selected > 0 && $selected == $obj->rowid)
{
$foundselected=true;
print '<option value="'.$obj->rowid.'" selected="true">';
}
else
{
print '<option value="'.$obj->rowid.'">';
}
// Si traduction existe, on l'utilise, sinon on prend le libellé par défaut
if ($obj->code) { print $obj->code . ' - '; }
print ($obj->code && $langs->trans("Country".$obj->code)!="Country".$obj->code?$langs->trans("Country".$obj->code):($obj->libelle!='-'?$obj->libelle:'&nbsp;'));
print '</option>';
$i++;
}
}
print '</select>';
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 '<select class="flat" name="'.$htmlname.'" '.$htmloption.'>';
$num = $this->db->num_rows();
$i = 0;
if ($num)
{
$foundselected=false;
while ($i < $num)
{
$obj = $this->db->fetch_object();
if ($selected && $selected != '-1' && ($selected == $obj->rowid || $selected == $obj->code))
{
$foundselected=true;
print '<option value="'.$obj->rowid.'" selected="true">';
}
else
{
print '<option value="'.$obj->rowid.'">';
}
// Si traduction existe, on l'utilise, sinon on prend le libellé par défaut
if ($obj->code) { print $obj->code . ' - '; }
print ($obj->code && $langs->trans("Country".$obj->code)!="Country".$obj->code?$langs->trans("Country".$obj->code):($obj->libelle!='-'?$obj->libelle:'&nbsp;'));
print '</option>';
$i++;
}
}
print '</select>';
return 0;
}
else {
dolibarr_print_error($this->db);
return 1;
}
}
/**

View File

@ -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);
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -1,6 +1,6 @@
-- =============================================================================
-- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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;