diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index de80d439b82..40a7f7b86c6 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -1136,6 +1136,9 @@ ALTER TABLE llx_facture_fourn MODIFY COLUMN ref VARCHAR(255); ALTER TABLE llx_facture_fourn MODIFY COLUMN ref_ext VARCHAR(255); ALTER TABLE llx_facture_fourn MODIFY COLUMN ref_supplier VARCHAR(255); +ALTER TABLE llx_facture_rec ADD COLUMN revenuestamp double(24,8) DEFAULT 0; +ALTER TABLE llx_facturedet_rec MODIFY COLUMN tva_tx double(6,3); +ALTER TABLE llx_facturedet_rec ADD COLUMN fk_contract_line integer NULL; -- This request make mysql drop (mysql bug, so we add it at end): --ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type(rowid); diff --git a/htdocs/install/mysql/tables/llx_facture.sql b/htdocs/install/mysql/tables/llx_facture.sql index 433bef887f1..9757f749cd0 100644 --- a/htdocs/install/mysql/tables/llx_facture.sql +++ b/htdocs/install/mysql/tables/llx_facture.sql @@ -65,6 +65,7 @@ create table llx_facture fk_account integer, -- bank account fk_currency varchar(3), -- currency code + fk_cond_reglement integer DEFAULT 1 NOT NULL, -- condition de reglement (30 jours, fin de mois ...) fk_mode_reglement integer, -- mode de reglement (Virement, Prelevement) date_lim_reglement date, -- date limite de reglement diff --git a/htdocs/install/mysql/tables/llx_facture_rec.sql b/htdocs/install/mysql/tables/llx_facture_rec.sql index 947a65fa5ff..cba4b580cf0 100644 --- a/htdocs/install/mysql/tables/llx_facture_rec.sql +++ b/htdocs/install/mysql/tables/llx_facture_rec.sql @@ -1,8 +1,8 @@ -- =========================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2012 Laurent Destailleur --- Copyright (C) 2009 Regis Houssin --- Copyright (C) 2010 Juanjo Menent +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2012-2014 Laurent Destailleur +-- Copyright (C) 2009 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 @@ -31,17 +31,21 @@ create table llx_facture_rec remise real DEFAULT 0, remise_percent real DEFAULT 0, remise_absolue real DEFAULT 0, + tva double(24,8) DEFAULT 0, localtax1 double(24,8) DEFAULT 0, -- amount localtax1 localtax2 double(24,8) DEFAULT 0, -- amount localtax2 + revenuestamp double(24,8) DEFAULT 0, -- amount total revenuestamp total double(24,8) DEFAULT 0, total_ttc double(24,8) DEFAULT 0, fk_user_author integer, -- createur + fk_projet integer, -- projet auquel est associe la facture - fk_cond_reglement integer DEFAULT 0, -- condition de reglement + + fk_cond_reglement integer DEFAULT 0, -- condition de reglement fk_mode_reglement integer DEFAULT 0, -- mode de reglement (Virement, Prelevement) - date_lim_reglement date, -- date limite de reglement + date_lim_reglement date, -- date limite de reglement note_private text, note_public text, @@ -49,8 +53,9 @@ create table llx_facture_rec usenewprice integer DEFAULT 0, frequency integer, unit_frequency varchar(2) DEFAULT 'd', + date_when datetime DEFAULT NULL, -- date for next gen (when an invoice is generated, this field must be updated with next date) date_last_gen datetime DEFAULT NULL, -- date for last gen (date with last successfull generation of invoice) nb_gen_done integer DEFAULT NULL, -- nb of generation done (when an invoice is generated, this field must incremented) - nb_gen_max integer DEFAULT NULL -- maximum number of generation + nb_gen_max integer DEFAULT NULL -- maximum number of generation )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_facturedet_rec.sql b/htdocs/install/mysql/tables/llx_facturedet_rec.sql index 8da2d147574..05bfa71ec2e 100644 --- a/htdocs/install/mysql/tables/llx_facturedet_rec.sql +++ b/htdocs/install/mysql/tables/llx_facturedet_rec.sql @@ -1,6 +1,6 @@ -- =================================================================== -- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2009 Laurent Destailleur +-- Copyright (C) 2009-2014 Laurent Destailleur -- Copyright (C) 2010 Juanjo Menent -- Copyright (C) 2010-2012 Regis Houssin -- @@ -28,23 +28,23 @@ create table llx_facturedet_rec product_type integer DEFAULT 0, label varchar(255) DEFAULT NULL, description text, - tva_tx double(6,3) DEFAULT 19.6, -- taux tva + tva_tx double(6,3), -- taux tva localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate - localtax1_type varchar(10) NULL, -- localtax1 type + localtax1_type varchar(10) NULL, -- localtax1 type localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate - localtax2_type varchar(10) NULL, -- localtax2 type + localtax2_type varchar(10) NULL, -- localtax2 type qty real, -- quantity - remise_percent real DEFAULT 0, -- pourcentage de remise - remise real DEFAULT 0, -- montant de la remise + remise_percent real DEFAULT 0, -- pourcentage de remise + remise real DEFAULT 0, -- montant de la remise subprice double(24,8), -- prix avant remise price double(24,8), -- prix final total_ht double(24,8), -- Total HT de la ligne toute quantity et incluant remise ligne et globale total_tva double(24,8), -- Total TVA de la ligne toute quantity et incluant remise ligne et globale - total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1 for total quantity of line - total_localtax2 double(24,8) DEFAULT 0, -- total LocalTax2 for total quantity of line + total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1 for total quantity of line + total_localtax2 double(24,8) DEFAULT 0, -- total LocalTax2 for total quantity of line total_ttc double(24,8), -- Total TTC de la ligne toute quantity et incluant remise ligne et globale - info_bits integer DEFAULT 0, -- TVA NPR ou non - special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales - rang integer DEFAULT 0 -- ordre d'affichage - + info_bits integer DEFAULT 0, -- TVA NPR ou non + special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales + rang integer DEFAULT 0, -- ordre d'affichage + fk_contract_line integer NULL -- id of contract line when predefined invoice comes from contract lines )ENGINE=innodb;