diff --git a/mysql/migration/2.4.0-2.5.0.sql b/mysql/migration/2.4.0-2.5.0.sql index d7efd100a15..9fff10adca4 100644 --- a/mysql/migration/2.4.0-2.5.0.sql +++ b/mysql/migration/2.4.0-2.5.0.sql @@ -35,3 +35,15 @@ alter table llx_rights_def modify column type varchar(1); ALTER TABLE `llx_commandedet` ADD column `date_start` DATETIME DEFAULT NULL, ADD `date_end` DATETIME DEFAULT NULL ; alter table llx_categorie add column fk_soc integer DEFAULT 0 after description; + +alter table llx_product drop column nbvente; + +alter table llx_product add column import_key varchar(14); +alter table llx_socpeople add column import_key varchar(14); +alter table llx_facture add column import_key varchar(14); +alter table llx_facturedet add column import_key varchar(14); +alter table llx_commande add column import_key varchar(14); +alter table llx_commandedet add column import_key varchar(14); +alter table llx_facture_fourn add column import_key varchar(14); +alter table llx_facture_fourn_det add column import_key varchar(14); + diff --git a/mysql/tables/llx_commande.sql b/mysql/tables/llx_commande.sql index 397d7c533e9..d0bcaf3ee9f 100644 --- a/mysql/tables/llx_commande.sql +++ b/mysql/tables/llx_commande.sql @@ -52,6 +52,5 @@ create table llx_commande fk_mode_reglement integer, -- mode de réglement date_livraison date default NULL, fk_adresse_livraison integer, -- adresse de livraison - - UNIQUE INDEX (ref) + import_key varchar(14) )type=innodb; diff --git a/mysql/tables/llx_commandedet.sql b/mysql/tables/llx_commandedet.sql index 5ab2caa902b..bcc575f7b65 100644 --- a/mysql/tables/llx_commandedet.sql +++ b/mysql/tables/llx_commandedet.sql @@ -25,11 +25,11 @@ create table llx_commandedet fk_commande integer, fk_product integer, description text, - tva_tx double(6,3), -- taux tva + tva_tx double(6,3), -- taux tva qty real, -- quantité 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 + 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 quantité et incluant remise ligne et globale @@ -37,17 +37,18 @@ create table llx_commandedet total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale 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 + 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) special_code tinyint(4) UNSIGNED DEFAULT 0, -- code pour les lignes speciales - rang integer DEFAULT 0 + rang integer DEFAULT 0, + import_key varchar(14) )type=innodb; -- --- Liste des codes pour special_code +-- List of codes for special_code -- -- 1 : frais de port -- 2 : ecotaxe -- 3 : produit/service propose en option --- \ No newline at end of file +-- diff --git a/mysql/tables/llx_facture.sql b/mysql/tables/llx_facture.sql index ef497932236..6b14ca1e52a 100644 --- a/mysql/tables/llx_facture.sql +++ b/mysql/tables/llx_facture.sql @@ -58,5 +58,7 @@ create table llx_facture note text, note_public text, - model_pdf varchar(50) + model_pdf varchar(50), + import_key varchar(14) + )type=innodb; diff --git a/mysql/tables/llx_facture_fourn.sql b/mysql/tables/llx_facture_fourn.sql index fdcbca780f7..17475ad95d3 100644 --- a/mysql/tables/llx_facture_fourn.sql +++ b/mysql/tables/llx_facture_fourn.sql @@ -48,5 +48,6 @@ create table llx_facture_fourn date_lim_reglement date, -- date limite de reglement note text, - note_public text + note_public text, + import_key varchar(14) )type=innodb; diff --git a/mysql/tables/llx_facture_fourn_det.sql b/mysql/tables/llx_facture_fourn_det.sql index 0b565355a38..bc6d89987d3 100644 --- a/mysql/tables/llx_facture_fourn_det.sql +++ b/mysql/tables/llx_facture_fourn_det.sql @@ -31,5 +31,6 @@ create table llx_facture_fourn_det total_ht double(24,8) DEFAULT 0, tva double(24,8) DEFAULT 0, total_ttc double(24,8) DEFAULT 0, - product_type integer DEFAULT 0 + product_type integer DEFAULT 0, + import_key varchar(14) )type=innodb; diff --git a/mysql/tables/llx_facturedet.sql b/mysql/tables/llx_facturedet.sql index 83d84cea930..9de38d863a6 100644 --- a/mysql/tables/llx_facturedet.sql +++ b/mysql/tables/llx_facturedet.sql @@ -24,31 +24,32 @@ create table llx_facturedet ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_facture integer NOT NULL, - fk_product integer NULL, -- Doit pouvoir etre nul pour ligne detail sans produits + fk_product integer NULL, -- Doit pouvoir etre nul pour ligne detail sans produits description text, - tva_taux real, -- Taux tva produit/service (exemple 19.6) - qty real, -- Quantité (exemple 2) + tva_taux real, -- Taux tva produit/service (exemple 19.6) + qty real, -- Quantité (exemple 2) remise_percent real DEFAULT 0, -- % de la remise ligne (exemple 20%) remise real DEFAULT 0, -- Montant calculé de la remise % sur PU HT (exemple 20) - fk_remise_except integer NULL, -- Lien vers table des remises fixes - subprice real, -- P.U. HT (exemple 100) - price real, -- P.U. HT apres remise % de ligne - total_ht real, -- Total HT de la ligne toute quantité et incluant remise ligne et globale - total_tva real, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale - total_ttc real, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale + fk_remise_except integer NULL, -- Lien vers table des remises fixes + subprice real, -- P.U. HT (exemple 100) + price real, -- P.U. HT apres remise % de ligne + total_ht real, -- Total HT de la ligne toute quantité et incluant remise ligne et globale + total_tva real, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale + total_ttc real, -- Total TTC de la ligne toute quantité 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 + 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 fk_code_ventilation integer DEFAULT 0 NOT NULL, fk_export_compta integer DEFAULT 0 NOT NULL, special_code tinyint(4) UNSIGNED DEFAULT 0, -- code pour les lignes speciales - rang integer DEFAULT 0 -- ordre d'affichage + rang integer DEFAULT 0, -- ordre d'affichage + import_key varchar(14) )type=innodb; -- --- Liste des codes pour special_code +-- List of codes for special_code -- -- 1 : frais de port -- 2 : ecotaxe --- \ No newline at end of file +-- diff --git a/mysql/tables/llx_product.sql b/mysql/tables/llx_product.sql index a74e95dcd2a..f9ef57974fc 100644 --- a/mysql/tables/llx_product.sql +++ b/mysql/tables/llx_product.sql @@ -35,7 +35,6 @@ create table llx_product tva_tx double(6,3), fk_user_author integer, envente tinyint DEFAULT 1, - nbvente integer DEFAULT 0, fk_product_type integer DEFAULT 0, duration varchar(6), stock_propale integer DEFAULT 0, @@ -49,6 +48,7 @@ create table llx_product weight_units tinyint DEFAULT NULL, volume float DEFAULT NULL, volume_units tinyint DEFAULT NULL, - canvas varchar(15) DEFAULT '' + canvas varchar(15) DEFAULT '', + import_key varchar(14) )type=innodb; diff --git a/mysql/tables/llx_socpeople.sql b/mysql/tables/llx_socpeople.sql index 885ec6016f2..4a00905ba21 100644 --- a/mysql/tables/llx_socpeople.sql +++ b/mysql/tables/llx_socpeople.sql @@ -43,5 +43,6 @@ create table llx_socpeople priv smallint NOT NULL DEFAULT 0, fk_user_creat integer DEFAULT 0, -- user qui a créé l'enregistrement fk_user_modif integer, - note text + note text, + import_key varchar(14) )type=innodb;