* Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2014-2015 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry * * 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/card.php * \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/class/extrafields.class.php'; $langs->load("banks"); $langs->load("bills"); $langs->load("categories"); $langs->load("companies"); $langs->load("compta"); $action=GETPOST("action"); // 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); $account = new Account($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($account->table_element); /* * Actions */ if ($_POST["action"] == 'add') { $error=0; // Create account $account = new Account($db); $account->ref = dol_sanitizeFileName(trim($_POST["ref"])); $account->label = trim($_POST["label"]); $account->courant = $_POST["type"]; $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"]); $account->solde = $_POST["solde"]; $account->date_solde = dol_mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); $account->currency_code = trim($_POST["account_currency_code"]); $account->state_id = $_POST["account_state_id"]; $account->country_id = $_POST["account_country_id"]; $account->min_allowed = GETPOST("account_min_allowed",'int'); $account->min_desired = GETPOST("account_min_desired",'int'); $account->comment = trim($_POST["account_comment"]); if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number)) { setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), 'error'); $action='create'; // Force chargement page en mode creation $error++; } if (empty($account->ref)) { 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++; } // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$account); if (! $error) { $id = $account->create($user); if ($id > 0) { $_GET["id"]=$id; // Force chargement page en mode visu } else { setEventMessage($account->error,'errors'); $action='create'; // Force chargement page en mode creation } } } if ($_POST["action"] == 'update' && ! $_POST["cancel"]) { $error=0; // Update account $account = new Account($db); $account->fetch($_POST["id"]); $account->ref = dol_string_nospecial(trim($_POST["ref"])); $account->label = trim($_POST["label"]); $account->courant = $_POST["type"]; $account->clos = $_POST["clos"]; $account->rappro = (isset($_POST["norappro"]) && $_POST["norappro"])?0:1; $account->url = trim($_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"]); $account->currency_code = trim($_POST["account_currency_code"]); $account->state_id = $_POST["account_state_id"]; $account->country_id = $_POST["account_country_id"]; $account->min_allowed = GETPOST("account_min_allowed",'int'); $account->min_desired = GETPOST("account_min_desired",'int'); $account->comment = trim($_POST["account_comment"]); if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number)) { setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), 'error'); $action='edit'; // Force chargement page en mode creation $error++; } if (empty($account->ref)) { 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++; } // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$account); if (! $error) { $result = $account->update($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 ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer) { // Delete $account = new Account($db); $account->fetch($_GET["id"]); $account->delete(); header("Location: ".DOL_URL_ROOT."/compta/bank/index.php"); exit; } /* * View */ $form = new Form($db); $formbank = new FormBank($db); $formcompany = new FormCompany($db); $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; llxHeader(); // Creation if ($action == 'create') { $account=new Account($db); print_fiche_titre($langs->trans("NewFinancialAccount"), '', 'title_bank.png'); if ($conf->use_javascript_ajax) { print "\n".''."\n"; } print '
'; print ''; print ''; print ''; dol_fiche_head(''); print ''; // Ref print ''; print ''; // Label print ''; print ''; // Type print ''; print ''; // Currency print ''; print ''; // Status print ''; print ''; // Country $selectedcode=''; if (isset($_POST["account_country_id"])) { $selectedcode=$_POST["account_country_id"]?$_POST["account_country_id"]:$account->country_code; } else if (empty($selectedcode)) $selectedcode=$mysoc->country_code; $account->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules print ''; print ''; // State print ''; // Web print ''; print ''; // Comment print ''; print ''; // Other attributes $parameters=array('colspan' => 3); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$account,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $account->showOptionals($extrafields,'edit',$parameters); } print '
'.$langs->trans("Ref").'ref).'" maxlength="12">
'.$langs->trans("LabelBankCashAccount").'
'.$langs->trans("AccountType").''; $formbank->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type"); print '
'.$langs->trans("Currency").''; $selectedcode=$account->account_currency_code; if (! $selectedcode) $selectedcode=$conf->currency; print $form->selectCurrency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code'); //print $langs->trans("Currency".$conf->currency); //print ''; print '
'.$langs->trans("Status").''; print $form->selectarray("clos",array(0=>$account->status[0],1=>$account->status[1]),(isset($_POST["clos"])?$_POST["clos"]:$account->clos)); print '
'.$langs->trans("BankAccountCountry").''; print $form->select_country($selectedcode,'account_country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans('State').''; if ($selectedcode) { $formcompany->select_departement(isset($_POST["account_state_id"])?$_POST["account_state_id"]:'',$selectedcode,'account_state_id'); } else { print $countrynotdefined; } print '
'.$langs->trans("Web").'
'.$langs->trans("Comment").''; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('account_comment',(GETPOST("account_comment")?GETPOST("account_comment"):$account->comment),'',90,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,4,70); $doleditor->Create(); print '
'; print '
'; print ''; // Sold print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
'.$langs->trans("InitialBankBalance").'solde)).'">
'.$langs->trans("Date").''; $form->select_date('', 're', 0, 0, 0, 'formsoc'); print '
'.$langs->trans("BalanceMinimalAllowed").'account_min_allowed).'">
'.$langs->trans("BalanceMinimalDesired").'account_min_desired).'">
'; print '
'; if ($_POST["type"] == 0 || $_POST["type"] == 1) { print ''; // 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("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 ''; // Accountancy code if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { print ''; print ''; } else { print ''; print ''; } // Accountancy journal if (! empty($conf->accounting->enabled)) { print ''; print ''; } print '
'.$langs->trans("AccountancyCode").'account_number).'">
'.$langs->trans("AccountancyCode").'account_number).'">
'.$langs->trans("AccountancyJournal").'accountancy_journal).'">
'; dol_fiche_end(); print '
'; print '
'; } /* ************************************************************************** */ /* */ /* Visu et edition */ /* */ /* ************************************************************************** */ else { if (($_GET["id"] || $_GET["ref"]) && $action != 'edit') { $account = new Account($db); if ($_GET["id"]) { $account->fetch($_GET["id"]); } if ($_GET["ref"]) { $account->fetch(0,$_GET["ref"]); $_GET["id"]=$account->id; } /* * Affichage onglets */ // Onglets $head=bank_prepare_head($account); dol_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"),0,'account'); /* * Confirmation to delete */ 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 ''; // Country print ''; // State print ''; // Conciliate print ''; print ''; print ''; print ''; print ''; print ''; print '\n"; print ''; print ''; // Other attributes $parameters=array('colspan' => 3); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$account,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $account->showOptionals($extrafields); } 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").''; if ($account->country_id > 0) { $img=picto_from_langcode($account->country_code); print $img?$img.' ':''; print getCountry($account->getCountryCode(),0,$db); } print '
'.$langs->trans('State').''; if ($account->state_id > 0) print getState($account->state_id); print '
'.$langs->trans("Conciliable").''; $conciliate=$account->canBeConciliated(); if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')'; else if ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')'; else print ($account->rappro==1 ? $langs->trans("Yes") : ($langs->trans("No").' ('.$langs->trans("ConciliationDisabled").')')); print '
'.$langs->trans("BalanceMinimalAllowed").''.$account->min_allowed.'
'.$langs->trans("BalanceMinimalDesired").''.$account->min_desired.'
'.$langs->trans("Web").''; if ($account->url) print ''; print $account->url; if ($account->url) print ''; print "
'.$langs->trans("Comment").''.dol_htmlentitiesbr($account->comment).'
'; print '
'; if ($account->type == 0 || $account->type == 1) { 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"; print ''; print ''; print ''; print ''; print '\n"; print '\n"; print '\n"; 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 "
'; print '
'; } print ''; // Accountancy code print ''; print ''; // Accountancy journal if (! empty($conf->accounting->enabled)) { print ''; print ''; } print '
'.$langs->trans("AccountancyCode").''.$account->account_number.'
'.$langs->trans("AccountancyJournal").''.$account->accountancy_journal.'
'; print ''; /* * Barre d'actions */ print '
'; if ($user->rights->banque->configurer) { print 'id.'">'.$langs->trans("Modify").''; } $canbedeleted=$account->can_be_deleted(); // Renvoi vrai si compte sans mouvements if ($user->rights->banque->configurer && $canbedeleted) { print 'id.'">'.$langs->trans("Delete").''; } print '
'; } /* ************************************************************************** */ /* */ /* Edition */ /* */ /* ************************************************************************** */ if (GETPOST('id','int') && $action == 'edit' && $user->rights->banque->configurer) { $account = new Account($db); $account->fetch(GETPOST('id','int')); print_fiche_titre($langs->trans("EditFinancialAccount"), '', 'title_bank.png'); if ($conf->use_javascript_ajax) { print "\n".''."\n"; } print '
'; print ''; print ''; print ''."\n\n"; dol_fiche_head(''); print ''; // Ref print ''; print ''; // Label print ''; print ''; // Type print ''; print ''; // Currency print ''; print ''; // Status print ''; print ''; // Country $account->country_id=$account->country_id?$account->country_id:$mysoc->country_id; $selectedcode=$account->country_code; if (isset($_POST["account_country_id"])) $selectedcode=$_POST["account_country_id"]; else if (empty($selectedcode)) $selectedcode=$mysoc->country_code; $account->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules print ''; print ''; // State print ''; // Conciliable print ''; print ''; // Balance print ''; print ''; print ''; print ''; // Web print ''; print ''; // Comment print ''; print ''; // Other attributes $parameters=array('colspan' => 3); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$account,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $account->showOptionals($extrafields,'edit'); } print '
'.$langs->trans("Ref").'ref).'">
'.$langs->trans("Label").'label).'">
'.$langs->trans("AccountType").''; $formbank->select_type_comptes_financiers((isset($_POST["type"])?$_POST["type"]:$account->type),"type"); print '
'.$langs->trans("Currency"); print ''; print ''; $selectedcode=$account->account_currency_code; if (! $selectedcode) $selectedcode=$conf->currency; print $form->selectCurrency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code'); //print $langs->trans("Currency".$conf->currency); //print ''; print '
'.$langs->trans("Status").''; print $form->selectarray("clos",array(0=>$account->status[0],1=>$account->status[1]),(isset($_POST["clos"])?$_POST["clos"]:$account->clos)); print '
'.$langs->trans("Country").''; print $form->select_country($selectedcode,'account_country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans('State').''; if ($selectedcode) { print $formcompany->select_state(isset($_POST["account_state_id"])?$_POST["account_state_id"]:$account->state_id,$selectedcode,'account_state_id'); } else { print $countrynotdefined; } print '
'.$langs->trans("Conciliable").''; $conciliate=$account->canBeConciliated(); if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')'; else if ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')'; else print 'rappro?'':' checked').'"> '.$langs->trans("DisableConciliation"); print '
'.$langs->trans("BalanceMinimalAllowed").'min_allowed).'">
'.$langs->trans("BalanceMinimalDesired").'min_desired).'">
'.$langs->trans("Web").'url).'">'; print '
'.$langs->trans("Comment").''; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('account_comment',(GETPOST("account_comment")?GETPOST("account_comment"):$account->comment),'',90,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,4,70); $doleditor->Create(); print '
'; print '
'; if ($_POST["type"] == 0 || $_POST["type"] == 1) { print ''; // 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("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 ''; // Accountancy code if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { print ''; print ''; } else { print ''; print ''; } // Accountancy journal if (! empty($conf->accounting->enabled)) { print ''; print ''; } print '
'.$langs->trans("AccountancyCode").'account_number).'">
'.$langs->trans("AccountancyCode").'account_number).'">
'.$langs->trans("AccountancyJournal").'accountancy_journal).'">
'; dol_fiche_end(); print '
'; print ''; print '     '; print ''; print '
'; print '
'; } } $db->close(); llxFooter();