From 9f1f0cf74ed64ebe3118f2381de5c1f0b3b5c9d2 Mon Sep 17 00:00:00 2001 From: opensides Date: Mon, 14 Jun 2004 10:34:43 +0000 Subject: [PATCH] Adaptation pour dolibarr head --- pgsql/tables/llx_c_pays.sql | 4 ++-- pgsql/tables/llx_chargesociales.sql | 1 + pgsql/tables/llx_const.sql | 2 +- pgsql/tables/llx_contrat.sql | 2 ++ pgsql/tables/llx_cotisation.sql | 3 +++ pgsql/tables/llx_entrepot.sql | 2 +- pgsql/tables/llx_expeditiondet.sql | 3 --- pgsql/tables/llx_facture.sql | 2 ++ pgsql/tables/llx_facture_fourn.sql | 2 +- pgsql/tables/llx_facturedet.sql | 4 +++- pgsql/tables/llx_fichinter.sql | 1 - pgsql/tables/llx_groupart.sql | 1 + pgsql/tables/llx_paiement.sql | 8 +++++++- pgsql/tables/llx_paiementfourn.sql | 3 ++- pgsql/tables/llx_product.sql | 6 ++++-- pgsql/tables/llx_product_stock.sql | 2 +- pgsql/tables/llx_propal.sql | 2 +- 17 files changed, 32 insertions(+), 16 deletions(-) diff --git a/pgsql/tables/llx_c_pays.sql b/pgsql/tables/llx_c_pays.sql index 1d98316b7b8..b1fefe89f25 100644 --- a/pgsql/tables/llx_c_pays.sql +++ b/pgsql/tables/llx_c_pays.sql @@ -24,8 +24,8 @@ create table llx_c_pays ( id SERIAL PRIMARY KEY, libelle varchar(25), - code char(2) NOT NULL, - active tinyint default 1 NOT NULL + code char(2) NOT NULL, + active smallint default 1 NOT NULL ); diff --git a/pgsql/tables/llx_chargesociales.sql b/pgsql/tables/llx_chargesociales.sql index 609113889dc..d38453ec34b 100644 --- a/pgsql/tables/llx_chargesociales.sql +++ b/pgsql/tables/llx_chargesociales.sql @@ -20,6 +20,7 @@ -- $Source$ -- -- ======================================================================== + create table llx_chargesociales ( rowid SERIAL PRIMARY KEY, diff --git a/pgsql/tables/llx_const.sql b/pgsql/tables/llx_const.sql index ecc09ea44c9..3524fb1817e 100644 --- a/pgsql/tables/llx_const.sql +++ b/pgsql/tables/llx_const.sql @@ -31,7 +31,7 @@ create table llx_const name varchar(255), value text, -- max 65535 caracteres type CHAR(6) CHECK (type IN ('yesno','texte','chaine')), - visible int DEFAULT 1 NOT NULL, + visible smallint DEFAULT 1 NOT NULL, note text ); diff --git a/pgsql/tables/llx_contrat.sql b/pgsql/tables/llx_contrat.sql index d7122517fe4..11f55bf100f 100644 --- a/pgsql/tables/llx_contrat.sql +++ b/pgsql/tables/llx_contrat.sql @@ -1,5 +1,6 @@ -- ============================================================================ -- 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 @@ -31,6 +32,7 @@ create table llx_contrat fk_soc integer NOT NULL, fk_product integer NOT NULL, fk_facture integer NOT NULL default 0, + fk_facturedet integer NOT NULL default 0, fk_user_author integer NOT NULL, fk_user_mise_en_service integer NOT NULL, fk_user_cloture integer NOT NULL diff --git a/pgsql/tables/llx_cotisation.sql b/pgsql/tables/llx_cotisation.sql index f50aedc06ce..cfa2ed867e6 100644 --- a/pgsql/tables/llx_cotisation.sql +++ b/pgsql/tables/llx_cotisation.sql @@ -1,4 +1,6 @@ -- =================================================================== +-- Copyright (C) 2004 Benoit Mortier +-- -- $Id$ -- $Source$ -- @@ -27,5 +29,6 @@ create table llx_cotisation fk_adherent integer, dateadh timestamp, cotisation real, + fk_bank int(11) default NULL, note text ); diff --git a/pgsql/tables/llx_entrepot.sql b/pgsql/tables/llx_entrepot.sql index f245ebbbafe..bdb3f37ddbd 100644 --- a/pgsql/tables/llx_entrepot.sql +++ b/pgsql/tables/llx_entrepot.sql @@ -28,7 +28,7 @@ create table llx_entrepot tms timestamp, label varchar(255), description text, + statut tinyint default 1, -- 1 ouvert, 0 fermé fk_user_author integer - ); diff --git a/pgsql/tables/llx_expeditiondet.sql b/pgsql/tables/llx_expeditiondet.sql index 40da3c7645a..119e35d354a 100644 --- a/pgsql/tables/llx_expeditiondet.sql +++ b/pgsql/tables/llx_expeditiondet.sql @@ -26,9 +26,6 @@ create table llx_expeditiondet fk_expedition integer not null, fk_commande_ligne integer not null, qty real, -- quantité - - key(fk_expedition), - key(fk_commande_ligne) ); CREATE INDEX llx_expeditiondet_fk_expedition ON llx_expeditiondet(fk_expedition); diff --git a/pgsql/tables/llx_facture.sql b/pgsql/tables/llx_facture.sql index b50bcb4e8d7..3afa5872688 100644 --- a/pgsql/tables/llx_facture.sql +++ b/pgsql/tables/llx_facture.sql @@ -31,8 +31,10 @@ create table llx_facture paye smallint default 0 NOT NULL, amount real default 0 NOT NULL, remise real default 0, + remise_percent real default 0, tva real default 0, total real default 0, + total_ttc real default 0, fk_statut smallint default 0 NOT NULL, author varchar(50), fk_user integer, -- createur de la facture diff --git a/pgsql/tables/llx_facture_fourn.sql b/pgsql/tables/llx_facture_fourn.sql index 6da97d37858..3f1c000fc4e 100644 --- a/pgsql/tables/llx_facture_fourn.sql +++ b/pgsql/tables/llx_facture_fourn.sql @@ -44,4 +44,4 @@ create table llx_facture_fourn note text ); -create unique index llx_facture_fourn_facnumber on llx_facture_fourn(facnumber); +create unique index llx_facture_fourn_facnumber on llx_facture_fourn(facnumber, fksoc); diff --git a/pgsql/tables/llx_facturedet.sql b/pgsql/tables/llx_facturedet.sql index a5a45457c2c..a2cc5d809ec 100644 --- a/pgsql/tables/llx_facturedet.sql +++ b/pgsql/tables/llx_facturedet.sql @@ -32,7 +32,9 @@ create table llx_facturedet 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 + price real, -- prix final + date_start timestamp, -- date debut si service + date_end timestamp -- date fin si service ); 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 8f8db9d3e54..c5dc47dce99 100644 --- a/pgsql/tables/llx_fichinter.sql +++ b/pgsql/tables/llx_fichinter.sql @@ -39,4 +39,3 @@ create table llx_fichinter 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_groupart.sql b/pgsql/tables/llx_groupart.sql index 6f8cbb45d4d..b28dbdfc828 100644 --- a/pgsql/tables/llx_groupart.sql +++ b/pgsql/tables/llx_groupart.sql @@ -28,6 +28,7 @@ create table llx_groupart tms timestamp, nom varchar(64), groupart CHAR(8) CHECK (groupart IN ('artiste','groupe')) NOT NULL, + description text NOT NULL, fk_user_author integer ); diff --git a/pgsql/tables/llx_paiement.sql b/pgsql/tables/llx_paiement.sql index c9f52f80fe2..a7d19f3ec38 100644 --- a/pgsql/tables/llx_paiement.sql +++ b/pgsql/tables/llx_paiement.sql @@ -1,4 +1,6 @@ -- =================================================================== +-- Copyright (C) 2004 Benoit Mortier +-- -- $Id$ -- $Source$ -- @@ -23,10 +25,14 @@ create table llx_paiement rowid SERIAL PRIMARY KEY, fk_facture integer, datec timestamp, + tms timestamp, datep timestamp, -- payment date amount real default 0, author varchar(50), fk_paiement integer NOT NULL, num_paiement varchar(50), - note text + note text, + fk_bank integer NOT NULL, + fk_user_creat integer, -- utilisateur qui a créé l'info + fk_user_modif integer -- utilisateur qui a modifié l'info ); diff --git a/pgsql/tables/llx_paiementfourn.sql b/pgsql/tables/llx_paiementfourn.sql index 53b729c9df4..1d04b3a67b5 100644 --- a/pgsql/tables/llx_paiementfourn.sql +++ b/pgsql/tables/llx_paiementfourn.sql @@ -31,5 +31,6 @@ create table llx_paiementfourn fk_user_author integer, -- auteur fk_paiement integer NOT NULL, -- moyen de paiement num_paiement varchar(50), -- numéro de paiement (cheque) - note text + note text, + fk_bank integer NOT NULL ); diff --git a/pgsql/tables/llx_product.sql b/pgsql/tables/llx_product.sql index 8de0803abe0..fad2ada12c2 100644 --- a/pgsql/tables/llx_product.sql +++ b/pgsql/tables/llx_product.sql @@ -35,6 +35,8 @@ create table llx_product envente smallint default 1, nbvente integer default 0, fk_product_type integer default 0, - duration varchar(6) + duration varchar(6), + stock_propale integer default 0, + stock_commande integer default 0, + seuil_stock_alerte integer default 0 ); - diff --git a/pgsql/tables/llx_product_stock.sql b/pgsql/tables/llx_product_stock.sql index bb7a6a7b847..456e448cba7 100644 --- a/pgsql/tables/llx_product_stock.sql +++ b/pgsql/tables/llx_product_stock.sql @@ -27,7 +27,7 @@ create table llx_product_stock tms timestamp, fk_product integer NOT NULL, fk_stock integer NOT NULL, - value integer + reel integer ); CREATE INDEX llx_product_stock_fk_product ON llx_product_stock (fk_product); diff --git a/pgsql/tables/llx_propal.sql b/pgsql/tables/llx_propal.sql index 578c30908e4..5c6b3914625 100644 --- a/pgsql/tables/llx_propal.sql +++ b/pgsql/tables/llx_propal.sql @@ -30,6 +30,7 @@ create table llx_propal fk_projet integer default 0, -- projet auquel est rattache la propale ref varchar(30) NOT NULL, -- propal number datec timestamp, -- date de creation + fin_validite timestamp, -- date de fin de validite date_valid timestamp, -- date de validation date_cloture timestamp, -- date de cloture datep date, -- date de la propal @@ -48,4 +49,3 @@ create table llx_propal create unique index llx_propal_ref on llx_propal(ref); -create index llx_propal_fk_soc on llx_propal(fk_soc);