diff --git a/htdocs/telephonie/sql/llx_telephonie_client_stats.key.sql b/htdocs/telephonie/sql/llx_telephonie_client_stats.key.sql new file mode 100644 index 00000000000..28fa5c9a1f2 --- /dev/null +++ b/htdocs/telephonie/sql/llx_telephonie_client_stats.key.sql @@ -0,0 +1,26 @@ +-- ======================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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$ +-- $Source$ +-- +-- ======================================================================== +-- +-- + + +ALTER TABLE llx_telephonie_client_stats ADD FOREIGN KEY (fk_client_comm) REFERENCES llx_societe(idp); diff --git a/htdocs/telephonie/sql/llx_telephonie_client_stats.sql b/htdocs/telephonie/sql/llx_telephonie_client_stats.sql index b09415394c1..ca7b50ac1df 100644 --- a/htdocs/telephonie/sql/llx_telephonie_client_stats.sql +++ b/htdocs/telephonie/sql/llx_telephonie_client_stats.sql @@ -1,3 +1,24 @@ +-- ======================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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$ +-- $Source$ +-- +-- ======================================================================== -- -- create table llx_telephonie_client_stats ( @@ -9,4 +30,3 @@ create table llx_telephonie_client_stats ( )type=innodb; -ALTER TABLE llx_telephonie_client_stats ADD FOREIGN KEY (fk_client_comm) REFERENCES llx_societe(idp); diff --git a/htdocs/telephonie/sql/llx_telephonie_facture.key.sql b/htdocs/telephonie/sql/llx_telephonie_facture.key.sql index 42be1585af3..6087b6e2b91 100644 --- a/htdocs/telephonie/sql/llx_telephonie_facture.key.sql +++ b/htdocs/telephonie/sql/llx_telephonie_facture.key.sql @@ -19,13 +19,13 @@ -- $Source$ -- -- ======================================================================== - +-- -- ALTER TABLE llx_telephonie_facture ADD INDEX (fk_facture); ALTER TABLE llx_telephonie_facture ADD INDEX (fk_ligne); - -- -- ALTER TABLE llx_telephonie_facture ADD FOREIGN KEY (fk_facture) REFERENCES llx_facture (rowid); ALTER TABLE llx_telephonie_facture ADD FOREIGN KEY (fk_ligne) REFERENCES llx_telephonie_societe_ligne (rowid); + diff --git a/htdocs/telephonie/sql/llx_telephonie_facture.sql b/htdocs/telephonie/sql/llx_telephonie_facture.sql index d5a55e976d1..966ab4fdc68 100644 --- a/htdocs/telephonie/sql/llx_telephonie_facture.sql +++ b/htdocs/telephonie/sql/llx_telephonie_facture.sql @@ -35,15 +35,3 @@ create table llx_telephonie_facture ( )type=innodb; --- --- -ALTER TABLE llx_telephonie_facture ADD INDEX (fk_facture); -ALTER TABLE llx_telephonie_facture ADD INDEX (fk_ligne); - --- --- -ALTER TABLE llx_telephonie_facture ADD FOREIGN KEY (fk_facture) -REFERENCES llx_facture (rowid); - -ALTER TABLE llx_telephonie_facture ADD FOREIGN KEY (fk_ligne) -REFERENCES llx_telephonie_societe_ligne (rowid); diff --git a/htdocs/telephonie/sql/llx_telephonie_societe_ligne.sql b/htdocs/telephonie/sql/llx_telephonie_societe_ligne.sql index 519a3dc35dc..203936b2003 100644 --- a/htdocs/telephonie/sql/llx_telephonie_societe_ligne.sql +++ b/htdocs/telephonie/sql/llx_telephonie_societe_ligne.sql @@ -27,19 +27,28 @@ -- 2 recue -- 3 probleme -- - -create table llx_telephonie_societe_ligne_statut ( +create table llx_telephonie_societe_ligne ( rowid integer AUTO_INCREMENT PRIMARY KEY, - tms datetime, - fk_ligne integer NOT NULL, - statut smallint NOT NULL, - fk_user integer, - comment varchar(255) + datec datetime, + fk_client_comm integer NOT NULL, -- Client décideur + fk_soc integer NOT NULL, + ligne varchar(12) NOT NULL, + fk_soc_facture integer NOT NULL, + statut smallint DEFAULT 0, + fk_fournisseur integer NOT NULL, + remise real DEFAULT 0, + note text, + fk_commercial integer NOT NULL, + fk_concurrent integer DEFAULT 1 NOT NULL, + fk_user_creat integer, + date_commande datetime, + fk_user_commande integer, + isfacturable enum('oui','non') DEFAULT 'oui', + mode_paiement enum('vir','pre') DEFAULT 'pre', + code_analytique varchar(12), + + UNIQUE INDEX(fk_soc, ligne) )type=innodb; -ALTER TABLE llx_telephonie_societe_ligne_statut ADD INDEX (fk_ligne); -ALTER TABLE llx_telephonie_societe_ligne_statut ADD INDEX (fk_user); -ALTER TABLE llx_telephonie_societe_ligne_statut ADD FOREIGN KEY (fk_ligne) REFERENCES llx_telephonie_societe_ligne(rowid); -ALTER TABLE llx_telephonie_societe_ligne_statut ADD FOREIGN KEY (fk_user) REFERENCES llx_user(rowid);