diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php deleted file mode 100644 index f20d70ef14f..00000000000 --- a/htdocs/compta/bank/bankid_fr.php +++ /dev/null @@ -1,477 +0,0 @@ - - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2008 Laurent Destailleur - * Copytight (C) 2005-2009 Regis Houssin - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/compta/bank/bankid_fr.php - * \ingroup banque - * \brief Fiche creation compte bancaire - */ - -require('../../main.inc.php'); -require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); -$langs->load("bills"); - -$action=GETPOST('action'); -$id=GETPOST('id','int'); -$ref=GETPOST('ref'); - -// Security check -if (isset($_GET["id"]) || isset($_GET["ref"])) -{ - $id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:''); -} -$fieldid = isset($_GET["ref"])?'ref':'rowid'; -if ($user->societe_id) $socid=$user->societe_id; -$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid); - - -/* - * Actions - */ - -if ($action == 'update' && ! $_POST["cancel"]) -{ - // Modification - $account = new Account($db); - $account->fetch($id); - - $account->bank = trim($_POST["bank"]); - $account->code_banque = trim($_POST["code_banque"]); - $account->code_guichet = trim($_POST["code_guichet"]); - $account->number = trim($_POST["number"]); - $account->cle_rib = trim($_POST["cle_rib"]); - $account->bic = trim($_POST["bic"]); - $account->iban = trim($_POST["iban"]); - $account->domiciliation = trim($_POST["domiciliation"]); - $account->proprio = trim($_POST["proprio"]); - $account->owner_address = trim($_POST["owner_address"]); - $account->state_id = trim($_POST["state_id"]); - //$account->country_id = trim($_POST["country_id"]); // We do not change this. - - if ($account->id) - { - $result = $account->update_bban($user); - if ($result >= 0) - { - $_GET["id"]=$_POST["id"]; // Force chargement page en mode visu - } - else - { - setEventMessage($account->error, 'errors'); - $action='edit'; // Force chargement page edition - } - } -} - -if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer) -{ - // Modification - $account = new Account($db); - $account->fetch($id); - $account->delete(); - - header("Location: ".DOL_URL_ROOT."/compta/bank/index.php"); - exit; -} - - -/* - * View - */ - -llxHeader(); - -$form = new Form($db); - -/* ************************************************************************** */ -/* */ -/* Affichage page en mode creation */ -/* */ -/* ************************************************************************** */ - -if (($_GET["id"] || $_GET["ref"]) && $action != 'edit') -{ - $account = new Account($db); - if ($_GET["id"]) - { - $result=$account->fetch($id); - } - if ($_GET["ref"]) - { - $result=$account->fetch(0,$_GET["ref"]); - $_GET["id"]=$account->id; - } - - // Onglets - $head=bank_prepare_head($account); - dol_fiche_head($head, 'bankid', $langs->trans("FinancialAccount"),0,'account'); - - // Confirmation de la suppression - if ($action == 'delete') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); - - } - - - print ''; - - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - print ''; - - // Label - print ''; - print ''; - - // Type - print ''; - print ''; - - // Currency - print ''; - print ''; - - // Status - print ''; - print ''; - - if ($account->type == 0 || $account->type == 1) - { - // Country - print '\n"; - - print ''; - print ''; - - // Show fields of bank account - $fieldlists='BankCode DeskCode AccountNumber BankAccountNumberKey'; - if (! empty($conf->global->BANK_SHOW_ORDER_OPTION)) - { - if (is_numeric($conf->global->BANK_SHOW_ORDER_OPTION)) - { - if ($conf->global->BANK_SHOW_ORDER_OPTION == '1') $fieldlists='BankCode DeskCode BankAccountNumberKey AccountNumber'; - } - else $fieldlists=$conf->global->BANK_SHOW_ORDER_OPTION; - } - $fieldlistsarray=explode(' ',$fieldlists); - - foreach($fieldlistsarray as $val) - { - if ($val == 'BankCode') - { - if ($account->useDetailedBBAN() == 1) - { - print ''; - print ''; - print ''; - } - } - if ($val == 'DeskCode') - { - if ($account->useDetailedBBAN() == 1) - { - print ''; - print ''; - print ''; - } - } - - if ($val == 'BankCode') - { - if ($account->useDetailedBBAN() == 2) - { - print ''; - print ''; - print ''; - } - } - - if ($val == 'AccountNumber') - { - print ''; - print ''; - print ''; - } - - if ($val == 'BankAccountNumberKey') - { - if ($account->useDetailedBBAN() == 1) - { - print ''; - print ''; - print ''; - } - } - } - - $ibankey="IBANNumber"; - $bickey="BICNumber"; - if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; - if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; - - print ''; - print ''; - - print ''; - print ''; - - print '\n"; - - print '\n"; - - print '\n"; - - } - - print '
'.$langs->trans("Ref").''; - print $form->showrefnav($account, 'ref', $linkback, 1, 'ref'); - print '
'.$langs->trans("Label").''.$account->label.'
'.$langs->trans("AccountType").''.$account->type_lib[$account->type].'
'.$langs->trans("Currency").''; - $selectedcode=$account->account_currency_code; - if (! $selectedcode) $selectedcode=$conf->currency; - print $langs->trans("Currency".$selectedcode); - print '
'.$langs->trans("Status").''.$account->getLibStatut(4).'
'.$langs->trans("BankAccountCountry").''; - $img=picto_from_langcode($account->country_code); - print $img?$img.' ':''; - print getCountry($account->getCountryCode(), 0, $db); - print "
'.$langs->trans("BankName").''.$account->bank.'
'.$langs->trans("BankCode").''.$account->code_banque.'
'.$langs->trans("DeskCode").''.$account->code_guichet.'
'.$langs->trans("BankCode").''.$account->code_banque.'
'.$langs->trans("BankAccountNumber").''.$account->number.'
'.$langs->trans("BankAccountNumberKey").''.$account->cle_rib.'
'.$langs->trans($ibankey).''.$account->iban.' '; - if (! empty($account->iban)) { - if (! checkIbanForAccount($account)) { - print img_picto($langs->trans("IbanNotValid"),'warning'); - } else { - print img_picto($langs->trans("IbanValid"),'info'); - } - } - print '
'.$langs->trans($bickey).''.$account->bic.' '; - if (! empty($account->bic)) { - if (! checkSwiftForAccount($account)) { - print img_picto($langs->trans("SwiftNotValid"),'warning'); - } else { - print img_picto($langs->trans("SwiftValid"),'info'); - } - } - print '
'.$langs->trans("BankAccountDomiciliation").''; - print nl2br($account->domiciliation); - print "
'.$langs->trans("BankAccountOwner").''; - print $account->proprio; - print "
'.$langs->trans("BankAccountOwnerAddress").''; - print nl2br($account->owner_address); - print "
'; - - - // Check BBAN - if (! checkBanForAccount($account)) - { - print '
'.$langs->trans("RIBControlError").'
'; - } - - print "\n\n"; - - - /* - * Barre d'actions - */ - - print '
'; - - if ($user->rights->banque->configurer) - { - print 'id.'">'.$langs->trans("Modify").''; - } - - print '
'; - -} - -/* ************************************************************************** */ -/* */ -/* Edition */ -/* */ -/* ************************************************************************** */ - -if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer) -{ - $account = new Account($db); - $account->fetch($id); - - print_fiche_titre($langs->trans("EditFinancialAccount")); - print "
"; - - print '
'; - print ''; - print ''; - print ''."\n\n"; - - print ''; - - // Ref - print ''; - print ''; - - // Label - print ''; - print ''; - - // Type - print ''; - print ''; - - // Currency - print ''; - print ''; - - // Status - print ''; - print ''; - - if ($account->type == 0 || $account->type == 1) - { - print '\n"; - - // If bank account - print ''; - print ''; - print ''; - - // Show fields of bank account - $fieldlists='BankCode DeskCode AccountNumber BankAccountNumberKey'; - if (! empty($conf->global->BANK_SHOW_ORDER_OPTION)) - { - if (is_numeric($conf->global->BANK_SHOW_ORDER_OPTION)) - { - if ($conf->global->BANK_SHOW_ORDER_OPTION == '1') $fieldlists='BankCode DeskCode BankAccountNumberKey AccountNumber'; - } - else $fieldlists=$conf->global->BANK_SHOW_ORDER_OPTION; - } - $fieldlistsarray=explode(' ',$fieldlists); - - foreach($fieldlistsarray as $val) - { - if ($val == 'BankCode') - { - if ($account->useDetailedBBAN() == 1) - { - print ''; - print ''; - print ''; - } - } - - if ($val == 'DeskCode') - { - if ($account->useDetailedBBAN() == 1) - { - print ''; - print ''; - print ''; - } - } - - if ($val == 'BankCode') - { - if ($account->useDetailedBBAN() == 2) - { - print ''; - print ''; - print ''; - } - } - - if ($val == 'AccountNumber') - { - print ''; - print ''; - print ''; - } - - if ($val == 'BankAccountNumberKey') - { - if ($account->useDetailedBBAN() == 1) - { - print ''; - print ''; - print ''; - } - } - } - - $ibankey="IBANNumber"; - $bickey="BICNumber"; - if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; - if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; - - // IBAN - print ''; - print ''; - - print ''; - print ''; - - print '"; - - print ''; - print ''; - - print '"; - - } - - print '
'.$langs->trans("Ref").''.$account->ref; - print '
'.$langs->trans("Label").''.$account->label; - print '
'.$langs->trans("AccountType").''.$account->type_lib[$account->type]; - print '
'.$langs->trans("Currency").''; - $selectedcode=$account->account_currency_code; - if (! $selectedcode) $selectedcode=$conf->currency; - print $langs->trans("Currency".$selectedcode); - print '
'.$langs->trans("Status").''.$account->getLibStatut(4); - print '
'.$langs->trans("BankAccountCountry").''; - $img=picto_from_langcode($account->country_code); - print $img?$img.' ':''; - print getCountry($account->getCountryCode(), 0, $db); - print "
'.$langs->trans("BankName").'
'.$langs->trans("BankCode").'
'.$langs->trans("DeskCode").'
'.$langs->trans("BankCode").'
'.$langs->trans("BankAccountNumber").'
'.$langs->trans("BankAccountNumberKey").'
'.$langs->trans($ibankey).'
'.$langs->trans($bickey).'
'.$langs->trans("BankAccountDomiciliation").''; - print "
'.$langs->trans("BankAccountOwner").''; - print '
'.$langs->trans("BankAccountOwnerAddress").''; - print "
'; - - print '
'; - - print '
'; - print ''; - print '   '; - print '
'; - - print '
'; -} - - -llxFooter(); - -$db->close(); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index c44dd2058b7..359090ea655 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -2,8 +2,8 @@ /* Copyright (C) 2002-2003 Rodolphe Quiedeville * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2012 Laurent Destailleur - * Copytight (C) 2005-2009 Regis Houssin - * Copytight (C) 2014 Alexandre Spangaro + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2014-2015 Alexandre Spangaro * * 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 @@ -21,16 +21,16 @@ /** * \file htdocs/compta/bank/card.php - * \ingroup banque + * \ingroup bank * \brief Page to create/view a bank account */ require('../../main.inc.php'); -require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formbank.class.php'; +require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; $langs->load("banks"); @@ -70,6 +70,18 @@ if ($_POST["action"] == 'add') $account->clos = $_POST["clos"]; $account->rappro = (isset($_POST["norappro"]) && $_POST["norappro"])?0:1; $account->url = $_POST["url"]; + + $account->bank = trim($_POST["bank"]); + $account->code_banque = trim($_POST["code_banque"]); + $account->code_guichet = trim($_POST["code_guichet"]); + $account->number = trim($_POST["number"]); + $account->cle_rib = trim($_POST["cle_rib"]); + $account->bic = trim($_POST["bic"]); + $account->iban = trim($_POST["iban"]); + $account->domiciliation = trim($_POST["domiciliation"]); + + $account->proprio = trim($_POST["proprio"]); + $account->owner_address = trim($_POST["owner_address"]); $account->account_number = trim($_POST["account_number"]); $account->accountancy_journal = trim($_POST["accountancy_journal"]); @@ -233,6 +245,15 @@ if ($action == 'create') if ($conf->use_javascript_ajax) { + print "\n".''."\n"; + print "\n".'