diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index b909a409cfd..febba5ee10a 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -113,11 +113,6 @@ if ($socid > 0) print ''.$langs->trans("Phone").''.dol_print_phone($societe->tel,$societe->pays_code,0,$societe->id,'AC_TEL').'Fax'.dol_print_phone($societe->fax,$societe->pays_code).''; print ''.$langs->trans("Web")."url\">$societe->url"; - if ($societe->rubrique) - { - print "Rubrique".$societe->rubrique.""; - } - print ''.$langs->trans('JuridicalStatus').''.$societe->forme_juridique.''; // Level diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index ec38c660cd2..4668cd4bf6f 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -503,7 +503,7 @@ class Societe extends CommonObject $sql .= ','. $this->db->pdate('s.tms').' as date_update'; $sql .= ', s.tel, s.fax, s.email, s.url, s.cp, s.ville, s.note, s.client, s.fournisseur'; $sql .= ', s.siren, s.siret, s.ape, s.idprof4'; - $sql .= ', s.capital, s.tva_intra, s.rubrique'; + $sql .= ', s.capital, s.tva_intra'; $sql .= ', s.fk_typent as typent_id'; $sql .= ', s.fk_effectif as effectif_id'; $sql .= ', s.fk_forme_juridique as forme_juridique_code'; @@ -600,7 +600,6 @@ class Societe extends CommonObject $this->client = $obj->client; $this->fournisseur = $obj->fournisseur; - $this->rubrique = $obj->rubrique; $this->note = $obj->note; // multiprix $this->price_level = $obj->price_level; diff --git a/mysql/migration/2.5.0-2.6.0.sql b/mysql/migration/2.5.0-2.6.0.sql index 720e574ff65..f18aac7414f 100644 --- a/mysql/migration/2.5.0-2.6.0.sql +++ b/mysql/migration/2.5.0-2.6.0.sql @@ -39,6 +39,11 @@ ALTER TABLE llx_categorie ADD INDEX idx_categorie_type (type); ALTER TABLE llx_product drop column stock_propale; ALTER TABLE llx_product drop column stock_commande; +ALTER TABLE llx_adherent drop index login; +ALTER TABLE llx_adherent ADD UNIQUE INDEX uk_adherent_login (login); +ALTER TABLE llx_adherent add column fk_soc integer NULL after societe; + +ALTER TABLE llx_societe drop column rubrique; -- SAINT PIERRE ET MIQUELON insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1931,193, '0','0','No VAT in SPM',1); diff --git a/mysql/tables/llx_adherent.key.sql b/mysql/tables/llx_adherent.key.sql new file mode 100644 index 00000000000..11481993fc5 --- /dev/null +++ b/mysql/tables/llx_adherent.key.sql @@ -0,0 +1,22 @@ +-- ============================================================================ +-- Copyright (C) 2009 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- ============================================================================ + + +ALTER TABLE llx_adherent ADD UNIQUE INDEX uk_adherent_login (login); diff --git a/mysql/tables/llx_adherent.sql b/mysql/tables/llx_adherent.sql index f1239164b21..526f68930b1 100644 --- a/mysql/tables/llx_adherent.sql +++ b/mysql/tables/llx_adherent.sql @@ -35,6 +35,7 @@ create table llx_adherent fk_adherent_type smallint, morphy varchar(3) NOT NULL, -- personne morale / personne physique societe varchar(50), + fk_soc integer NULL, -- Link to third party linked to member adresse text, cp varchar(30), ville varchar(50), @@ -54,6 +55,5 @@ create table llx_adherent tms timestamp, -- date de modification fk_user_author integer NOT NULL, fk_user_mod integer, - fk_user_valid integer, - UNIQUE INDEX(login) + fk_user_valid integer )type=innodb; diff --git a/mysql/tables/llx_societe.sql b/mysql/tables/llx_societe.sql index e8235a7d67e..6b466ce2aeb 100644 --- a/mysql/tables/llx_societe.sql +++ b/mysql/tables/llx_societe.sql @@ -62,8 +62,7 @@ create table llx_societe customer_bad tinyint DEFAULT 0, -- mauvais payeur 0/1 customer_rate real DEFAULT 0, -- taux fiabilié client (0 à 1) supplier_rate real DEFAULT 0, -- taux fiabilié fournisseur (0 à 1) - rubrique varchar(255), -- champ rubrique libre - fk_user_creat integer, -- utilisateur qui a créé l'info + fk_user_creat integer NULL, -- 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 tinyint, -- mode de réglement diff --git a/scripts/company/import-csv.pl b/scripts/company/import-csv.pl index e14fbcd5f6e..ae9efdf57ec 100644 --- a/scripts/company/import-csv.pl +++ b/scripts/company/import-csv.pl @@ -52,7 +52,7 @@ $dbh = DBI->connect() || die $DBI::errstr; my $file = "/tmp/importf.csv"; my @line; my $i = 0; -my ($civ, $rubrique,$civilite,$nom,$prenom,$num,$type,$voie,$complement,$cp,$ville,$tel,$fax,$mobile,$email,$web,$commentaire); +my ($civ,$civilite,$nom,$prenom,$num,$type,$voie,$complement,$cp,$ville,$tel,$fax,$mobile,$email,$web,$commentaire); open (FH, "<$file") || die "can't open $file: $!"; while () { @@ -61,27 +61,26 @@ while () s|\'|\\\'|g; @line = split /\t/, $_; - $rubrique = $line[0]; - $civilite = $line[1]; - $nom = $line[2]; - $prenom = $line[3]; - $num = $line[4]; - $type = $line[5]; - $voie = $line[6]; - $complement = $line[7]; - $cp = $line[8]; - $ville = $line[9]; - $tel = $line[10]; - $fax = $line[11]; - $mobile = $line[12]; - $email = $line[13]; - $web = $line[14]; - $commentaire = $line[15]; + $civilite = $line[0]; + $nom = $line[1]; + $prenom = $line[2]; + $num = $line[3]; + $type = $line[4]; + $voie = $line[5]; + $complement = $line[6]; + $cp = $line[7]; + $ville = $line[8]; + $tel = $line[9]; + $fax = $line[10]; + $mobile = $line[11]; + $email = $line[12]; + $web = $line[13]; + $commentaire = $line[14]; if ($i > 0 ) { - my $sql = "INSERT INTO llx_societe (datec, client, nom, address,cp,ville,tel,fax,url,note,rubrique,fk_user_creat) "; - $sql .= "VALUES (now(),2,'$nom $prenom','$num $type $voie\n$complement','$cp','$ville','$tel','$fax','$web','$commentaire','$rubrique',1)"; + my $sql = "INSERT INTO llx_societe (datec, client, nom, address,cp,ville,tel,fax,url,note,fk_user_creat) "; + $sql .= "VALUES (now(),2,'$nom $prenom','$num $type $voie\n$complement','$cp','$ville','$tel','$fax','$web','$commentaire',1)"; $stha = $dbh->prepare($sql); $stha->execute;