Added a field in member table to link to a third party

This commit is contained in:
Laurent Destailleur 2009-02-01 14:40:06 +00:00
parent 47e530b801
commit 076f6ae9ec
7 changed files with 49 additions and 30 deletions

View File

@ -113,11 +113,6 @@ if ($socid > 0)
print '<tr><td>'.$langs->trans("Phone").'</td><td>'.dol_print_phone($societe->tel,$societe->pays_code,0,$societe->id,'AC_TEL').'</td><td>Fax</td><td>'.dol_print_phone($societe->fax,$societe->pays_code).'</td></tr>'; print '<tr><td>'.$langs->trans("Phone").'</td><td>'.dol_print_phone($societe->tel,$societe->pays_code,0,$societe->id,'AC_TEL').'</td><td>Fax</td><td>'.dol_print_phone($societe->fax,$societe->pays_code).'</td></tr>';
print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$societe->url\">$societe->url</a></td></tr>"; print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$societe->url\">$societe->url</a></td></tr>";
if ($societe->rubrique)
{
print "<tr><td>Rubrique</td><td colspan=\"3\">".$societe->rubrique."</td></tr>";
}
print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td colspan="3">'.$societe->forme_juridique.'</td></tr>'; print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td colspan="3">'.$societe->forme_juridique.'</td></tr>';
// Level // Level

View File

@ -503,7 +503,7 @@ class Societe extends CommonObject
$sql .= ','. $this->db->pdate('s.tms').' as date_update'; $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.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.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_typent as typent_id';
$sql .= ', s.fk_effectif as effectif_id'; $sql .= ', s.fk_effectif as effectif_id';
$sql .= ', s.fk_forme_juridique as forme_juridique_code'; $sql .= ', s.fk_forme_juridique as forme_juridique_code';
@ -600,7 +600,6 @@ class Societe extends CommonObject
$this->client = $obj->client; $this->client = $obj->client;
$this->fournisseur = $obj->fournisseur; $this->fournisseur = $obj->fournisseur;
$this->rubrique = $obj->rubrique;
$this->note = $obj->note; $this->note = $obj->note;
// multiprix // multiprix
$this->price_level = $obj->price_level; $this->price_level = $obj->price_level;

View File

@ -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_propale;
ALTER TABLE llx_product drop column stock_commande; 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 -- 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); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1931,193, '0','0','No VAT in SPM',1);

View File

@ -0,0 +1,22 @@
-- ============================================================================
-- Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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);

View File

@ -35,6 +35,7 @@ create table llx_adherent
fk_adherent_type smallint, fk_adherent_type smallint,
morphy varchar(3) NOT NULL, -- personne morale / personne physique morphy varchar(3) NOT NULL, -- personne morale / personne physique
societe varchar(50), societe varchar(50),
fk_soc integer NULL, -- Link to third party linked to member
adresse text, adresse text,
cp varchar(30), cp varchar(30),
ville varchar(50), ville varchar(50),
@ -54,6 +55,5 @@ create table llx_adherent
tms timestamp, -- date de modification tms timestamp, -- date de modification
fk_user_author integer NOT NULL, fk_user_author integer NOT NULL,
fk_user_mod integer, fk_user_mod integer,
fk_user_valid integer, fk_user_valid integer
UNIQUE INDEX(login)
)type=innodb; )type=innodb;

View File

@ -62,8 +62,7 @@ create table llx_societe
customer_bad tinyint DEFAULT 0, -- mauvais payeur 0/1 customer_bad tinyint DEFAULT 0, -- mauvais payeur 0/1
customer_rate real DEFAULT 0, -- taux fiabilié client (0 à 1) customer_rate real DEFAULT 0, -- taux fiabilié client (0 à 1)
supplier_rate real DEFAULT 0, -- taux fiabilié fournisseur (0 à 1) supplier_rate real DEFAULT 0, -- taux fiabilié fournisseur (0 à 1)
rubrique varchar(255), -- champ rubrique libre fk_user_creat integer NULL, -- utilisateur qui a créé l'info
fk_user_creat integer, -- utilisateur qui a créé l'info
fk_user_modif integer, -- utilisateur qui a modifié l'info fk_user_modif integer, -- utilisateur qui a modifié l'info
remise_client real DEFAULT 0, -- remise systématique pour le client remise_client real DEFAULT 0, -- remise systématique pour le client
mode_reglement tinyint, -- mode de réglement mode_reglement tinyint, -- mode de réglement

View File

@ -52,7 +52,7 @@ $dbh = DBI->connect() || die $DBI::errstr;
my $file = "/tmp/importf.csv"; my $file = "/tmp/importf.csv";
my @line; my @line;
my $i = 0; 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: $!"; open (FH, "<$file") || die "can't open $file: $!";
while (<FH>) while (<FH>)
{ {
@ -61,27 +61,26 @@ while (<FH>)
s|\'|\\\'|g; s|\'|\\\'|g;
@line = split /\t/, $_; @line = split /\t/, $_;
$rubrique = $line[0]; $civilite = $line[0];
$civilite = $line[1]; $nom = $line[1];
$nom = $line[2]; $prenom = $line[2];
$prenom = $line[3]; $num = $line[3];
$num = $line[4]; $type = $line[4];
$type = $line[5]; $voie = $line[5];
$voie = $line[6]; $complement = $line[6];
$complement = $line[7]; $cp = $line[7];
$cp = $line[8]; $ville = $line[8];
$ville = $line[9]; $tel = $line[9];
$tel = $line[10]; $fax = $line[10];
$fax = $line[11]; $mobile = $line[11];
$mobile = $line[12]; $email = $line[12];
$email = $line[13]; $web = $line[13];
$web = $line[14]; $commentaire = $line[14];
$commentaire = $line[15];
if ($i > 0 ) if ($i > 0 )
{ {
my $sql = "INSERT INTO llx_societe (datec, client, nom, address,cp,ville,tel,fax,url,note,rubrique,fk_user_creat) "; 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','$rubrique',1)"; $sql .= "VALUES (now(),2,'$nom $prenom','$num $type $voie\n$complement','$cp','$ville','$tel','$fax','$web','$commentaire',1)";
$stha = $dbh->prepare($sql); $stha = $dbh->prepare($sql);
$stha->execute; $stha->execute;