From a37707f96f76110ed7b8be799fe0c62dc69a4f4d Mon Sep 17 00:00:00 2001 From: Christophe Battarel <christophe.battarel@altairis.fr> Date: Wed, 18 Jul 2012 11:39:41 +0200 Subject: [PATCH] updata database for margin module --- htdocs/install/mysql/migration/3.2.0-3.3.0.sql | 17 +++++++++++++++++ htdocs/install/mysql/tables/llx_commandedet.sql | 4 ++-- htdocs/install/mysql/tables/llx_facturedet.sql | 2 ++ .../tables/llx_product_fournisseur_price.sql | 14 ++++++++------ htdocs/install/mysql/tables/llx_propaldet.sql | 7 +++---- 5 files changed, 32 insertions(+), 12 deletions(-) diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index 24a92e8854e..0340d70d64c 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -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_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; + diff --git a/htdocs/install/mysql/tables/llx_commandedet.sql b/htdocs/install/mysql/tables/llx_commandedet.sql index 6c629b38c61..36318a566e7 100644 --- a/htdocs/install/mysql/tables/llx_commandedet.sql +++ b/htdocs/install/mysql/tables/llx_commandedet.sql @@ -43,8 +43,8 @@ create table llx_commandedet 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 - marge_tx double(6,3) DEFAULT 0, -- taux de marge (marge sur prix d'achat) - marque_tx double(6,3) DEFAULT 0, -- taux de marque (marge sur prix de vente) + 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 special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales rang integer DEFAULT 0, import_key varchar(14) diff --git a/htdocs/install/mysql/tables/llx_facturedet.sql b/htdocs/install/mysql/tables/llx_facturedet.sql index fd5ee387d93..f2dba3e600e 100644 --- a/htdocs/install/mysql/tables/llx_facturedet.sql +++ b/htdocs/install/mysql/tables/llx_facturedet.sql @@ -45,6 +45,8 @@ create table llx_facturedet 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 + 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_export_compta integer DEFAULT 0 NOT NULL, special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales diff --git a/htdocs/install/mysql/tables/llx_product_fournisseur_price.sql b/htdocs/install/mysql/tables/llx_product_fournisseur_price.sql index 9d6c25fe1e8..5f497232312 100644 --- a/htdocs/install/mysql/tables/llx_product_fournisseur_price.sql +++ b/htdocs/install/mysql/tables/llx_product_fournisseur_price.sql @@ -23,14 +23,16 @@ create table llx_product_fournisseur_price rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, -- multi company id datec datetime, - tms timestamp, - fk_product integer, + tms timestamp, + fk_product integer, fk_soc integer, - ref_fourn varchar(30), - fk_availability integer, + ref_fourn varchar(30), + fk_availability integer, price double(24,8) DEFAULT 0, - quantity double, - unitprice double(24,8) DEFAULT 0, + quantity double, + 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, fk_user integer )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_propaldet.sql b/htdocs/install/mysql/tables/llx_propaldet.sql index 597dcc2a9bc..2986432046f 100644 --- a/htdocs/install/mysql/tables/llx_propaldet.sql +++ b/htdocs/install/mysql/tables/llx_propaldet.sql @@ -44,10 +44,9 @@ create table llx_propaldet date_end datetime DEFAULT NULL, -- date fin si service info_bits integer DEFAULT 0, -- TVA NPR ou non - pa_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) - marque_tx double(6,3) DEFAULT 0, -- taux de marque (marge sur prix de vente) - + 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 + special_code integer DEFAULT 0, -- code pour les lignes speciales rang integer DEFAULT 0 -- ordre affichage sur la propal )ENGINE=innodb; -- GitLab