Skip to content
Snippets Groups Projects
Commit 2b31e132 authored by Regis Houssin's avatar Regis Houssin
Browse files

Début implémentation base MSSQL - merci à Simon

parent 280c1321
No related branches found
No related tags found
No related merge requests found
Showing
with 60 additions and 52 deletions
......@@ -28,5 +28,5 @@ create table llx_bank_url
url_id integer,
url varchar(255),
label varchar(255),
type varchar(16) NOT NULL check (type in ('company','payment','payment_supplier','member','subscription','donation','sc','payment_sc'))
type varchar(16) NOT NULL check (type in ('?','company','payment','payment_supplier','member','subscription','donation','sc','payment_sc'))
);
......@@ -30,6 +30,6 @@ create table llx_boxes
rowid integer IDENTITY PRIMARY KEY,
box_id integer NOT NULL,
position smallint NOT NULL,
box_order smallint default 0 NOT NULL,
box_order varchar(3) NOT NULL,
fk_user integer default 0 NOT NULL
);
......@@ -42,9 +42,9 @@ create table llx_commande
remise_percent real default 0,
remise_absolue real default 0,
remise real default 0,
tva real default 0,
total_ht real default 0,
total_ttc real default 0,
tva float default 0,
total_ht float default 0,
total_ttc float default 0,
note text,
note_public text,
model_pdf varchar(50),
......
......@@ -26,4 +26,6 @@
CREATE INDEX idx_commande_fournisseur_fk_soc ON llx_commande_fournisseur(fk_soc);
ALTER TABLE llx_commande_fournisseur ADD CONSTRAINT fk_commande_fournisseur_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
ALTER TABLE llx_commande_fournisseur ADD CONSTRAINT fk_commande_fournisseur_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
CREATE UNIQUE INDEX uk_commande_fournisseur_ref ON llx_commande_fournisseur(ref, fk_soc);
......@@ -40,9 +40,9 @@ create table llx_commande_fournisseur
amount_ht real default 0,
remise_percent real default 0,
remise real default 0,
tva real default 0,
total_ht real default 0,
total_ttc real default 0,
tva float default 0,
total_ht float default 0,
total_ttc float default 0,
note text,
note_public text,
model_pdf varchar(50),
......
......@@ -31,13 +31,14 @@ create table llx_commandedet
remise_percent real DEFAULT 0, -- pourcentage de remise
remise real DEFAULT 0, -- montant de la remise
fk_remise_except integer NULL, -- Lien vers table des remises fixes
subprice real, -- prix avant remise
price real, -- prix final
total_ht real, -- Total HT de la ligne toute quantit et incluant remise ligne et globale
total_tva real, -- Total TVA de la ligne toute quantit et incluant remise ligne et globale
total_ttc real, -- Total TTC de la ligne toute quantit et incluant remise ligne et globale
subprice float, -- prix avant remise
total_ht float, -- Total HT de la ligne toute quantit et incluant remise ligne et globale
total_tva float, -- Total TVA de la ligne toute quantit et incluant remise ligne et globale
total_ttc float, -- Total TTC de la ligne toute quantit et incluant remise ligne et globale
info_bits integer DEFAULT 0, -- TVA NPR ou non
coef real, -- coefficient de marge
marge_tx real, -- taux de marge (marge sur prix d'achat)
marque_tx real, -- taux de marque (marge sur prix de vente)
special_code tinyint DEFAULT 0, -- code pour les lignes speciales
rang integer DEFAULT 0
);
......
......@@ -32,6 +32,7 @@ create table llx_contratdet
label text, -- libell du produit
description text,
fk_remise_except integer NULL, -- Lien vers table des remises fixes
date_commande datetime,
date_ouverture_prevue datetime,
......@@ -39,16 +40,15 @@ create table llx_contratdet
date_fin_validite datetime,
date_cloture datetime,
tva_tx real DEFAULT 19.6, -- taux tva
tva_tx float DEFAULT 19.6, -- taux tva
qty real, -- quantit
remise_percent real DEFAULT 0, -- pourcentage de remise
remise real DEFAULT 0, -- montant de la remise
fk_remise_except integer NULL, -- Lien vers table des remises fixes
subprice real, -- prix avant remise
subprice float, -- prix avant remise
price_ht real, -- prix final
total_ht real, -- Total HT de la ligne toute quantit et incluant remise ligne et globale
total_tva real, -- Total TVA de la ligne toute quantit et incluant remise ligne et globale
total_ttc real, -- Total TTC de la ligne toute quantit et incluant remise ligne et globale
remise real DEFAULT 0, -- montant de la remise
total_ht float, -- Total HT de la ligne toute quantit et incluant remise ligne et globale
total_tva float, -- Total TVA de la ligne toute quantit et incluant remise ligne et globale
total_ttc float, -- Total TTC de la ligne toute quantit et incluant remise ligne et globale
info_bits integer DEFAULT 0, -- TVA NPR ou non
fk_user_author integer NOT NULL default 0,
......
......@@ -30,13 +30,13 @@ create table llx_facture_fourn
datef SMALLDATETIME, -- SMALLDATETIME de la facture
libelle varchar(255),
paye smallint DEFAULT 0 NOT NULL,
amount real DEFAULT 0 NOT NULL,
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,
amount float DEFAULT 0 NOT NULL,
remise float DEFAULT 0,
tva float DEFAULT 0,
total float DEFAULT 0,
total_ht float DEFAULT 0,
total_tva float DEFAULT 0,
total_ttc float DEFAULT 0,
fk_statut smallint DEFAULT 0 NOT NULL,
......
......@@ -32,7 +32,6 @@ create table llx_paiement
tms timestamp,
datep datetime, -- payment SMALLDATETIME
amount real DEFAULT 0,
author varchar(50),
fk_paiement integer NOT NULL,
num_paiement varchar(50),
note text,
......
......@@ -29,10 +29,10 @@ create table llx_product
label varchar(255) NOT NULL,
description text,
note text,
price FLOAT(25),
price_ttc float(12) DEFAULT 0,
price FLOAT,
price_ttc float DEFAULT 0,
price_base_type varchar(3) DEFAULT 'HT',
tva_tx FLOAT(25),
tva_tx FLOAT,
fk_user_author integer,
envente tinyint DEFAULT 1,
nbvente integer DEFAULT 0,
......@@ -45,5 +45,7 @@ create table llx_product
gencode varchar(255) DEFAULT NULL,
weight float DEFAULT NULL,
weight_units tinyint DEFAULT NULL,
volume float DEFAULT NULL,
volume_units tinyint DEFAULT NULL,
canvas varchar(15) DEFAULT ''
);
......@@ -27,8 +27,10 @@ create table llx_product_fournisseur_price
tms timestamp,
fk_product integer,
fk_soc integer, -- lien sur llx_societe
price real,
quantity real,
ref_fourn varchar(30),
price float,
quantity float,
unitprice float,
fk_user integer
);
......@@ -27,10 +27,10 @@ create table llx_product_price
fk_product integer NOT NULL,
date_price datetime NOT NULL,
price_level tinyint NULL DEFAULT 1,
price FLOAT(25),
price_ttc float(12) DEFAULT 0,
price FLOAT,
price_ttc float DEFAULT 0,
price_base_type varchar(3) DEFAULT 'HT',
tva_tx FLOAT(25) NOT NULL,
tva_tx FLOAT NOT NULL,
fk_user_author integer,
envente tinyint DEFAULT 1
);
......
......@@ -41,9 +41,9 @@ create table llx_propal
remise_percent real DEFAULT 0, -- remise globale relative en pourcent
remise_absolue real DEFAULT 0, -- remise globale absolue
remise real DEFAULT 0, -- remise calculee
tva real DEFAULT 0, -- montant tva apres remise globale
total_ht real DEFAULT 0, -- montant total ht apres remise globale
total real DEFAULT 0, -- montant total ttc apres remise globale
tva float DEFAULT 0, -- montant tva apres remise globale
total_ht float DEFAULT 0, -- montant total ht apres remise globale
total float DEFAULT 0, -- montant total ttc apres remise globale
fk_cond_reglement integer, -- condition de reglement (30 jours, fin de mois ...)
fk_mode_reglement integer, -- mode de reglement (Virement, Prlvement)
......
......@@ -25,17 +25,18 @@ create table llx_propaldet
fk_propal integer,
fk_product integer,
description text,
fk_remise_except integer NULL, -- Lien vers table des remises fixes
tva_tx real, -- taux tva
qty real, -- quantité
remise_percent real DEFAULT 0, -- pourcentage de remise
remise real DEFAULT 0, -- montant de la remise
fk_remise_except integer NULL, -- Lien vers table des remises fixes
subprice real, -- prix avant remise
price real, -- prix final
total_ht real, -- Total HT de la ligne toute quantité et incluant remise ligne et globale
total_tva real, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale
total_ttc real, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale
subprice float, -- prix avant remise
total_ht float, -- Total HT de la ligne toute quantité et incluant remise ligne et globale
total_tva float, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale
total_ttc float, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale
info_bits integer DEFAULT 0, -- TVA NPR ou non
coef real, -- coefficient de marge
marge_tx real, -- taux de marge (marge sur prix d'achat)
marque_tx real, -- taux de marque (marge sur prix de vente)
rang integer DEFAULT 0
);
......@@ -27,10 +27,10 @@ create table llx_societe_remise_except
rowid integer IDENTITY PRIMARY KEY,
fk_soc integer NOT NULL, -- client
datec datetime,
amount_ht real NOT NULL,
amount_tva real DEFAULT 0 NOT NULL,
amount_ttc real DEFAULT 0 NOT NULL,
tva_tx real DEFAULT 0 NOT NULL,
amount_ht float NOT NULL,
amount_tva float DEFAULT 0 NOT NULL,
amount_ttc float DEFAULT 0 NOT NULL,
tva_tx float DEFAULT 0 NOT NULL,
fk_user integer NOT NULL,
fk_facture integer,
fk_facture_source integer,
......
......@@ -22,7 +22,7 @@
create table llx_socpeople
(
idp integer IDENTITY PRIMARY KEY,
rowid integer IDENTITY PRIMARY KEY,
datec datetime,
tms timestamp,
fk_soc integer, -- lien vers la societe
......@@ -41,7 +41,7 @@ create table llx_socpeople
fax varchar(30),
email varchar(255),
jabberid varchar(255),
fk_user integer DEFAULT 0, -- user qui a cr l'enregistrement
fk_user_creat integer DEFAULT 0, -- user qui a cr l'enregistrement
fk_user_modif integer,
note text
);
......@@ -30,6 +30,7 @@ create table llx_user
login varchar(24) NOT NULL,
pass varchar(32),
pass_crypted varchar(128),
pass_temp varchar(32), -- temporary password when asked for forget password
name varchar(50),
firstname varchar(50),
office_phone varchar(20),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment