2003-11-03 11:16:57 +01:00
-- ===================================================================
2012-08-23 07:50:20 +02:00
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
2012-12-30 15:13:49 +01:00
-- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
2012-08-23 07:50:20 +02:00
-- Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
2003-11-03 11:16:57 +01:00
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
2013-01-16 15:36:08 +01:00
-- the Free Software Foundation; either version 3 of the License, or
2003-11-03 11:16:57 +01:00
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
2011-08-03 03:13:30 +02:00
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
2003-11-03 11:16:57 +01:00
--
-- ===================================================================
create table llx_commandedet
(
2012-08-23 07:50:20 +02:00
rowid integer AUTO_INCREMENT PRIMARY KEY ,
fk_commande integer NOT NULL ,
fk_parent_line integer NULL ,
fk_product integer NULL ,
label varchar ( 255 ) DEFAULT NULL ,
description text ,
tva_tx double ( 6 , 3 ) , -- vat rate
2012-09-10 11:00:35 +02:00
localtax1_tx double ( 6 , 3 ) DEFAULT 0 , -- localtax1 rate
2013-03-09 13:12:20 +01:00
localtax1_type varchar ( 10 ) NULL , -- localtax1 type
2012-09-10 11:00:35 +02:00
localtax2_tx double ( 6 , 3 ) DEFAULT 0 , -- localtax2 rate
2013-03-09 13:12:20 +01:00
localtax2_type varchar ( 10 ) NULL , -- localtax2 type
2012-08-23 07:50:20 +02:00
qty real , -- quantity
remise_percent real DEFAULT 0 , -- pourcentage de remise
remise real DEFAULT 0 , -- montant de la remise
fk_remise_except integer NULL , -- Lien vers table des remises fixes
price real , -- prix final
subprice double ( 24 , 8 ) DEFAULT 0 , -- prix unitaire
total_ht double ( 24 , 8 ) DEFAULT 0 , -- Total HT de la ligne toute quantite et incluant remise ligne et globale
total_tva double ( 24 , 8 ) DEFAULT 0 , -- Total TVA de la ligne toute quantite et incluant remise ligne et globale
total_localtax1 double ( 24 , 8 ) DEFAULT 0 , -- Total LocalTax1
total_localtax2 double ( 24 , 8 ) DEFAULT 0 , -- Total LocalTax2
total_ttc double ( 24 , 8 ) DEFAULT 0 , -- Total TTC de la ligne toute quantite et incluant remise ligne et globale
product_type integer DEFAULT 0 ,
date_start datetime DEFAULT NULL , -- date debut si service
date_end datetime DEFAULT NULL , -- date fin si service
info_bits integer DEFAULT 0 , -- TVA NPR ou non
2013-06-06 18:54:17 +02:00
buy_price_ht double ( 24 , 8 ) DEFAULT 0 , -- buying price
fk_product_fournisseur_price integer DEFAULT NULL , -- reference of supplier price when line was added (may be used to update buy_price_ht current price when future invoice will be created)
2012-08-23 07:50:20 +02:00
special_code integer UNSIGNED DEFAULT 0 , -- code pour les lignes speciales
rang integer DEFAULT 0 ,
import_key varchar ( 14 )
2011-02-24 10:57:02 +01:00
) ENGINE = innodb ;
2006-12-12 17:02:41 +01:00
--
2008-10-07 22:46:33 +02:00
-- List of codes for special_code
2006-12-12 17:02:41 +01:00
--
-- 1 : frais de port
2007-09-03 17:18:06 +02:00
-- 2 : ecotaxe
2008-01-09 10:48:23 +01:00
-- 3 : produit/service propose en option
2008-10-07 22:46:33 +02:00
--