From 7648e6a7236314a1127610967b78365d0d32d924 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 24 Sep 2010 14:39:03 +0000 Subject: [PATCH] Works on hook module --- htdocs/install/mysql/migration/2.9.0-3.0.0.sql | 5 +++++ .../install/mysql/tables/llx_commandedet.sql | 5 +++-- htdocs/install/mysql/tables/llx_facturedet.sql | 1 + .../mysql/tables/llx_facturedet_rec.sql | 3 ++- htdocs/install/mysql/tables/llx_propaldet.sql | 18 ++++++++++-------- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql index 645d788ba06..8902d582022 100644 --- a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql +++ b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql @@ -54,3 +54,8 @@ ALTER TABLE llx_actioncomm ADD COLUMN fk_supplier_invoice integer; ALTER TABLE llx_tmp_caisse MODIFY fk_article integer NOT NULL; + +ALTER TABLE llx_propaldet ADD COLUMN fk_parent_line integer NULL AFTER fk_propal; +ALTER TABLE llx_commandedet ADD COLUMN fk_parent_line integer NULL AFTER fk_commande; +ALTER TABLE llx_facturedet ADD COLUMN fk_parent_line integer NULL AFTER fk_facture; +ALTER TABLE llx_facturedet_rec ADD COLUMN fk_parent_line integer NULL AFTER fk_facture; diff --git a/htdocs/install/mysql/tables/llx_commandedet.sql b/htdocs/install/mysql/tables/llx_commandedet.sql index 9b177a7f9a3..e189b942c03 100644 --- a/htdocs/install/mysql/tables/llx_commandedet.sql +++ b/htdocs/install/mysql/tables/llx_commandedet.sql @@ -23,8 +23,9 @@ create table llx_commandedet ( rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_commande integer, - fk_product integer, + fk_commande integer NOT NULL, + fk_parent_line integer NULL, + fk_product integer NULL, description text, tva_tx double(6,3), -- vat rate localtax1_tx double(6,3), -- localtax1 rate diff --git a/htdocs/install/mysql/tables/llx_facturedet.sql b/htdocs/install/mysql/tables/llx_facturedet.sql index 6439272397f..6d57b0ebeef 100644 --- a/htdocs/install/mysql/tables/llx_facturedet.sql +++ b/htdocs/install/mysql/tables/llx_facturedet.sql @@ -26,6 +26,7 @@ create table llx_facturedet ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_facture integer NOT NULL, + fk_parent_line integer NULL, fk_product integer NULL, -- Doit pouvoir etre nul pour ligne detail sans produits description text, tva_tx double(6,3), -- Taux tva produit/service (exemple 19.6) diff --git a/htdocs/install/mysql/tables/llx_facturedet_rec.sql b/htdocs/install/mysql/tables/llx_facturedet_rec.sql index 30320d06b64..a829199b596 100644 --- a/htdocs/install/mysql/tables/llx_facturedet_rec.sql +++ b/htdocs/install/mysql/tables/llx_facturedet_rec.sql @@ -25,7 +25,8 @@ create table llx_facturedet_rec ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_facture integer NOT NULL, - fk_product integer, + fk_parent_line integer NULL, + fk_product integer NULL, product_type integer DEFAULT 0, description text, tva_tx double(6,3) DEFAULT 19.6, -- taux tva diff --git a/htdocs/install/mysql/tables/llx_propaldet.sql b/htdocs/install/mysql/tables/llx_propaldet.sql index 5e994490e16..3066579c041 100644 --- a/htdocs/install/mysql/tables/llx_propaldet.sql +++ b/htdocs/install/mysql/tables/llx_propaldet.sql @@ -1,6 +1,7 @@ -- =================================================================== -- Copyright (C) 2002-2003 Rodolphe Quiedeville --- Copyright (C) 2010 Juanjo Menent +-- Copyright (C) 2005-2010 Regis Houssin +-- Copyright (C) 2010 Juanjo Menent -- -- 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 @@ -22,11 +23,12 @@ create table llx_propaldet ( rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_propal integer, - fk_product integer, + fk_propal integer NOT NULL, + fk_parent_line integer NULL, + fk_product integer NULL, description text, fk_remise_except integer NULL, -- Lien vers table des remises fixes - tva_tx double(6,3) DEFAULT 0, -- taux tva + tva_tx double(6,3) DEFAULT 0, -- taux tva localtax1_tx double(6,3) DEFAULT 0, -- localtax1 tax localtax2_tx double(6,3) DEFAULT 0, -- localtax2 tax qty real, -- quantity @@ -39,10 +41,10 @@ create table llx_propaldet 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 + 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 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)