1-- ============================================================================ 2-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3-- Copyright (C) 2009-2011 Laurent Destailleur <eldy@users.sourceforge.net> 4-- Copyright (C) 2009-2013 Regis Houssin <regis.houssin@inodbox.com> 5-- Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> 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 22create table llx_product_fournisseur_price 23( 24 rowid integer AUTO_INCREMENT PRIMARY KEY, 25 entity integer DEFAULT 1 NOT NULL, -- multi company id 26 datec datetime, 27 tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 28 fk_product integer, 29 fk_soc integer, 30 ref_fourn varchar(30), 31 desc_fourn text, 32 fk_availability integer, 33 price double(24,8) DEFAULT 0, -- price without tax for quantity 34 quantity double, 35 remise_percent double NOT NULL DEFAULT 0, 36 remise double NOT NULL DEFAULT 0, 37 unitprice double(24,8) DEFAULT 0, -- unit price without tax 38 charges double(24,8) DEFAULT 0, -- to store transport cost. Constant PRODUCT_CHARGES must be set to see it. 39 default_vat_code varchar(10), 40 barcode varchar(180) DEFAULT NULL, -- barcode 41 fk_barcode_type integer DEFAULT NULL, -- barcode type 42 tva_tx double(6,3) NOT NULL, 43 localtax1_tx double(6,3) DEFAULT 0, 44 localtax1_type varchar(10) NOT NULL DEFAULT '0', 45 localtax2_tx double(6,3) DEFAULT 0, 46 localtax2_type varchar(10) NOT NULL DEFAULT '0', 47 info_bits integer NOT NULL DEFAULT 0, 48 fk_user integer, 49 fk_supplier_price_expression integer, -- Link to the rule for dynamic price calculation 50 import_key varchar(14), -- Import key 51 delivery_time_days integer, 52 supplier_reputation varchar(10), 53 packaging varchar(64), 54 55 fk_multicurrency integer, 56 multicurrency_code varchar(255), 57 multicurrency_tx double(24,8) DEFAULT 1, 58 multicurrency_unitprice double(24,8) DEFAULT NULL, -- unit price without tax 59 multicurrency_price double(24,8) DEFAULT NULL 60)ENGINE=innodb; 61