From 1946922031ca3bdbc08efa5d2d591e565b95ea48 Mon Sep 17 00:00:00 2001 From: opensides Date: Sun, 6 Jun 2004 00:05:14 +0000 Subject: [PATCH] nouvelle version pour dolibarr 1.1.0 --- pgsql/tables/Makefile | 18 +++++++++--------- pgsql/tables/c_actioncomm.sql | 4 ++-- pgsql/tables/c_chargesociales.sql | 4 ++-- pgsql/tables/c_effectif.sql | 4 ++-- pgsql/tables/c_paiement.sql | 4 ++-- pgsql/tables/c_pays.sql | 4 ++-- pgsql/tables/c_propalst.sql | 4 ++-- pgsql/tables/c_stcomm.sql | 4 ++-- pgsql/tables/c_typent.sql | 4 ++-- pgsql/tables/llx_adherent.sql | 9 +++++++-- pgsql/tables/llx_adherent_type.sql | 9 ++++++--- pgsql/tables/llx_bank.sql | 2 +- pgsql/tables/llx_bank_account.sql | 10 ++++------ pgsql/tables/llx_bank_categ.sql | 2 +- pgsql/tables/llx_bookmark.sql | 2 +- pgsql/tables/llx_chargesociales.sql | 2 +- pgsql/tables/llx_compta.sql | 2 +- pgsql/tables/llx_compta_account.sql | 2 +- pgsql/tables/llx_cotisation.sql | 2 +- pgsql/tables/llx_domain.sql | 2 +- pgsql/tables/llx_don.sql | 2 +- pgsql/tables/llx_don_projet.sql | 2 +- pgsql/tables/llx_fa_pr.sql | 2 +- pgsql/tables/llx_facture.sql | 11 ++++++++--- pgsql/tables/llx_facture_fourn.sql | 8 +++++--- pgsql/tables/llx_facturedet.sql | 20 +++++++++++++------- pgsql/tables/llx_fichinter.sql | 15 +++++---------- pgsql/tables/llx_paiement.sql | 3 +-- pgsql/tables/llx_product.sql | 18 +++++++++++++----- pgsql/tables/llx_projet.sql | 2 +- pgsql/tables/llx_propal.sql | 18 ++++++++---------- pgsql/tables/llx_propaldet.sql | 12 +++++++++--- pgsql/tables/llx_service.sql | 2 +- pgsql/tables/llx_soc_recontact.sql | 5 +++-- pgsql/tables/llx_todocomm.sql | 5 +++-- pgsql/tables/llx_tva.sql | 2 +- pgsql/tables/llx_user.sql | 8 +++++--- pgsql/tables/llx_ventes.sql | 2 +- pgsql/tables/llx_voyage.sql | 4 +--- pgsql/tables/llx_voyage_reduc.sql | 5 +---- 40 files changed, 132 insertions(+), 108 deletions(-) diff --git a/pgsql/tables/Makefile b/pgsql/tables/Makefile index 6df3f3ef595..5939382eda7 100644 --- a/pgsql/tables/Makefile +++ b/pgsql/tables/Makefile @@ -27,15 +27,15 @@ OPTIONS=-U $(OWNER) all: show create: - $(SQL) $(OPTIONS) $(BASE) < llx_actioncomm.sql - $(SQL) $(OPTIONS) $(BASE) < llx_c_actioncomm.sql - $(SQL) $(OPTIONS) $(BASE) < llx_c_chargesociales.sql - $(SQL) $(OPTIONS) $(BASE) < llx_c_effectif.sql - $(SQL) $(OPTIONS) $(BASE) < llx_c_paiement.sql - $(SQL) $(OPTIONS) $(BASE) < llx_c_pays.sql - $(SQL) $(OPTIONS) $(BASE) < llx_c_propalst.sql - $(SQL) $(OPTIONS) $(BASE) < llx_c_stcomm.sql - $(SQL) $(OPTIONS) $(BASE) < llx_c_typent.sql + $(SQL) $(OPTIONS) $(BASE) < actioncomm.sql + $(SQL) $(OPTIONS) $(BASE) < c_actioncomm.sql + $(SQL) $(OPTIONS) $(BASE) < c_chargesociales.sql + $(SQL) $(OPTIONS) $(BASE) < c_effectif.sql + $(SQL) $(OPTIONS) $(BASE) < c_paiement.sql + $(SQL) $(OPTIONS) $(BASE) < c_pays.sql + $(SQL) $(OPTIONS) $(BASE) < c_propalst.sql + $(SQL) $(OPTIONS) $(BASE) < c_stcomm.sql + $(SQL) $(OPTIONS) $(BASE) < c_typent.sql $(SQL) $(OPTIONS) $(BASE) < llx_adherent.sql $(SQL) $(OPTIONS) $(BASE) < llx_bank.sql $(SQL) $(OPTIONS) $(BASE) < llx_bank_account.sql diff --git a/pgsql/tables/c_actioncomm.sql b/pgsql/tables/c_actioncomm.sql index f3ad217e88a..5bb7b1f0da5 100644 --- a/pgsql/tables/c_actioncomm.sql +++ b/pgsql/tables/c_actioncomm.sql @@ -21,9 +21,9 @@ -- -- ======================================================================== -create table llx_c_actioncomm +create table c_actioncomm ( - id SERIAL, + id SERIAL PRIMARY KEY, libelle varchar(30), todo int ); diff --git a/pgsql/tables/c_chargesociales.sql b/pgsql/tables/c_chargesociales.sql index df69f925747..147ab9522f7 100644 --- a/pgsql/tables/c_chargesociales.sql +++ b/pgsql/tables/c_chargesociales.sql @@ -20,9 +20,9 @@ -- $Source$ -- -- ======================================================================== -create table llx_c_chargesociales +create table c_chargesociales ( - id SERIAL, + id SERIAL PRIMARY KEY, libelle varchar(80), deductible smallint NOT NULL default 0 ); diff --git a/pgsql/tables/c_effectif.sql b/pgsql/tables/c_effectif.sql index eff3fcb0938..943a00a911b 100644 --- a/pgsql/tables/c_effectif.sql +++ b/pgsql/tables/c_effectif.sql @@ -18,9 +18,9 @@ -- -- ======================================================================== -create table llx_c_effectif +create table c_effectif ( - id SERIAL, + id SERIAL PRIMARY KEY, libelle varchar(30) ); diff --git a/pgsql/tables/c_paiement.sql b/pgsql/tables/c_paiement.sql index c9fc0c28cb1..58a05658bf0 100644 --- a/pgsql/tables/c_paiement.sql +++ b/pgsql/tables/c_paiement.sql @@ -28,9 +28,9 @@ -- 1 : sortie d'argent -- 2 : entrée ou sortie d'argent -create table llx_c_paiement +create table c_paiement ( - id SERIAL, + id SERIAL PRIMARY KEY, libelle varchar(30), type smallint ); diff --git a/pgsql/tables/c_pays.sql b/pgsql/tables/c_pays.sql index f908266d6c0..2165c4da6f6 100644 --- a/pgsql/tables/c_pays.sql +++ b/pgsql/tables/c_pays.sql @@ -18,9 +18,9 @@ -- -- ======================================================================== -create table llx_c_pays +create table c_pays ( - id SERIAL, + id SERIAL PRIMARY KEY, libelle varchar(25), code char(2) NOT NULL ); diff --git a/pgsql/tables/c_propalst.sql b/pgsql/tables/c_propalst.sql index f09c691ab0a..d374545d273 100644 --- a/pgsql/tables/c_propalst.sql +++ b/pgsql/tables/c_propalst.sql @@ -18,9 +18,9 @@ -- -- =================================================================== -create table llx_c_propalst +create table c_propalst ( - id SERIAL, + id SERIAL PRIMARY KEY, label varchar(30) ); diff --git a/pgsql/tables/c_stcomm.sql b/pgsql/tables/c_stcomm.sql index 10ea2730e7f..191f9ae5967 100644 --- a/pgsql/tables/c_stcomm.sql +++ b/pgsql/tables/c_stcomm.sql @@ -18,9 +18,9 @@ -- -- ======================================================================== -create table llx_c_stcomm +create table c_stcomm ( - id SERIAL, + id SERIAL PRIMARY KEY, libelle varchar(30) ); diff --git a/pgsql/tables/c_typent.sql b/pgsql/tables/c_typent.sql index 7ec4d30f35e..30e47cb3275 100644 --- a/pgsql/tables/c_typent.sql +++ b/pgsql/tables/c_typent.sql @@ -18,8 +18,8 @@ -- -- ======================================================================== -create table llx_c_typent +create table c_typent ( - id SERIAL, + id SERIAL PRIMARY KEY, libelle varchar(30) ); diff --git a/pgsql/tables/llx_adherent.sql b/pgsql/tables/llx_adherent.sql index 804a6bf8a9f..c6b8d4e4c70 100644 --- a/pgsql/tables/llx_adherent.sql +++ b/pgsql/tables/llx_adherent.sql @@ -24,11 +24,13 @@ create table llx_adherent ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, tms timestamp, statut smallint NOT NULL DEFAULT 0, + public smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils public ou pas ? fk_adherent_type smallint, - datec timestamp, + datevalid timestamp, -- date de validation + datec timestamp, -- date de creation prenom varchar(50), nom varchar(50), societe varchar(50), @@ -37,6 +39,9 @@ create table llx_adherent ville varchar(50), pays varchar(50), email varchar(255), + login varchar(50) NOT NULL, -- login utilise pour editer sa fiche + pass varchar(50), -- pass utilise pour editer sa fiche + naiss date, -- date de naissance fk_user_author integer NOT NULL, fk_user_valid integer NOT NULL, datefin timestamp NOT NULL, -- date de fin de validité de la cotisation diff --git a/pgsql/tables/llx_adherent_type.sql b/pgsql/tables/llx_adherent_type.sql index 5e824dbfdba..421107e4c41 100644 --- a/pgsql/tables/llx_adherent_type.sql +++ b/pgsql/tables/llx_adherent_type.sql @@ -22,12 +22,15 @@ -- 0 : actif -- 1 : inactif + create table llx_adherent_type ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, tms timestamp, statut smallint NOT NULL DEFAULT 0, libelle varchar(50), - cotisation enum('yes','no') NOT NULL DEFAULT 'yes', - note text + cotisation CHAR(3) CHECK (cotisation IN ('yes','no')) NOT NULL DEFAULT 'yes', + vote CHAR(3) CHECK (vote IN ('yes','no')) NOT NULL DEFAULT 'yes', + note text, + mail_valid text -- mail envoye a la validation ); diff --git a/pgsql/tables/llx_bank.sql b/pgsql/tables/llx_bank.sql index 5f7da0dbd11..263f646a95b 100644 --- a/pgsql/tables/llx_bank.sql +++ b/pgsql/tables/llx_bank.sql @@ -24,7 +24,7 @@ create table llx_bank ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, datec timestamp, datev date, -- date de valeur dateo date, -- date operation diff --git a/pgsql/tables/llx_bank_account.sql b/pgsql/tables/llx_bank_account.sql index 4af74d951a0..cc69f31ebb7 100644 --- a/pgsql/tables/llx_bank_account.sql +++ b/pgsql/tables/llx_bank_account.sql @@ -1,6 +1,7 @@ -- =================================================================== -- Copyright (C) 2000-2002 Rodolphe Quiedeville -- Copyright (C) 2002-2003 Éric Seigne +-- Copyright (C) 2004 Benoit Mortier -- -- $Id$ -- $Source$ @@ -23,21 +24,18 @@ create table llx_bank_account ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, datec timestamp, tms timestamp, label varchar(30), bank varchar(255), - code_banque varchar(7), code_guichet varchar(6), number varchar(255), cle_rib varchar(5), bic varchar(10), - iban_prefix varchar(5), - domiciliation varchar(50), - - courant smallint default 0 not null + courant smallint default 0 not null, + clos smallint default 0 not null ); diff --git a/pgsql/tables/llx_bank_categ.sql b/pgsql/tables/llx_bank_categ.sql index 9a80a921803..464ef463a17 100644 --- a/pgsql/tables/llx_bank_categ.sql +++ b/pgsql/tables/llx_bank_categ.sql @@ -20,6 +20,6 @@ create table llx_bank_categ ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, label varchar(255) ); diff --git a/pgsql/tables/llx_bookmark.sql b/pgsql/tables/llx_bookmark.sql index 946387a7529..0e9190836dc 100644 --- a/pgsql/tables/llx_bookmark.sql +++ b/pgsql/tables/llx_bookmark.sql @@ -21,7 +21,7 @@ create table llx_bookmark ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, fk_soc integer, fk_user integer, dateb timestamp diff --git a/pgsql/tables/llx_chargesociales.sql b/pgsql/tables/llx_chargesociales.sql index c8cff613116..609113889dc 100644 --- a/pgsql/tables/llx_chargesociales.sql +++ b/pgsql/tables/llx_chargesociales.sql @@ -22,7 +22,7 @@ -- ======================================================================== create table llx_chargesociales ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, date_ech timestamp NOT NULL, -- date d'echeance date_pai timestamp, -- date de paiements libelle varchar(80), diff --git a/pgsql/tables/llx_compta.sql b/pgsql/tables/llx_compta.sql index 3b3732bcc70..89e84bbbc70 100644 --- a/pgsql/tables/llx_compta.sql +++ b/pgsql/tables/llx_compta.sql @@ -24,7 +24,7 @@ create table llx_compta ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, datec timestamp, datev date, -- date de valeur amount real NOT NULL default 0, diff --git a/pgsql/tables/llx_compta_account.sql b/pgsql/tables/llx_compta_account.sql index 49e4908f8ac..c2e4bded589 100644 --- a/pgsql/tables/llx_compta_account.sql +++ b/pgsql/tables/llx_compta_account.sql @@ -24,7 +24,7 @@ create table llx_compta_account ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, datec timestamp, number varchar(12), label varchar(255), diff --git a/pgsql/tables/llx_cotisation.sql b/pgsql/tables/llx_cotisation.sql index 08281b2978e..f50aedc06ce 100644 --- a/pgsql/tables/llx_cotisation.sql +++ b/pgsql/tables/llx_cotisation.sql @@ -21,7 +21,7 @@ create table llx_cotisation ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, tms timestamp, datec timestamp, fk_adherent integer, diff --git a/pgsql/tables/llx_domain.sql b/pgsql/tables/llx_domain.sql index dc92b292f48..0f2d0f056f0 100644 --- a/pgsql/tables/llx_domain.sql +++ b/pgsql/tables/llx_domain.sql @@ -23,7 +23,7 @@ create table llx_domain ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, datec timestamp, label varchar(255), note text diff --git a/pgsql/tables/llx_don.sql b/pgsql/tables/llx_don.sql index 743f95290ea..3e98f47611e 100644 --- a/pgsql/tables/llx_don.sql +++ b/pgsql/tables/llx_don.sql @@ -21,7 +21,7 @@ create table llx_don ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, tms timestamp, fk_statut smallint NOT NULL DEFAULT 0,-- etat du don promesse/valid datec timestamp, -- date de création de l'enregistrement diff --git a/pgsql/tables/llx_don_projet.sql b/pgsql/tables/llx_don_projet.sql index d7d8ed6e2dd..889505df4bf 100644 --- a/pgsql/tables/llx_don_projet.sql +++ b/pgsql/tables/llx_don_projet.sql @@ -21,7 +21,7 @@ create table llx_don_projet ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, tms timestamp, datec timestamp, libelle varchar(255), diff --git a/pgsql/tables/llx_fa_pr.sql b/pgsql/tables/llx_fa_pr.sql index d79d29d1c24..9afd4c65704 100644 --- a/pgsql/tables/llx_fa_pr.sql +++ b/pgsql/tables/llx_fa_pr.sql @@ -20,7 +20,7 @@ create table llx_fa_pr ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, fk_facture integer, fk_propal integer ); diff --git a/pgsql/tables/llx_facture.sql b/pgsql/tables/llx_facture.sql index daabfb7a280..b50bcb4e8d7 100644 --- a/pgsql/tables/llx_facture.sql +++ b/pgsql/tables/llx_facture.sql @@ -1,6 +1,7 @@ -- =========================================================================== -- Copyright (C) 2001-2002 Rodolphe Quiedeville -- Copyright (C) 2002-2003 Éric Seigne +-- Copyright (C) 2004 Benoit Mortier -- -- 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 @@ -22,7 +23,7 @@ create table llx_facture ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, facnumber varchar(50) NOT NULL, fk_soc integer NOT NULL, datec timestamp, -- date de creation de la facture @@ -37,8 +38,12 @@ create table llx_facture fk_user integer, -- createur de la facture fk_user_author integer, -- createur de la propale fk_user_valid integer, -- valideur de la propale + fk_projet integer, -- projet auquel est associé la facture + fk_cond_reglement integer, -- condition de reglement + date_lim_reglement date, -- date limite de reglement note text - ); -create unique index llx_facture_facnumber on llx_facture(facnumber); \ No newline at end of file +create unique index llx_facture_facnumber on llx_facture(facnumber); + +create index llx_facture_fksoc on llx_facture(fk_soc); diff --git a/pgsql/tables/llx_facture_fourn.sql b/pgsql/tables/llx_facture_fourn.sql index 70096514719..6da97d37858 100644 --- a/pgsql/tables/llx_facture_fourn.sql +++ b/pgsql/tables/llx_facture_fourn.sql @@ -1,6 +1,7 @@ -- =========================================================================== -- Copyright (C) 2001-2002 Rodolphe Quiedeville -- Copyright (C) 2002-2003 Éric Seigne +-- Copyright (C) 2004 Benoit Mortier -- -- 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 @@ -23,7 +24,7 @@ create table llx_facture_fourn ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, facnumber varchar(50) NOT NULL, fk_soc integer NOT NULL, datec timestamp, -- date de creation de la facture @@ -34,11 +35,12 @@ create table llx_facture_fourn remise real default 0, tva real default 0, total real default 0, + total_ht real default 0, + total_tva real default 0, + total_ttc real default 0, fk_statut smallint default 0 NOT NULL, - fk_user_author integer, -- createur de la propale fk_user_valid integer, -- valideur de la propale - note text ); diff --git a/pgsql/tables/llx_facturedet.sql b/pgsql/tables/llx_facturedet.sql index 2614b45d3c9..a5a45457c2c 100644 --- a/pgsql/tables/llx_facturedet.sql +++ b/pgsql/tables/llx_facturedet.sql @@ -1,6 +1,7 @@ -- =================================================================== -- Copyright (C) 2001-2002 Rodolphe Quiedeville -- Copyright (C) 2002-2003 Éric Seigne +-- Copyright (C) 2004 Benoit Mortier -- -- 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 @@ -22,11 +23,16 @@ create table llx_facturedet ( - rowid SERIAL, - fk_facture integer, - fk_product integer, - datec timestamp, - note varchar(255), - price real default 0 - + rowid SERIAL PRIMARY KEY, + fk_facture integer NOT NULL, + fk_product integer NOT NULL DEFAULT 0, + description text, + tva_taux real default 19.6, -- taux tva + qty real, -- quantité + remise_percent real default 0, -- pourcentage de remise + remise real default 0, -- montant de la remise + subprice real, -- prix avant remise + price real -- prix final ); + +CREATE INDEX llx_facturedet_fk_facture ON llx_facturedet (fk_facture); diff --git a/pgsql/tables/llx_fichinter.sql b/pgsql/tables/llx_fichinter.sql index 057aeab4927..8f8db9d3e54 100644 --- a/pgsql/tables/llx_fichinter.sql +++ b/pgsql/tables/llx_fichinter.sql @@ -23,25 +23,20 @@ create table llx_fichinter ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, fk_soc integer NOT NULL, fk_projet integer default 0, -- projet auquel est rattache la fiche ref varchar(30) NOT NULL, -- number - - datec timestamp, -- date de creation + datec timestamp, -- date de creation date_valid timestamp, -- date de validation - datei date, -- date de l'intervention - fk_user_author integer, -- createur de la fiche - fk_user_valid integer, -- valideur de la fiche - fk_statut smallint default 0, - duree real, - note text ); -create unique index llx_fichinter_ref on llx_fichinter(ref); \ No newline at end of file +CREATE UNIQUE INDEX llx_fichinter_ref ON llx_fichinter(ref); + +CREATE INDEX llx_fichinter_fk_soc ON llx_fichinter(fk_soc); diff --git a/pgsql/tables/llx_paiement.sql b/pgsql/tables/llx_paiement.sql index 892e032a5b3..c9f52f80fe2 100644 --- a/pgsql/tables/llx_paiement.sql +++ b/pgsql/tables/llx_paiement.sql @@ -18,10 +18,9 @@ -- -- =================================================================== - create table llx_paiement ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, fk_facture integer, datec timestamp, datep timestamp, -- payment date diff --git a/pgsql/tables/llx_product.sql b/pgsql/tables/llx_product.sql index ca4f0da167e..8de0803abe0 100644 --- a/pgsql/tables/llx_product.sql +++ b/pgsql/tables/llx_product.sql @@ -1,6 +1,6 @@ -- =================================================================== --- $Id$ --- $Source$ +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier -- -- 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 @@ -16,17 +16,25 @@ -- 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_product ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, datec timestamp, tms timestamp, ref varchar(15), label varchar(255), description text, - price smallint, - fk_user_author integer + price double precision, + tva_tx double precision default 19.6, + fk_user_author integer, + envente smallint default 1, + nbvente integer default 0, + fk_product_type integer default 0, + duration varchar(6) ); diff --git a/pgsql/tables/llx_projet.sql b/pgsql/tables/llx_projet.sql index 196a5ee255f..9dcc5628bcc 100644 --- a/pgsql/tables/llx_projet.sql +++ b/pgsql/tables/llx_projet.sql @@ -23,7 +23,7 @@ create table llx_projet ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, fk_soc integer NOT NULL, fk_statut smallint NOT NULL, tms timestamp, diff --git a/pgsql/tables/llx_propal.sql b/pgsql/tables/llx_propal.sql index 6596ed5a830..578c30908e4 100644 --- a/pgsql/tables/llx_propal.sql +++ b/pgsql/tables/llx_propal.sql @@ -1,6 +1,7 @@ -- =================================================================== -- Copyright (C) 2001-2002 Rodolphe Quiedeville -- Copyright (C) 2002-2003 Éric Seigne +-- Copyright (C) 2004 Benoit Mortier -- -- $Id$ -- $Source$ @@ -23,31 +24,28 @@ create table llx_propal ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, fk_soc integer, fk_soc_contact integer, fk_projet integer default 0, -- projet auquel est rattache la propale ref varchar(30) NOT NULL, -- propal number - - datec timestamp, -- date de creation + datec timestamp, -- date de creation date_valid timestamp, -- date de validation date_cloture timestamp, -- date de cloture - datep date, -- date de la propal - fk_user_author integer, -- createur de la propale - fk_user_valid integer, -- valideur de la propale - fk_user_cloture integer, -- cloture de la propale signee ou non signee - - fk_statut smallint default 0, price real default 0, + remise_percent real default 0, remise real default 0, tva real default 0, total real default 0, - note text + note text, + model_pdf varchar(50) ); create unique index llx_propal_ref on llx_propal(ref); + +create index llx_propal_fk_soc on llx_propal(fk_soc); diff --git a/pgsql/tables/llx_propaldet.sql b/pgsql/tables/llx_propaldet.sql index eda77a5af87..ede259fdf62 100644 --- a/pgsql/tables/llx_propaldet.sql +++ b/pgsql/tables/llx_propaldet.sql @@ -1,6 +1,7 @@ -- =================================================================== -- Copyright (C) 2002 Rodolphe Quiedeville -- Copyright (C) 2002-2003 Éric Seigne +-- Copyright (C) 2004 Benoit Mortier -- -- $Id$ -- $Source$ @@ -23,9 +24,14 @@ create table llx_propaldet ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, fk_propal integer, fk_product integer, - qty smallint, - price real + description text, + tva_tx real default 19.6, -- taux tva + qty real, -- quantité + remise_percent real default 0, -- pourcentage de remise + remise real default 0, -- montant de la remise + subprice real, -- prix avant remise + price real -- prix final ); diff --git a/pgsql/tables/llx_service.sql b/pgsql/tables/llx_service.sql index 05ae02b0ea2..cfbe7391864 100644 --- a/pgsql/tables/llx_service.sql +++ b/pgsql/tables/llx_service.sql @@ -23,7 +23,7 @@ create table llx_service ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, datec timestamp, tms timestamp, ref varchar(15), diff --git a/pgsql/tables/llx_soc_recontact.sql b/pgsql/tables/llx_soc_recontact.sql index 0422cd15086..7408f3732b0 100644 --- a/pgsql/tables/llx_soc_recontact.sql +++ b/pgsql/tables/llx_soc_recontact.sql @@ -22,10 +22,11 @@ -- Societes a recontacter -- -- =================================================================== + create table llx_soc_recontact ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, fk_soc integer, datere timestamp, author varchar(15) -); \ No newline at end of file +); diff --git a/pgsql/tables/llx_todocomm.sql b/pgsql/tables/llx_todocomm.sql index 38bd59c1091..62dd4383506 100644 --- a/pgsql/tables/llx_todocomm.sql +++ b/pgsql/tables/llx_todocomm.sql @@ -23,15 +23,16 @@ -- Actions commerciales a effectuer -- -- ======================================================================== + create table llx_todocomm ( - id SERIAL, + id SERIAL PRIMARY KEY, datea timestamp, -- date de l'action label varchar(50), -- libelle de l'action fk_user_action integer, -- id de la personne qui doit effectuer l'action fk_user_author integer, -- id auteur de l'action fk_soc integer, -- id de la societe auquel est rattachee l'action - fk_contact integer, -- id du contact sur laquelle l'action + fk_contact integer, -- id du contact sur laquelle l'action -- doit etre effectuee note text ); diff --git a/pgsql/tables/llx_tva.sql b/pgsql/tables/llx_tva.sql index d5489089a31..f32492d9631 100644 --- a/pgsql/tables/llx_tva.sql +++ b/pgsql/tables/llx_tva.sql @@ -23,7 +23,7 @@ create table llx_tva ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, tms timestamp, datep date, -- date de paiement datev date, -- date de valeur diff --git a/pgsql/tables/llx_user.sql b/pgsql/tables/llx_user.sql index 9888fb6943a..80584ce0eaf 100644 --- a/pgsql/tables/llx_user.sql +++ b/pgsql/tables/llx_user.sql @@ -1,6 +1,7 @@ -- ============================================================================ -- Copyright (C) 2001-2002 Rodolphe Quiedeville -- Copyright (C) 2002-2003 Éric Seigne +-- Copyright (C) 2004 Benoit Mortier -- -- 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 @@ -23,7 +24,7 @@ create table llx_user ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, datec timestamp, tms timestamp, login varchar(8), @@ -36,9 +37,10 @@ create table llx_user webcal_login varchar(25), module_comm smallint default 1, module_compta smallint default 1, + fk_societe integer default 0, + fk_socpeople integer default 0, note text - ); -create unique index llx_user_index_login on llx_user(login); +create unique index llx_user_login on llx_user(login); diff --git a/pgsql/tables/llx_ventes.sql b/pgsql/tables/llx_ventes.sql index 633742694fa..fac47a8dccc 100644 --- a/pgsql/tables/llx_ventes.sql +++ b/pgsql/tables/llx_ventes.sql @@ -23,7 +23,7 @@ create table llx_ventes ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, fk_soc integer NOT NULL, fk_product integer NOT NULL, dated timestamp, -- date debut diff --git a/pgsql/tables/llx_voyage.sql b/pgsql/tables/llx_voyage.sql index 5c781701b5b..d3eff970e74 100644 --- a/pgsql/tables/llx_voyage.sql +++ b/pgsql/tables/llx_voyage.sql @@ -21,12 +21,10 @@ -- -- =================================================================== - create table llx_voyage ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, datec timestamp, - dateo date, -- date operation date_depart timestamp, -- date du voyage date_arrivee timestamp, -- date du voyage diff --git a/pgsql/tables/llx_voyage_reduc.sql b/pgsql/tables/llx_voyage_reduc.sql index 65740fbb5ea..e07d0ae0f87 100644 --- a/pgsql/tables/llx_voyage_reduc.sql +++ b/pgsql/tables/llx_voyage_reduc.sql @@ -21,19 +21,16 @@ -- -- =================================================================== - create table llx_voyage_reduc ( - rowid SERIAL, + rowid SERIAL PRIMARY KEY, datec timestamp, datev date, -- date de valeur - date_debut date, -- date operation date_fin date, amount real NOT NULL default 0, label varchar(255), numero varchar(255), fk_type smallint, -- Train, Avion, Bateaux - note text );