dolibarr  16.0.5
html.formbank.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
4  * Copyright (C) 2016 Marcos GarcĂ­a <marcosgdf@gmail.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
26 include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
27 
28 
32 class FormBank
33 {
37  public $db;
38 
42  public $error = '';
43 
44 
50  public function __construct($db)
51  {
52  $this->db = $db;
53  }
54 
62  public function selectTypeOfBankAccount($selected = Account::TYPE_CURRENT, $htmlname = 'type')
63  {
64  $account = new Account($this->db);
65 
66  print Form::selectarray($htmlname, $account->type_lib, $selected);
67  }
68 
75  public static function getIBANLabel(Account $account)
76  {
77  if ($account->getCountryCode() == 'IN') {
78  return 'IFSC';
79  }
80 
81  return 'IBANNumber';
82  }
83 }
Account\TYPE_CURRENT
const TYPE_CURRENT
Current account.
Definition: account.class.php:342
db
$conf db
API class for accounts.
Definition: inc.php:41
FormBank\selectTypeOfBankAccount
selectTypeOfBankAccount($selected=Account::TYPE_CURRENT, $htmlname='type')
Retourne la liste des types de comptes financiers.
Definition: html.formbank.class.php:62
FormBank
Class to manage generation of HTML components for bank module.
Definition: html.formbank.class.php:32
Form\selectarray
static selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=1, $moreparamonempty='', $disablebademail=0, $nohtmlescape=0)
Return a HTML select string, built from an array of key+value.
Definition: html.form.class.php:7879
FormBank\getIBANLabel
static getIBANLabel(Account $account)
Returns the name of the Iban label.
Definition: html.formbank.class.php:75
FormBank\__construct
__construct($db)
Constructor.
Definition: html.formbank.class.php:50
Account
Class to manage bank accounts.
Definition: account.class.php:38