updata database for margin module

This commit is contained in:
Christophe Battarel 2012-07-18 11:39:41 +02:00
parent 9116db986f
commit a37707f96f
5 changed files with 32 additions and 12 deletions

View File

@ -41,3 +41,20 @@ ALTER TABLE llx_mailing ADD COLUMN extraparams varchar(255);
ALTER TABLE llx_product MODIFY ref varchar(128) NOT NULL; ALTER TABLE llx_product MODIFY ref varchar(128) NOT NULL;
ALTER TABLE llx_product MODIFY ref_ext varchar(128); ALTER TABLE llx_product MODIFY ref_ext varchar(128);
ALTER TABLE llx_product_fournisseur_price ADD charges DOUBLE( 24, 8 ) DEFAULT 0 AFTER unitprice;
ALTER TABLE llx_product_fournisseur_price ADD unitcharges DOUBLE( 24, 8 ) DEFAULT 0 AFTER charges;
alter table llx_commandedet add column fk_product_fournisseur_price int(11) after info_bits;
alter table llx_commandedet add column buy_price_ht double(24,8) after fk_product_fournisseur_price;
alter table llx_commandedet drop column marge_tx;
alter table llx_commandedet drop column marque_tx;
alter table llx_facturedet add column fk_product_fournisseur_price int(11) after info_bits;
alter table llx_facturedet add column buy_price_ht double(24,8) after fk_product_fournisseur_price;
alter table llx_propaldet add column fk_product_fournisseur_price int(11) after info_bits;
alter table llx_propaldet add column buy_price_ht double(24,8) after fk_product_fournisseur_price;
alter table llx_propaldet drop column pa_ht;
alter table llx_propaldet drop column marge_tx;
alter table llx_propaldet drop column marque_tx;

View File

@ -43,8 +43,8 @@ create table llx_commandedet
date_start datetime DEFAULT NULL, -- date debut si service date_start datetime DEFAULT NULL, -- date debut si service
date_end datetime DEFAULT NULL, -- date fin si service date_end datetime DEFAULT NULL, -- date fin si service
info_bits integer DEFAULT 0, -- TVA NPR ou non info_bits integer DEFAULT 0, -- TVA NPR ou non
marge_tx double(6,3) DEFAULT 0, -- taux de marge (marge sur prix d'achat) buy_price_ht double(24,8) DEFAULT 0, -- prix d'achat HT
marque_tx double(6,3) DEFAULT 0, -- taux de marque (marge sur prix de vente) fk_product_fournisseur_price int(11) DEFAULT NULL, -- référence prix fournisseur
special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales
rang integer DEFAULT 0, rang integer DEFAULT 0,
import_key varchar(14) import_key varchar(14)

View File

@ -45,6 +45,8 @@ create table llx_facturedet
date_start datetime DEFAULT NULL, -- date debut si service date_start datetime DEFAULT NULL, -- date debut si service
date_end datetime DEFAULT NULL, -- date fin si service date_end datetime DEFAULT NULL, -- date fin si service
info_bits integer DEFAULT 0, -- TVA NPR ou non info_bits integer DEFAULT 0, -- TVA NPR ou non
buy_price_ht double(24,8) DEFAULT 0, -- prix d'achat HT
fk_product_fournisseur_price int(11) DEFAULT NULL, -- référence prix fournisseur
fk_code_ventilation integer DEFAULT 0 NOT NULL, fk_code_ventilation integer DEFAULT 0 NOT NULL,
fk_export_compta integer DEFAULT 0 NOT NULL, fk_export_compta integer DEFAULT 0 NOT NULL,
special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales

View File

@ -31,6 +31,8 @@ create table llx_product_fournisseur_price
price double(24,8) DEFAULT 0, price double(24,8) DEFAULT 0,
quantity double, quantity double,
unitprice double(24,8) DEFAULT 0, unitprice double(24,8) DEFAULT 0,
charges double(24,8) DEFAULT 0,
unitcharges double(24,8) DEFAULT 0,
tva_tx double(6,3) NOT NULL, tva_tx double(6,3) NOT NULL,
fk_user integer fk_user integer
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -44,9 +44,8 @@ create table llx_propaldet
date_end datetime DEFAULT NULL, -- date fin si service date_end datetime DEFAULT NULL, -- date fin si service
info_bits integer DEFAULT 0, -- TVA NPR ou non info_bits integer DEFAULT 0, -- TVA NPR ou non
pa_ht double(24,8) DEFAULT 0, -- prix d'achat HT buy_price_ht double(24,8) DEFAULT 0, -- prix d'achat HT
marge_tx double(6,3) DEFAULT 0, -- taux de marge (marge sur prix d'achat) fk_product_fournisseur_price int(11) DEFAULT NULL, -- référence prix fournisseur
marque_tx double(6,3) DEFAULT 0, -- taux de marque (marge sur prix de vente)
special_code integer DEFAULT 0, -- code pour les lignes speciales special_code integer DEFAULT 0, -- code pour les lignes speciales
rang integer DEFAULT 0 -- ordre affichage sur la propal rang integer DEFAULT 0 -- ordre affichage sur la propal