dolibarr  9.0.0
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.dolibarr@gmail.com>
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 <http://www.gnu.org/licenses/>.
18  */
19 
30 class FormBank
31 {
35  public $db;
36 
40  public $error='';
41 
42 
48  public function __construct($db)
49  {
50  $this->db = $db;
51  }
52 
60  public function selectTypeOfBankAccount($selected = Account::TYPE_CURRENT, $htmlname = 'type')
61  {
62  $account = new Account($this->db);
63 
64  print Form::selectarray($htmlname, $account->type_lib, $selected);
65  }
66 
73  public static function getIBANLabel(Account $account)
74  {
75  if ($account->getCountryCode() == 'IN') {
76  return 'IFSC';
77  }
78 
79  return 'IBANNumber';
80  }
81 }
82 
print
Draft customers invoices.
Definition: index.php:91
selectTypeOfBankAccount($selected=Account::TYPE_CURRENT, $htmlname='type')
Retourne la liste des types de comptes financiers.
const TYPE_CURRENT
Current account.
Class to manage bank accounts.
static getIBANLabel(Account $account)
Returns the name of the Iban label.
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=0, $moreparamonempty='', $disablebademail=0, $nohtmlescape=0)
Return a HTML select string, built from an array of key+value.
__construct($db)
Constructor.
getCountryCode()
Return account country code.
Class to manage generation of HTML components for bank module.