From 6ce48c709a7e299abf47feb377ed6bb7712d946c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Jun 2006 11:57:38 +0000 Subject: [PATCH] =?UTF-8?q?Qual:=20Optimisation=20du=20type=20en=20base=20?= =?UTF-8?q?de=20donn=E9es=20de=20certains=20champs.=20Suppression=20d'un?= =?UTF-8?q?=20champ=20obsolete.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/societe.class.php | 4 +++- mysql/migration/2.0.0-2.1.0.sql | 23 +++++++++++++++++++---- mysql/tables/llx_societe.sql | 19 +++++++++---------- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index 4f8f2c8a396..5f8d165e2a2 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -67,6 +67,8 @@ class Societe var $forme_juridique; var $remise_client; + var $mode_reglement; + var $cond_reglement; var $client; var $prospect; @@ -1243,7 +1245,7 @@ class Societe /** - * \brief Renvoie la liste des libellés traduits types actifs de sociétés + * \brief Renvoie la liste des libellés traduits des types actifs de sociétés * \return array tableau des types */ function typent_array() diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql index 97025611aee..c276ae17070 100644 --- a/mysql/migration/2.0.0-2.1.0.sql +++ b/mysql/migration/2.0.0-2.1.0.sql @@ -33,9 +33,24 @@ alter table llx_propal add column remise_absolue real DEFAULT 0 after remise_per alter table llx_commande add column remise_absolue real DEFAULT 0 after remise_percent; -ALTER TABLE llx_societe ADD mode_reglement INT( 11 ) DEFAULT NULL ; -ALTER TABLE llx_societe ADD cond_reglement INT( 11 ) DEFAULT '1' NOT NULL ; -ALTER TABLE llx_societe ADD tva_assuj tinyint DEFAULT '1'; +ALTER TABLE llx_societe add mode_reglement tinyint; +ALTER TABLE llx_societe add cond_reglement tinyint; +ALTER TABLE llx_societe add tva_assuj tinyint DEFAULT '1'; + +ALTER TABLE llx_societe change active statut tinyint DEFAULT 0; + +ALTER TABLE llx_societe modify mode_reglement tinyint NULL; +ALTER TABLE llx_societe modify cond_reglement tinyint NULL; +ALTER TABLE llx_societe modify cond_reglement tinyint NULL; +ALTER TABLE llx_societe modify fk_stcomm tinyint DEFAULT 0; +ALTER TABLE llx_societe modify services tinyint DEFAULT 0; +ALTER TABLE llx_societe modify client tinyint DEFAULT 0; +ALTER TABLE llx_societe modify fournisseur tinyint DEFAULT 0; + +ALTER TABLE llx_societe drop column id; + +ALTER TABLE llx_societe modify parent integer; +UPDATE llx_societe set parent = null where parent = 0; alter table llx_product add gencode varchar(255) DEFAULT NULL; @@ -259,7 +274,7 @@ insert into llx_c_pays (rowid,code,libelle) values (30, 'SG', 'Singapoure'); alter table llx_bank_account add column ref varchar(12) NOT NULL; -rename table llx_accountingsystem_det to llx_accountingaccount; +alter table llx_accountingsystem_det rename to llx_accountingaccount; insert into llx_rights_def (id, libelle, module, type, bydefault, subperms, perms) values (262,'Consulter tous les clients','commercial','r',1,'voir','client'); diff --git a/mysql/tables/llx_societe.sql b/mysql/tables/llx_societe.sql index 8d4ed4bcafd..2077460148b 100644 --- a/mysql/tables/llx_societe.sql +++ b/mysql/tables/llx_societe.sql @@ -23,9 +23,8 @@ create table llx_societe ( idp integer AUTO_INCREMENT PRIMARY KEY, - id varchar(32), -- private id - active smallint DEFAULT 0, -- - parent integer DEFAULT 0, -- + statut tinyint DEFAULT 0, -- statut + parent integer, tms timestamp, datec datetime, -- creation date datea datetime, -- activation date @@ -52,17 +51,17 @@ create table llx_societe tva_intra varchar(20), -- tva intracommunautaire capital real, -- capital de la société description text, -- - fk_stcomm smallint DEFAULT 0, -- commercial statut + fk_stcomm tinyint DEFAULT 0, -- commercial statut note text, -- - services integer DEFAULT 0, -- + services tinyint DEFAULT 0, -- prefix_comm varchar(5), -- prefix commercial - client integer DEFAULT 0, -- client oui/non - fournisseur smallint DEFAULT 0, -- fournisseur oui/non + client tinyint DEFAULT 0, -- client 0/1/2 + fournisseur tinyint DEFAULT 0, -- fournisseur 0/1 rubrique varchar(255), -- champ rubrique libre fk_user_creat integer, -- utilisateur qui a créé l'info fk_user_modif integer, -- utilisateur qui a modifié l'info remise_client real DEFAULT 0, -- remise systématique pour le client - mode_reglement integer DEFAULT 0, -- mode de réglement - cond_reglement integer DEFAULT 1 NOT NULL, -- condition de réglement - tva_assuj tinyint DEFAULT 1 -- assujéti ou non à la TVA + mode_reglement tinyint, -- mode de réglement + cond_reglement tinyint, -- condition de réglement + tva_assuj tinyint DEFAULT 1 -- assujéti ou non à la TVA )type=innodb;