1-- =============================================================================
2-- Copyright (C) 2000-2004	Rodolphe Quiedeville	<rodolphe@quiedeville.org>
3-- Copyright (C) 2004-2014	Laurent Destailleur 	<eldy@users.sourceforge.net>
4-- Copyright (C) 2005-2012	Regis Houssin       	<regis.houssin@inodbox.com>
5-- Copyright (C) 2014		Alexandre Spangaro		<aspangaro@open-dsi.fr>
6--
7-- This program is free software; you can redistribute it and/or modify
8-- it under the terms of the GNU General Public License as published by
9-- the Free Software Foundation; either version 3 of the License, or
10-- (at your option) any later version.
11--
12-- This program is distributed in the hope that it will be useful,
13-- but WITHOUT ANY WARRANTY; without even the implied warranty of
14-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15-- GNU General Public License for more details.
16--
17-- You should have received a copy of the GNU General Public License
18-- along with this program. If not, see <https://www.gnu.org/licenses/>.
19--
20-- =============================================================================
21
22-- courant : type of account: 0 epargne, 1 curent/card/cheque, 2 cash
23-- clos : is account opened or closed
24
25create table llx_bank_account
26(
27  rowid						integer AUTO_INCREMENT PRIMARY KEY,
28  datec						datetime,
29  tms						timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
30  ref						varchar(12) NOT NULL,
31  label						varchar(30) NOT NULL,
32  entity					integer DEFAULT 1 NOT NULL,	-- multi company id
33  fk_user_author			integer,
34  fk_user_modif				integer,
35  bank						varchar(60),
36  code_banque				varchar(128),
37  code_guichet				varchar(6),
38  number					varchar(255),
39  cle_rib					varchar(5),
40  bic						varchar(11),
41  iban_prefix				varchar(34),				-- full iban. 34 according to ISO 13616
42  country_iban				varchar(2),					-- deprecated
43  cle_iban					varchar(2),
44  domiciliation				varchar(255),
45  state_id					integer        DEFAULT NULL,
46  fk_pays					integer        NOT NULL,
47  proprio					varchar(60),
48  owner_address				varchar(255),
49  courant					smallint DEFAULT 0 NOT NULL,
50  clos						smallint DEFAULT 0 NOT NULL,
51  rappro					smallint DEFAULT 1,
52  url						varchar(128),
53  account_number			varchar(32),				-- bank accountancy number
54  fk_accountancy_journal	integer,					-- bank accountancy journal
55  currency_code				varchar(3) NOT NULL,
56  min_allowed				integer DEFAULT 0,
57  min_desired				integer DEFAULT 0,
58  comment					text,						-- TODO rename in note_private
59  note_public				text,
60  model_pdf					varchar(255),
61  import_key				varchar(14),
62  extraparams			    varchar(255),				-- for other parameters with json format
63  ics						varchar(32),			-- Creditor Identifier CI
64  ics_transfer			varchar(32)				-- Creditor Identifier CI for transfer
65)ENGINE=innodb;
66