1-- ========================================================================
2-- Copyright (C) 2015 Laurent Destailleur  <eldy@users.sourceforge.net>
3--
4-- This program is free software; you can redistribute it and/or modify
5-- it under the terms of the GNU General Public License as published by
6-- the Free Software Foundation; either version 3 of the License, or
7-- (at your option) any later version.
8--
9-- This program is distributed in the hope that it will be useful,
10-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12-- GNU General Public License for more details.
13--
14-- You should have received a copy of the GNU General Public License
15-- along with this program. If not, see <https://www.gnu.org/licenses/>.
16-- ========================================================================
17
18CREATE TABLE llx_supplier_proposal (
19  rowid integer AUTO_INCREMENT PRIMARY KEY,
20  ref varchar(30) NOT NULL,
21  entity integer NOT NULL DEFAULT 1,
22  ref_ext varchar(255) DEFAULT NULL,
23  ref_int varchar(255) DEFAULT NULL,
24  fk_soc integer DEFAULT NULL,
25  fk_projet integer DEFAULT NULL,
26  tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
27  datec datetime DEFAULT NULL,
28  date_valid datetime DEFAULT NULL,
29  date_cloture datetime DEFAULT NULL,
30  fk_user_author integer DEFAULT NULL,
31  fk_user_modif integer DEFAULT NULL,
32  fk_user_valid integer DEFAULT NULL,
33  fk_user_cloture integer DEFAULT NULL,
34  fk_statut	smallint DEFAULT 0 NOT NULL,	-- 0=draft, 1=validated, 2=accepted, 3=refused, 4=billed/closed
35  price double DEFAULT 0,
36  remise_percent double DEFAULT 0,
37  remise_absolue double DEFAULT 0,
38  remise double DEFAULT 0,
39  total_ht double(24,8) DEFAULT 0,
40  total_tva double(24,8) DEFAULT 0,
41  localtax1 double(24,8) DEFAULT 0,
42  localtax2 double(24,8) DEFAULT 0,
43  total_ttc double(24,8) DEFAULT 0,
44  fk_account integer DEFAULT NULL,
45  fk_currency varchar(3) DEFAULT NULL,
46  fk_cond_reglement integer DEFAULT NULL,
47  fk_mode_reglement integer DEFAULT NULL,
48  note_private text,
49  note_public text,
50  model_pdf 			varchar(255) DEFAULT NULL,
51  last_main_doc			varchar(255),					-- relative filepath+filename of last main generated document
52
53  date_livraison date DEFAULT NULL,
54  fk_shipping_method integer DEFAULT NULL,
55  import_key varchar(14) DEFAULT NULL,
56  extraparams varchar(255) DEFAULT NULL,
57
58  fk_multicurrency        integer,
59  multicurrency_code      varchar(255),
60  multicurrency_tx        double(24,8) DEFAULT 1,
61  multicurrency_total_ht  double(24,8) DEFAULT 0,
62  multicurrency_total_tva double(24,8) DEFAULT 0,
63  multicurrency_total_ttc double(24,8) DEFAULT 0
64) ENGINE=innodb;
65