1-- ============================================================================
2-- Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3-- Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
4-- Copyright (C) 2013		Florian Henry			<florian.henry@open-concept.pro>
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-- ============================================================================
20
21-- To log changes of prices per customer (llx_product_customer_price)
22
23create table llx_product_customer_price_log
24(
25  rowid                       integer AUTO_INCREMENT PRIMARY KEY,
26  entity				integer DEFAULT 1 NOT NULL,	   -- multi company id
27  datec                       datetime,
28  fk_product			integer NOT NULL,
29  fk_soc				integer DEFAULT 0 NOT NULL,
30  ref_customer			varchar(30),
31  price						double(24,8) DEFAULT 0,
32  price_ttc					double(24,8) DEFAULT 0,
33  price_min					double(24,8) DEFAULT 0,
34  price_min_ttc				double(24,8) DEFAULT 0,
35  price_base_type			varchar(3)   DEFAULT 'HT',
36  default_vat_code			varchar(10),	         		-- Same code than into table llx_c_tva (but no constraints). Should be used in priority to find default vat, npr, localtaxes for product.
37  tva_tx					double(6,3),
38  recuperableonly           integer NOT NULL DEFAULT '0',   -- Other NPR VAT
39  localtax1_tx				double(6,3)  DEFAULT 0,         -- Other local VAT 1
40  localtax1_type            varchar(10)  NOT NULL DEFAULT '0',
41  localtax2_tx				double(6,3)  DEFAULT 0,         -- Other local VAT 2
42  localtax2_type            varchar(10)  NOT NULL DEFAULT '0',
43  fk_user				integer,
44 import_key			varchar(14)                  -- Import key
45)ENGINE=innodb;
46