nouvelle version des tables posgtresql
beautification du code, tout les parametres en MAJUSCULES
This commit is contained in:
parent
cacc392b85
commit
a39bb20058
@ -22,6 +22,6 @@
|
|||||||
create table llx_fa_pr
|
create table llx_fa_pr
|
||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
fk_facture integer,
|
fk_facture integer,
|
||||||
fk_propal integer
|
fk_propal integer
|
||||||
)type=innodb;
|
)type=innodb;
|
||||||
|
|||||||
@ -22,18 +22,18 @@
|
|||||||
create table llx_facture
|
create table llx_facture
|
||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
facnumber varchar(50) NOT NULL,
|
facnumber varchar(50) NOT NULL,
|
||||||
fk_soc integer NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
datec datetime, -- date de creation de la facture
|
datec datetime, -- date de creation de la facture
|
||||||
datef date, -- date de la facture
|
datef date, -- date de la facture
|
||||||
paye smallint default 0 NOT NULL,
|
paye smallint DEFAULT 0 NOT NULL,
|
||||||
amount real default 0 NOT NULL,
|
amount real DEFAULT 0 NOT NULL,
|
||||||
remise real default 0,
|
remise real DEFAULT 0,
|
||||||
remise_percent real default 0,
|
remise_percent real DEFAULT 0,
|
||||||
tva real default 0,
|
tva real DEFAULT 0,
|
||||||
total real default 0,
|
total real DEFAULT 0,
|
||||||
total_ttc real default 0,
|
total_ttc real DEFAULT 0,
|
||||||
fk_statut smallint default 0 NOT NULL,
|
fk_statut smallint DEFAULT 0 NOT NULL,
|
||||||
author varchar(50),
|
author varchar(50),
|
||||||
fk_user integer, -- createur de la facture
|
fk_user integer, -- createur de la facture
|
||||||
fk_user_author integer, -- createur de la propale
|
fk_user_author integer, -- createur de la propale
|
||||||
|
|||||||
@ -28,16 +28,16 @@ create table llx_facture_fourn
|
|||||||
datec datetime, -- date de creation de la facture
|
datec datetime, -- date de creation de la facture
|
||||||
datef date, -- date de la facture
|
datef date, -- date de la facture
|
||||||
libelle varchar(255),
|
libelle varchar(255),
|
||||||
paye smallint default 0 NOT NULL,
|
paye smallint DEFAULT 0 NOT NULL,
|
||||||
amount real default 0 NOT NULL,
|
amount real DEFAULT 0 NOT NULL,
|
||||||
remise real default 0,
|
remise real DEFAULT 0,
|
||||||
tva real default 0,
|
tva real DEFAULT 0,
|
||||||
total real default 0,
|
total real DEFAULT 0,
|
||||||
total_ht real default 0,
|
total_ht real DEFAULT 0,
|
||||||
total_tva real default 0,
|
total_tva real DEFAULT 0,
|
||||||
total_ttc real default 0,
|
total_ttc real DEFAULT 0,
|
||||||
|
|
||||||
fk_statut smallint default 0 NOT NULL,
|
fk_statut smallint DEFAULT 0 NOT NULL,
|
||||||
|
|
||||||
fk_user_author integer, -- createur de la facture
|
fk_user_author integer, -- createur de la facture
|
||||||
fk_user_valid integer, -- valideur de la facture
|
fk_user_valid integer, -- valideur de la facture
|
||||||
|
|||||||
@ -25,11 +25,11 @@ create table llx_facture_fourn_det
|
|||||||
fk_facture_fourn integer NOT NULL,
|
fk_facture_fourn integer NOT NULL,
|
||||||
fk_product integer NULL,
|
fk_product integer NULL,
|
||||||
description text,
|
description text,
|
||||||
pu_ht real default 0,
|
pu_ht real DEFAULT 0,
|
||||||
qty smallint default 1,
|
qty smallint DEFAULT 1,
|
||||||
total_ht real default 0,
|
total_ht real DEFAULT 0,
|
||||||
tva_taux real default 0,
|
tva_taux real DEFAULT 0,
|
||||||
tva real default 0,
|
tva real DEFAULT 0,
|
||||||
total_ttc real default 0
|
total_ttc real DEFAULT 0
|
||||||
|
|
||||||
)type=innodb;
|
)type=innodb;
|
||||||
|
|||||||
@ -26,12 +26,12 @@ create table llx_facture_rec
|
|||||||
fk_soc integer NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
datec datetime, -- date de creation
|
datec datetime, -- date de creation
|
||||||
|
|
||||||
amount real default 0 NOT NULL,
|
amount real DEFAULT 0 NOT NULL,
|
||||||
remise real default 0,
|
remise real DEFAULT 0,
|
||||||
remise_percent real default 0,
|
remise_percent real DEFAULT 0,
|
||||||
tva real default 0,
|
tva real DEFAULT 0,
|
||||||
total real default 0,
|
total real DEFAULT 0,
|
||||||
total_ttc real default 0,
|
total_ttc real DEFAULT 0,
|
||||||
|
|
||||||
fk_user_author integer, -- createur
|
fk_user_author integer, -- createur
|
||||||
fk_projet integer, -- projet auquel est associé la facture
|
fk_projet integer, -- projet auquel est associé la facture
|
||||||
|
|||||||
@ -24,12 +24,12 @@ create table llx_facturedet
|
|||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
fk_facture integer NOT NULL,
|
fk_facture integer NOT NULL,
|
||||||
fk_product integer NOT NULL default 0,
|
fk_product integer DEFAULT 0 NOT NULL,
|
||||||
description text,
|
description text,
|
||||||
tva_taux real default 19.6, -- taux tva
|
tva_taux real DEFAULT 19.6, -- taux tva
|
||||||
qty real, -- quantité
|
qty real, -- quantité
|
||||||
remise_percent real default 0, -- pourcentage de remise
|
remise_percent real DEFAULT 0, -- pourcentage de remise
|
||||||
remise real default 0, -- montant de la remise
|
remise real DEFAULT 0, -- montant de la remise
|
||||||
subprice real, -- prix avant remise
|
subprice real, -- prix avant remise
|
||||||
price real, -- prix final
|
price real, -- prix final
|
||||||
date_start datetime, -- date debut si service
|
date_start datetime, -- date debut si service
|
||||||
|
|||||||
@ -25,10 +25,10 @@ create table llx_facturedet_rec
|
|||||||
fk_facture integer NOT NULL,
|
fk_facture integer NOT NULL,
|
||||||
fk_product integer,
|
fk_product integer,
|
||||||
description text,
|
description text,
|
||||||
tva_taux real default 19.6, -- taux tva
|
tva_taux real DEFAULT 19.6, -- taux tva
|
||||||
qty real, -- quantité
|
qty real, -- quantité
|
||||||
remise_percent real default 0, -- pourcentage de remise
|
remise_percent real DEFAULT 0, -- pourcentage de remise
|
||||||
remise real default 0, -- montant de la remise
|
remise real DEFAULT 0, -- montant de la remise
|
||||||
subprice real, -- prix avant remise
|
subprice real, -- prix avant remise
|
||||||
price real -- prix final
|
price real -- prix final
|
||||||
)type=innodb;
|
)type=innodb;
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
--
|
--
|
||||||
-- $Id$
|
|
||||||
-- $Source$
|
|
||||||
--
|
|
||||||
-- This program is free software; you can redistribute it and/or modify
|
-- 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
|
-- it under the terms of the GNU General Public License as published by
|
||||||
-- the Free Software Foundation; either version 2 of the License, or
|
-- the Free Software Foundation; either version 2 of the License, or
|
||||||
@ -18,20 +15,23 @@
|
|||||||
-- along with this program; if not, write to the Free Software
|
-- along with this program; if not, write to the Free Software
|
||||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
--
|
--
|
||||||
|
-- $Id$
|
||||||
|
-- $Source$
|
||||||
|
--
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
|
|
||||||
create table llx_fichinter
|
create table llx_fichinter
|
||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
fk_soc integer NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
fk_projet integer default 0, -- projet auquel est rattache la fiche
|
fk_projet integer DEFAULT 0, -- projet auquel est rattache la fiche
|
||||||
ref varchar(30) NOT NULL, -- number
|
ref varchar(30) NOT NULL, -- number
|
||||||
datec datetime, -- date de creation
|
datec datetime, -- date de creation
|
||||||
date_valid datetime, -- date de validation
|
date_valid datetime, -- date de validation
|
||||||
datei date, -- date de l'intervention
|
datei date, -- date de l'intervention
|
||||||
fk_user_author integer, -- createur de la fiche
|
fk_user_author integer, -- createur de la fiche
|
||||||
fk_user_valid integer, -- valideur de la fiche
|
fk_user_valid integer, -- valideur de la fiche
|
||||||
fk_statut smallint default 0,
|
fk_statut smallint DEFAULT 0,
|
||||||
duree real,
|
duree real,
|
||||||
note text,
|
note text,
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@ create table llx_groupart
|
|||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
osc_id integer NOT NULL,
|
osc_id integer NOT NULL,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
nom varchar(64),
|
nom varchar(64),
|
||||||
groupart enum("artiste","groupe") NOT NULL,
|
groupart enum("artiste","groupe") NOT NULL,
|
||||||
description text NOT NULL,
|
description text NOT NULL,
|
||||||
fk_user_author integer
|
fk_user_author integer
|
||||||
|
|||||||
@ -28,7 +28,7 @@ create table llx_groupesociete
|
|||||||
datec datetime, -- creation date
|
datec datetime, -- creation date
|
||||||
nom varchar(60), -- company name
|
nom varchar(60), -- company name
|
||||||
note text, --
|
note text, --
|
||||||
remise real default 0, -- remise systématique pour le client
|
remise real DEFAULT 0, -- remise systématique pour le client
|
||||||
fk_user_author integer
|
fk_user_author integer
|
||||||
|
|
||||||
)type=innodb;
|
)type=innodb;
|
||||||
|
|||||||
@ -29,7 +29,7 @@ create table llx_groupesociete_remise
|
|||||||
tms timestamp,
|
tms timestamp,
|
||||||
datec datetime, -- creation date
|
datec datetime, -- creation date
|
||||||
fk_user_author integer, -- utilisateur qui a créé l'info
|
fk_user_author integer, -- utilisateur qui a créé l'info
|
||||||
remise real default 0, -- remise systématique pour le client
|
remise real DEFAULT 0, -- remise systématique pour le client
|
||||||
note text
|
note text
|
||||||
|
|
||||||
)type=innodb;
|
)type=innodb;
|
||||||
|
|||||||
@ -27,14 +27,14 @@ create table llx_livre
|
|||||||
tms timestamp,
|
tms timestamp,
|
||||||
status tinyint,
|
status tinyint,
|
||||||
date_ajout datetime,
|
date_ajout datetime,
|
||||||
ref varchar(12),
|
ref varchar(12),
|
||||||
title varchar(64),
|
title varchar(64),
|
||||||
annee smallint(64),
|
annee smallint(64),
|
||||||
description text,
|
description text,
|
||||||
prix decimal(15,4),
|
prix decimal(15,4),
|
||||||
fk_editeur integer,
|
fk_editeur integer,
|
||||||
fk_user_author integer,
|
fk_user_author integer,
|
||||||
frais_de_port tinyint default 1,
|
frais_de_port tinyint DEFAULT 1,
|
||||||
|
|
||||||
UNIQUE(ref)
|
UNIQUE(ref)
|
||||||
)type=innodb;
|
)type=innodb;
|
||||||
|
|||||||
@ -32,7 +32,7 @@ create table llx_newsletter
|
|||||||
email_body text,
|
email_body text,
|
||||||
target smallint,
|
target smallint,
|
||||||
sql_target text,
|
sql_target text,
|
||||||
status smallint NOT NULL DEFAULT 0,
|
status smallint DEFAULT 0 NOT NULL,
|
||||||
date_send_request datetime, -- debut de l'envoi demandé
|
date_send_request datetime, -- debut de l'envoi demandé
|
||||||
date_send_begin datetime, -- debut de l'envoi
|
date_send_begin datetime, -- debut de l'envoi
|
||||||
date_send_end datetime, -- fin de l'envoi
|
date_send_end datetime, -- fin de l'envoi
|
||||||
|
|||||||
@ -27,7 +27,7 @@ create table llx_paiement
|
|||||||
datec datetime, -- date de creation
|
datec datetime, -- date de creation
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
datep datetime, -- payment date
|
datep datetime, -- payment date
|
||||||
amount real default 0,
|
amount real DEFAULT 0,
|
||||||
author varchar(50),
|
author varchar(50),
|
||||||
fk_paiement integer NOT NULL,
|
fk_paiement integer NOT NULL,
|
||||||
num_paiement varchar(50),
|
num_paiement varchar(50),
|
||||||
|
|||||||
@ -24,7 +24,7 @@ create table llx_paiement_facture
|
|||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
fk_paiement integer,
|
fk_paiement integer,
|
||||||
fk_facture integer,
|
fk_facture integer,
|
||||||
amount real default 0,
|
amount real DEFAULT 0,
|
||||||
|
|
||||||
key (fk_paiement),
|
key (fk_paiement),
|
||||||
key (fk_facture)
|
key (fk_facture)
|
||||||
|
|||||||
@ -26,7 +26,7 @@ create table llx_paiementcharge
|
|||||||
datec datetime, -- date de creation
|
datec datetime, -- date de creation
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
datep datetime, -- payment date
|
datep datetime, -- payment date
|
||||||
amount real default 0,
|
amount real DEFAULT 0,
|
||||||
fk_typepaiement integer NOT NULL,
|
fk_typepaiement integer NOT NULL,
|
||||||
num_paiement varchar(50),
|
num_paiement varchar(50),
|
||||||
note text,
|
note text,
|
||||||
|
|||||||
@ -27,7 +27,7 @@ create table llx_paiementfourn
|
|||||||
datec datetime, -- date de creation de l'enregistrement
|
datec datetime, -- date de creation de l'enregistrement
|
||||||
fk_facture_fourn integer, -- facture
|
fk_facture_fourn integer, -- facture
|
||||||
datep datetime, -- date de paiement
|
datep datetime, -- date de paiement
|
||||||
amount real default 0, -- montant
|
amount real DEFAULT 0, -- montant
|
||||||
fk_user_author integer, -- auteur
|
fk_user_author integer, -- auteur
|
||||||
fk_paiement integer NOT NULL, -- moyen de paiement
|
fk_paiement integer NOT NULL, -- moyen de paiement
|
||||||
num_paiement varchar(50), -- numéro de paiement (cheque)
|
num_paiement varchar(50), -- numéro de paiement (cheque)
|
||||||
|
|||||||
@ -29,15 +29,15 @@ create table llx_product
|
|||||||
label varchar(255),
|
label varchar(255),
|
||||||
description text,
|
description text,
|
||||||
price double,
|
price double,
|
||||||
tva_tx double default 19.6,
|
tva_tx double DEFAULT 19.6,
|
||||||
fk_user_author integer,
|
fk_user_author integer,
|
||||||
envente tinyint default 1,
|
envente tinyint DEFAULT 1,
|
||||||
nbvente integer default 0,
|
nbvente integer DEFAULT 0,
|
||||||
fk_product_type integer default 0,
|
fk_product_type integer DEFAULT 0,
|
||||||
duration varchar(6),
|
duration varchar(6),
|
||||||
stock_propale integer default 0,
|
stock_propale integer DEFAULT 0,
|
||||||
stock_commande integer default 0,
|
stock_commande integer DEFAULT 0,
|
||||||
seuil_stock_alerte integer default 0
|
seuil_stock_alerte integer DEFAULT 0
|
||||||
|
|
||||||
)type=innodb;
|
)type=innodb;
|
||||||
|
|
||||||
|
|||||||
@ -27,8 +27,8 @@ create table llx_product_price
|
|||||||
fk_product integer NOT NULL,
|
fk_product integer NOT NULL,
|
||||||
date_price datetime NOT NULL,
|
date_price datetime NOT NULL,
|
||||||
price double,
|
price double,
|
||||||
tva_tx double default 19.6,
|
tva_tx double DEFAULT 19.6,
|
||||||
fk_user_author integer,
|
fk_user_author integer,
|
||||||
envente tinyint default 1
|
envente tinyint DEFAULT 1
|
||||||
)type=innodb;
|
)type=innodb;
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ create table llx_product_stock
|
|||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_product integer NOT NULL,
|
fk_product integer NOT NULL,
|
||||||
fk_entrepot integer NOT NULL,
|
fk_entrepot integer NOT NULL,
|
||||||
reel integer, -- stock réel
|
reel integer, -- stock réel
|
||||||
|
|
||||||
key(fk_product),
|
key(fk_product),
|
||||||
key(fk_entrepot)
|
key(fk_entrepot)
|
||||||
|
|||||||
@ -26,11 +26,11 @@ create table llx_projet
|
|||||||
fk_soc integer NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
fk_statut smallint NOT NULL,
|
fk_statut smallint NOT NULL,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
dateo date, -- date d'ouverture du projet
|
dateo date, -- date d'ouverture du projet
|
||||||
ref varchar(50),
|
ref varchar(50),
|
||||||
title varchar(255),
|
title varchar(255),
|
||||||
fk_user_resp integer, -- responsable du projet
|
fk_user_resp integer, -- responsable du projet
|
||||||
fk_user_creat integer, -- createur du projet
|
fk_user_creat integer, -- createur du projet
|
||||||
note text,
|
note text,
|
||||||
|
|
||||||
UNIQUE INDEX(ref)
|
UNIQUE INDEX(ref)
|
||||||
|
|||||||
@ -25,10 +25,10 @@ create table llx_propaldet
|
|||||||
fk_propal integer,
|
fk_propal integer,
|
||||||
fk_product integer,
|
fk_product integer,
|
||||||
description text,
|
description text,
|
||||||
tva_tx real default 19.6, -- taux tva
|
tva_tx real DEFAULT 19.6, -- taux tva
|
||||||
qty real, -- quantité
|
qty real, -- quantité
|
||||||
remise_percent real default 0, -- pourcentage de remise
|
remise_percent real DEFAULT 0, -- pourcentage de remise
|
||||||
remise real default 0, -- montant de la remise
|
remise real DEFAULT 0, -- montant de la remise
|
||||||
subprice real, -- prix avant remise
|
subprice real, -- prix avant remise
|
||||||
price real -- prix final
|
price real -- prix final
|
||||||
)type=innodb;
|
)type=innodb;
|
||||||
|
|||||||
@ -24,27 +24,27 @@
|
|||||||
|
|
||||||
create table llx_facture
|
create table llx_facture
|
||||||
(
|
(
|
||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
facnumber varchar(50) NOT NULL,
|
facnumber varchar(50) NOT NULL,
|
||||||
fk_soc integer NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
datec timestamp, -- date de creation de la facture
|
datec timestamp without time zone, -- date de creation de la facture
|
||||||
datef date, -- date de la facture
|
datef date, -- date de la facture
|
||||||
paye smallint default 0 NOT NULL,
|
paye smallint DEFAULT 0 NOT NULL,
|
||||||
amount real default 0 NOT NULL,
|
amount real DEFAULT 0 NOT NULL,
|
||||||
remise real default 0,
|
remise real DEFAULT 0,
|
||||||
remise_percent real default 0,
|
remise_percent real DEFAULT 0,
|
||||||
tva real default 0,
|
tva real DEFAULT 0,
|
||||||
total real default 0,
|
total real DEFAULT 0,
|
||||||
total_ttc real default 0,
|
total_ttc real DEFAULT 0,
|
||||||
fk_statut smallint default 0 NOT NULL,
|
fk_statut smallint DEFAULT 0 NOT NULL,
|
||||||
author varchar(50),
|
author varchar(50),
|
||||||
fk_user integer, -- createur de la facture
|
fk_user integer, -- createur de la facture
|
||||||
fk_user_author integer, -- createur de la propale
|
fk_user_author integer, -- createur de la propale
|
||||||
fk_user_valid integer, -- valideur de la propale
|
fk_user_valid integer, -- valideur de la propale
|
||||||
fk_projet integer, -- projet auquel est associé la facture
|
fk_projet integer, -- projet auquel est associé la facture
|
||||||
fk_cond_reglement integer, -- condition de reglement
|
fk_cond_reglement integer, -- condition de reglement
|
||||||
date_lim_reglement date, -- date limite de reglement
|
date_lim_reglement date, -- date limite de reglement
|
||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|
||||||
create unique index llx_facture_facnumber on llx_facture(facnumber);
|
create unique index llx_facture_facnumber on llx_facture(facnumber);
|
||||||
|
|||||||
@ -27,19 +27,21 @@ create table llx_facture_fourn
|
|||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
facnumber varchar(50) NOT NULL,
|
facnumber varchar(50) NOT NULL,
|
||||||
fk_soc integer NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
datec timestamp, -- date de creation de la facture
|
datec timestamp without time zone, -- date de creation de la facture
|
||||||
datef date, -- date de la facture
|
datef date, -- date de la facture
|
||||||
libelle varchar(255),
|
libelle varchar(255),
|
||||||
paye smallint default 0 NOT NULL,
|
paye smallint DEFAULT 0 NOT NULL,
|
||||||
amount real default 0 NOT NULL,
|
amount real DEFAULT 0 NOT NULL,
|
||||||
remise real default 0,
|
remise real DEFAULT 0,
|
||||||
tva real default 0,
|
tva real DEFAULT 0,
|
||||||
total real default 0,
|
total real DEFAULT 0,
|
||||||
total_ht real default 0,
|
total_ht real DEFAULT 0,
|
||||||
total_tva real default 0,
|
total_tva real DEFAULT 0,
|
||||||
total_ttc real default 0,
|
total_ttc real DEFAULT 0,
|
||||||
fk_statut smallint default 0 NOT NULL,
|
|
||||||
fk_user_author integer, -- createur de la propale
|
fk_statut smallint DEFAULT 0 NOT NULL,
|
||||||
|
|
||||||
|
fk_user_author integer, -- createur de la propale
|
||||||
fk_user_valid integer, -- valideur de la propale
|
fk_user_valid integer, -- valideur de la propale
|
||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|||||||
@ -27,10 +27,10 @@ create table llx_facture_fourn_det
|
|||||||
fk_facture_fourn integer NOT NULL,
|
fk_facture_fourn integer NOT NULL,
|
||||||
fk_product integer NULL,
|
fk_product integer NULL,
|
||||||
description text,
|
description text,
|
||||||
pu_ht real default 0,
|
pu_ht real DEFAULT 0,
|
||||||
qty smallint default 1,
|
qty smallint DEFAULT 1,
|
||||||
total_ht real default 0,
|
total_ht real DEFAULT 0,
|
||||||
tva_taux real default 0,
|
tva_taux real DEFAULT 0,
|
||||||
tva real default 0,
|
tva real DEFAULT 0,
|
||||||
total_ttc real default 0
|
total_ttc real DEFAULT 0
|
||||||
);
|
);
|
||||||
|
|||||||
@ -23,19 +23,22 @@
|
|||||||
|
|
||||||
create table llx_facture_rec
|
create table llx_facture_rec
|
||||||
(
|
(
|
||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
titre varchar(50) NOT NULL,
|
titre varchar(50) NOT NULL,
|
||||||
fk_soc integer NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
datec timestamp, -- date de creation
|
datec timestamp without time zone, -- date de creation
|
||||||
amount real default 0 NOT NULL,
|
|
||||||
remise real default 0,
|
amount real DEFAULT 0 NOT NULL,
|
||||||
remise_percent real default 0,
|
remise real DEFAULT 0,
|
||||||
tva real default 0,
|
remise_percent real DEFAULT 0,
|
||||||
total real default 0,
|
tva real DEFAULT 0,
|
||||||
total_ttc real default 0,
|
total real DEFAULT 0,
|
||||||
|
total_ttc real DEFAULT 0,
|
||||||
|
|
||||||
fk_user_author integer, -- createur
|
fk_user_author integer, -- createur
|
||||||
fk_projet integer, -- projet auquel est associé la facture
|
fk_projet integer, -- projet auquel est associé la facture
|
||||||
fk_cond_reglement integer, -- condition de reglement
|
fk_cond_reglement integer, -- condition de reglement
|
||||||
|
|
||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -26,16 +26,16 @@ create table llx_facturedet
|
|||||||
(
|
(
|
||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
fk_facture integer NOT NULL,
|
fk_facture integer NOT NULL,
|
||||||
fk_product integer NOT NULL DEFAULT 0,
|
fk_product integer DEFAULT 0 NOT NULL,
|
||||||
description text,
|
description text,
|
||||||
tva_taux real default 19.6, -- taux tva
|
tva_taux real DEFAULT 19.6, -- taux tva
|
||||||
qty real, -- quantité
|
qty real, -- quantité
|
||||||
remise_percent real default 0, -- pourcentage de remise
|
remise_percent real DEFAULT 0, -- pourcentage de remise
|
||||||
remise real default 0, -- montant de la remise
|
remise real DEFAULT 0, -- montant de la remise
|
||||||
subprice real, -- prix avant remise
|
subprice real, -- prix avant remise
|
||||||
price real, -- prix final
|
price real, -- prix final
|
||||||
date_start timestamp, -- date debut si service
|
date_start timestamp without time zone, -- date debut si service
|
||||||
date_end timestamp -- date fin si service
|
date_end timestamp without time zone -- date fin si service
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE INDEX llx_facturedet_fk_facture ON llx_facturedet (fk_facture);
|
CREATE INDEX llx_facturedet_fk_facture ON llx_facturedet (fk_facture);
|
||||||
|
|||||||
@ -27,10 +27,10 @@ create table llx_facturedet_rec
|
|||||||
fk_facture integer NOT NULL,
|
fk_facture integer NOT NULL,
|
||||||
fk_product integer,
|
fk_product integer,
|
||||||
description text,
|
description text,
|
||||||
tva_taux real default 19.6, -- taux tva
|
tva_taux real DEFAULT 19.6, -- taux tva
|
||||||
qty real, -- quantité
|
qty real, -- quantité
|
||||||
remise_percent real default 0, -- pourcentage de remise
|
remise_percent real DEFAULT 0, -- pourcentage de remise
|
||||||
remise real default 0, -- montant de la remise
|
remise real DEFAULT 0, -- montant de la remise
|
||||||
subprice real, -- prix avant remise
|
subprice real, -- prix avant remise
|
||||||
price real -- prix final
|
price real -- prix final
|
||||||
);
|
);
|
||||||
|
|||||||
@ -26,14 +26,14 @@ create table llx_fichinter
|
|||||||
(
|
(
|
||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
fk_soc integer NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
fk_projet integer default 0, -- projet auquel est rattache la fiche
|
fk_projet integer DEFAULT 0, -- projet auquel est rattache la fiche
|
||||||
ref varchar(30) NOT NULL, -- number
|
ref varchar(30) NOT NULL, -- number
|
||||||
datec timestamp, -- date de creation
|
datec timestamp without time zone, -- date de creation
|
||||||
date_valid timestamp, -- date de validation
|
date_valid timestamp without time zone, -- date de validation
|
||||||
datei date, -- date de l'intervention
|
datei date, -- date de l'intervention
|
||||||
fk_user_author integer, -- createur de la fiche
|
fk_user_author integer, -- createur de la fiche
|
||||||
fk_user_valid integer, -- valideur de la fiche
|
fk_user_valid integer, -- valideur de la fiche
|
||||||
fk_statut smallint default 0,
|
fk_statut smallint DEFAULT 0,
|
||||||
duree real,
|
duree real,
|
||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|||||||
@ -26,8 +26,8 @@ create table llx_groupart
|
|||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
osc_id integer NOT NULL,
|
osc_id integer NOT NULL,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
nom varchar(64),
|
nom varchar(64),
|
||||||
groupart CHAR(8) CHECK (groupart IN ('artiste','groupe')) NOT NULL,
|
groupart CHAR(8) CHECK (groupart IN ('artiste','groupe')) NOT NULL,
|
||||||
description text NOT NULL,
|
description text NOT NULL,
|
||||||
fk_user_author integer
|
fk_user_author integer
|
||||||
);
|
);
|
||||||
|
|||||||
@ -26,10 +26,10 @@ create table llx_groupesociete
|
|||||||
rowid serial PRIMARY KEY,
|
rowid serial PRIMARY KEY,
|
||||||
parent integer UNIQUE,
|
parent integer UNIQUE,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
datec timestamp, -- creation date
|
datec timestamp without time zone, -- creation date
|
||||||
nom varchar(60), -- company name
|
nom varchar(60), -- company name
|
||||||
note text, --
|
note text, --
|
||||||
remise real default 0, -- remise systématique pour le client
|
remise real DEFAULT 0, -- remise systématique pour le client
|
||||||
fk_user_author integer
|
fk_user_author integer
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|||||||
@ -28,9 +28,9 @@ create table llx_groupesociete_remise
|
|||||||
rowid serial PRIMARY KEY,
|
rowid serial PRIMARY KEY,
|
||||||
fk_groupe integer NOT NULL,
|
fk_groupe integer NOT NULL,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
datec timestamp, -- creation date
|
datec timestamp without time zone, -- creation date
|
||||||
fk_user_author integer, -- utilisateur qui a créé l'info
|
fk_user_author integer, -- utilisateur qui a créé l'info
|
||||||
remise real default 0, -- remise systématique pour le client
|
remise real DEFAULT 0, -- remise systématique pour le client
|
||||||
note text
|
note text
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|||||||
@ -27,15 +27,15 @@ create table llx_livre
|
|||||||
oscid integer NOT NULL,
|
oscid integer NOT NULL,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
status smallint,
|
status smallint,
|
||||||
date_ajout timestamp,
|
date_ajout timestamp without time zone,
|
||||||
ref varchar(12),
|
ref varchar(12),
|
||||||
title varchar(64),
|
title varchar(64),
|
||||||
annee smallint,
|
annee smallint,
|
||||||
description text,
|
description text,
|
||||||
prix decimal(15,4),
|
prix decimal(15,4),
|
||||||
fk_editeur integer,
|
fk_editeur integer,
|
||||||
fk_user_author integer,
|
fk_user_author integer,
|
||||||
frais_de_port smallint default 1,
|
frais_de_port smallint DEFAULT 1,
|
||||||
|
|
||||||
UNIQUE(ref)
|
UNIQUE(ref)
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
create table llx_newsletter
|
create table llx_newsletter
|
||||||
(
|
(
|
||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
datec timestamp,
|
datec timestamp without time zone,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
email_subject varchar(32) NOT NULL,
|
email_subject varchar(32) NOT NULL,
|
||||||
email_from_name varchar(255) NOT NULL,
|
email_from_name varchar(255) NOT NULL,
|
||||||
@ -33,12 +33,12 @@ create table llx_newsletter
|
|||||||
email_body text,
|
email_body text,
|
||||||
target smallint,
|
target smallint,
|
||||||
sql_target text,
|
sql_target text,
|
||||||
status smallint NOT NULL DEFAULT 0,
|
status smallint DEFAULT 0 NOT NULL,
|
||||||
date_send_request timestamp, -- debut de l'envoi demandé
|
date_send_request timestamp without time zone, -- debut de l'envoi demandé
|
||||||
date_send_begin timestamp, -- debut de l'envoi
|
date_send_begin timestamp without time zone, -- debut de l'envoi
|
||||||
date_send_end timestamp, -- fin de l'envoi
|
date_send_end timestamp without time zone, -- fin de l'envoi
|
||||||
nbsent integer, -- nombre de mails envoyés
|
nbsent integer, -- nombre de mails envoyés
|
||||||
nberror integer, -- nombre de mails envoyés
|
nberror integer, -- nombre de mails envoyés
|
||||||
fk_user_author integer,
|
fk_user_author integer,
|
||||||
fk_user_valid integer,
|
fk_user_valid integer,
|
||||||
fk_user_modif integer
|
fk_user_modif integer
|
||||||
|
|||||||
@ -25,9 +25,9 @@ create table llx_notify
|
|||||||
(
|
(
|
||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
daten timestamp, -- date de la notification
|
daten timestamp without time zone, -- date de la notification
|
||||||
fk_action integer NOT NULL,
|
fk_action integer NOT NULL,
|
||||||
fk_contact integer NOT NULL,
|
fk_contact integer NOT NULL,
|
||||||
objet_type CHAR(10) CHECK (objet_type IN ('ficheinter','facture','propale')),
|
objet_type CHAR(10) CHECK (objet_type IN ('ficheinter','facture','propale')),
|
||||||
objet_id integer NOT NULL
|
objet_id integer NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@ -24,15 +24,15 @@ create table llx_paiement
|
|||||||
(
|
(
|
||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
fk_facture integer,
|
fk_facture integer,
|
||||||
datec timestamp,
|
datec timestamp without time zone, -- date de creation
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
datep timestamp, -- payment date
|
datep timestamp without time zone, -- payment date
|
||||||
amount real default 0,
|
amount real DEFAULT 0,
|
||||||
author varchar(50),
|
author varchar(50),
|
||||||
fk_paiement integer NOT NULL,
|
fk_paiement integer NOT NULL,
|
||||||
num_paiement varchar(50),
|
num_paiement varchar(50),
|
||||||
note text,
|
note text,
|
||||||
fk_bank integer NOT NULL,
|
fk_bank integer NOT NULL,
|
||||||
fk_user_creat integer, -- 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
|
||||||
);
|
);
|
||||||
|
|||||||
@ -26,7 +26,7 @@ create table llx_paiement_facture
|
|||||||
rowid serial PRIMARY KEY,
|
rowid serial PRIMARY KEY,
|
||||||
fk_paiement integer,
|
fk_paiement integer,
|
||||||
fk_facture integer,
|
fk_facture integer,
|
||||||
amount real default 0
|
amount real DEFAULT 0
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE INDEX llx_paiement_facture_fk_paiement ON llx_paiement_facture(fk_paiement);
|
CREATE INDEX llx_paiement_facture_fk_paiement ON llx_paiement_facture(fk_paiement);
|
||||||
|
|||||||
@ -25,10 +25,10 @@ create table llx_paiementcharge
|
|||||||
(
|
(
|
||||||
rowid serial PRIMARY KEY,
|
rowid serial PRIMARY KEY,
|
||||||
fk_charge integer,
|
fk_charge integer,
|
||||||
datec timestamp, -- date de creation
|
datec timestamp without time zone, -- date de creation
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
datep timestamp, -- payment date
|
datep timestamp without time zone, -- payment date
|
||||||
amount real default 0,
|
amount real DEFAULT 0,
|
||||||
fk_typepaiement integer NOT NULL,
|
fk_typepaiement integer NOT NULL,
|
||||||
num_paiement varchar(50),
|
num_paiement varchar(50),
|
||||||
note text,
|
note text,
|
||||||
|
|||||||
@ -25,13 +25,13 @@ create table llx_paiementfourn
|
|||||||
(
|
(
|
||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
datec timestamp, -- date de creation de l'enregistrement
|
datec timestamp without time zone, -- date de creation de l'enregistrement
|
||||||
fk_facture_fourn integer, -- facture
|
fk_facture_fourn integer, -- facture
|
||||||
datep timestamp, -- date de paiement
|
datep timestamp without time zone, -- date de paiement
|
||||||
amount real default 0, -- montant
|
amount real DEFAULT 0, -- montant
|
||||||
fk_user_author integer, -- auteur
|
fk_user_author integer, -- auteur
|
||||||
fk_paiement integer NOT NULL, -- moyen de paiement
|
fk_paiement integer NOT NULL, -- moyen de paiement
|
||||||
num_paiement varchar(50), -- numéro de paiement (cheque)
|
num_paiement varchar(50), -- numéro de paiement (cheque)
|
||||||
note text,
|
note text,
|
||||||
fk_bank integer NOT NULL
|
fk_bank integer NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
create table llx_pointmort
|
create table llx_pointmort
|
||||||
(
|
(
|
||||||
month timestamp,
|
month timestamp without time zone,
|
||||||
amount real
|
amount real
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -23,20 +23,20 @@
|
|||||||
|
|
||||||
create table llx_product
|
create table llx_product
|
||||||
(
|
(
|
||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
datec timestamp,
|
datec timestamp without time zone,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
ref varchar(15),
|
ref varchar(15) UNIQUE,
|
||||||
label varchar(255),
|
label varchar(255),
|
||||||
description text,
|
description text,
|
||||||
price double precision,
|
price double precision,
|
||||||
tva_tx double precision default 19.6,
|
tva_tx double precision DEFAULT 19.6,
|
||||||
fk_user_author integer,
|
fk_user_author integer,
|
||||||
envente smallint default 1,
|
envente smallint DEFAULT 1,
|
||||||
nbvente integer default 0,
|
nbvente integer DEFAULT 0,
|
||||||
fk_product_type integer default 0,
|
fk_product_type integer DEFAULT 0,
|
||||||
duration varchar(6),
|
duration varchar(6),
|
||||||
stock_propale integer default 0,
|
stock_propale integer DEFAULT 0,
|
||||||
stock_commande integer default 0,
|
stock_commande integer DEFAULT 0,
|
||||||
seuil_stock_alerte integer default 0
|
seuil_stock_alerte integer DEFAULT 0
|
||||||
);
|
);
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
create table llx_product_fournisseur
|
create table llx_product_fournisseur
|
||||||
(
|
(
|
||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
datec timestamp,
|
datec timestamp without time zone,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_product integer,
|
fk_product integer,
|
||||||
fk_soc integer,
|
fk_soc integer,
|
||||||
|
|||||||
@ -26,10 +26,10 @@ create table llx_product_price
|
|||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_product integer NOT NULL,
|
fk_product integer NOT NULL,
|
||||||
date_price timestamp NOT NULL,
|
date_price timestamp without time zone NOT NULL,
|
||||||
price double precision,
|
price double precision,
|
||||||
tva_tx double precision default 19.6,
|
tva_tx double precision DEFAULT 19.6,
|
||||||
fk_user_author integer,
|
fk_user_author integer,
|
||||||
envente smallint default 1
|
envente smallint DEFAULT 1
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ create table llx_product_stock
|
|||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_product integer NOT NULL,
|
fk_product integer NOT NULL,
|
||||||
fk_stock integer NOT NULL,
|
fk_stock integer NOT NULL,
|
||||||
reel integer
|
reel integer --stock réel
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE INDEX llx_product_stock_fk_product ON llx_product_stock (fk_product);
|
CREATE INDEX llx_product_stock_fk_product ON llx_product_stock (fk_product);
|
||||||
|
|||||||
@ -28,11 +28,11 @@ create table llx_projet
|
|||||||
fk_soc integer NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
fk_statut smallint NOT NULL,
|
fk_statut smallint NOT NULL,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
dateo date, -- date d'ouverture du projet
|
dateo date, -- date d'ouverture du projet
|
||||||
ref varchar(50),
|
ref varchar(50),
|
||||||
title varchar(255),
|
title varchar(255),
|
||||||
fk_user_resp integer, -- responsable du projet
|
fk_user_resp integer, -- responsable du projet
|
||||||
fk_user_creat integer, -- createur du projet
|
fk_user_creat integer, -- createur du projet
|
||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -24,14 +24,14 @@
|
|||||||
|
|
||||||
create table llx_propaldet
|
create table llx_propaldet
|
||||||
(
|
(
|
||||||
rowid SERIAL PRIMARY KEY,
|
rowid SERIAL PRIMARY KEY,
|
||||||
fk_propal integer,
|
fk_propal integer,
|
||||||
fk_product integer,
|
fk_product integer,
|
||||||
description text,
|
description text,
|
||||||
tva_tx real default 19.6, -- taux tva
|
tva_tx real DEFAULT 19.6, -- taux tva
|
||||||
qty real, -- quantité
|
qty real, -- quantité
|
||||||
remise_percent real default 0, -- pourcentage de remise
|
remise_percent real DEFAULT 0, -- pourcentage de remise
|
||||||
remise real default 0, -- montant de la remise
|
remise real DEFAULT 0, -- montant de la remise
|
||||||
subprice real, -- prix avant remise
|
subprice real, -- prix avant remise
|
||||||
price real -- prix final
|
price real -- prix final
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user