From 12aec8f8066d5537896ef3b03134d871316b2267 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Feb 2018 15:19:04 +0100 Subject: [PATCH] Prepare database for invoicing of projects --- .../install/mysql/migration/7.0.0-8.0.0.sql | 7 +++++ htdocs/install/mysql/tables/llx_projet.sql | 3 ++- htdocs/install/mysql/tables/llx_societe.sql | 27 ++++++++++--------- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index 1b9375ef1a8..498d9226b2e 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -22,5 +22,12 @@ -- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; -- Note: fields with type BLOB/TEXT can't have default value. + + + + -- For 8.0 + ALTER TABLE llx_societe ADD COLUMN fk_entrepot integer DEFAULT 0; + +ALTER TABLE llx_projet ADD COLUMN bill_time integer DEFAULT 0; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_projet.sql b/htdocs/install/mysql/tables/llx_projet.sql index 3875e64e1a7..8e58f0ad8c8 100644 --- a/htdocs/install/mysql/tables/llx_projet.sql +++ b/htdocs/install/mysql/tables/llx_projet.sql @@ -41,7 +41,8 @@ create table llx_projet note_public text, --budget_days real, -- budget in days is sum of field planned_workload of tasks opp_amount double(24,8), - budget_amount double(24,8), + budget_amount double(24,8), + bill_time integer DEFAULT 0, -- Set to 1 if time spent must be converted into invoices model_pdf varchar(255), import_key varchar(14) -- Import key )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index c23ca3a183c..f6ee1f39220 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -33,8 +33,6 @@ create table llx_societe statut tinyint DEFAULT 0, -- statut parent integer, - tms timestamp, - datec datetime, -- creation date status tinyint DEFAULT 1, -- cessation d'activité ( 1 -- en activité, 0 -- cessation d'activité) @@ -57,15 +55,15 @@ create table llx_societe fk_typent integer DEFAULT 0, -- fk_forme_juridique integer DEFAULT 0, -- juridical status fk_currency varchar(3), -- default currency - siren varchar(128), -- IDProf1: siren or RCS for france - siret varchar(128), -- IDProf2: siret for france - ape varchar(128), -- IDProf3: code ape for france + siren varchar(128), -- IDProf1: siren or RCS for france, ... + siret varchar(128), -- IDProf2: siret for france, ... + ape varchar(128), -- IDProf3: code ape for france, ... idprof4 varchar(128), -- IDProf4: nu for france idprof5 varchar(128), -- IDProf5: nu for france idprof6 varchar(128), -- IDProf6: nu for france tva_intra varchar(20), -- tva - capital double(24,8), -- capital de la societe - fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial statut + capital double(24,8) DEFAULT NULL, -- capital de la societe + fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial statut note_private text, -- note_public text, -- model_pdf varchar(255), @@ -79,8 +77,6 @@ create table llx_societe customer_bad tinyint DEFAULT 0, -- mauvais payeur 0/1 customer_rate real DEFAULT 0, -- taux fiabilite client (0 a 1) supplier_rate real DEFAULT 0, -- taux fiabilite fournisseur (0 a 1) - fk_user_creat integer NULL, -- utilisateur qui a cree l'info - fk_user_modif integer, -- utilisateur qui a modifie l'info remise_client real DEFAULT 0, -- remise systematique pour le client mode_reglement tinyint, -- mode de reglement cond_reglement tinyint, -- condition de reglement @@ -99,10 +95,17 @@ create table llx_societe default_lang varchar(6), -- default language logo varchar(255) DEFAULT NULL, canvas varchar(32) DEFAULT NULL, -- type of canvas if used (null by default) - import_key varchar(14), -- import key + fk_entrepot integer DEFAULT 0, -- if we need a link between third party and warehouse webservices_url varchar(255), -- supplier webservice url webservices_key varchar(128), -- supplier webservice key - fk_multicurrency integer, - multicurrency_code varchar(255) + tms timestamp, -- last modification date + datec datetime, -- creation date + fk_user_creat integer NULL, -- utilisateur qui a cree l'info + fk_user_modif integer, -- utilisateur qui a modifie l'info + + fk_multicurrency integer, + multicurrency_code varchar(255), + + import_key varchar(14) -- import key )ENGINE=innodb;