Début implémentation base MSSQL - merci à Simon
This commit is contained in:
parent
2b1dc9fb30
commit
d6d7d2e984
@ -78,9 +78,13 @@ if (isset($_POST["db_create_user"]) && $_POST["db_create_user"] == "on")
|
|||||||
if ($_POST["db_type"] == 'mysql' ||$_POST["db_type"] == 'mysqli')
|
if ($_POST["db_type"] == 'mysql' ||$_POST["db_type"] == 'mysqli')
|
||||||
{
|
{
|
||||||
$databasefortest='mysql';
|
$databasefortest='mysql';
|
||||||
}else{
|
}elseif ($_POST["db_type"] == 'pgsql')
|
||||||
|
{
|
||||||
$databasefortest='postgres';
|
$databasefortest='postgres';
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
$databasefortest='mssql';
|
||||||
|
}
|
||||||
$db = new DoliDb($_POST["db_type"],$_POST["db_host"],$userroot,$passroot,$databasefortest);
|
$db = new DoliDb($_POST["db_type"],$_POST["db_host"],$userroot,$passroot,$databasefortest);
|
||||||
}else{
|
}else{
|
||||||
$db = new DoliDb($_POST["db_type"],$_POST["db_host"],$_POST["db_user"],$_POST["db_pass"],$_POST["db_name"]);
|
$db = new DoliDb($_POST["db_type"],$_POST["db_host"],$_POST["db_user"],$_POST["db_pass"],$_POST["db_name"]);
|
||||||
|
|||||||
@ -56,6 +56,7 @@ $langs->load("install");
|
|||||||
if ($dolibarr_main_db_type == "mysql") $choix=1;
|
if ($dolibarr_main_db_type == "mysql") $choix=1;
|
||||||
if ($dolibarr_main_db_type == "mysqli") $choix=1;
|
if ($dolibarr_main_db_type == "mysqli") $choix=1;
|
||||||
if ($dolibarr_main_db_type == "pgsql") $choix=2;
|
if ($dolibarr_main_db_type == "pgsql") $choix=2;
|
||||||
|
if ($dolibarr_main_db_type == "mssql") $choix=3;
|
||||||
|
|
||||||
|
|
||||||
dolibarr_install_syslog("upgrade: Entering upgrade.php page");
|
dolibarr_install_syslog("upgrade: Entering upgrade.php page");
|
||||||
@ -191,7 +192,8 @@ if (! isset($_GET["action"]) || $_GET["action"] == "upgrade")
|
|||||||
if ($ok)
|
if ($ok)
|
||||||
{
|
{
|
||||||
if ($choix==1) $dir = "../../mysql/migration/";
|
if ($choix==1) $dir = "../../mysql/migration/";
|
||||||
else $dir = "../../pgsql/migration/";
|
elseif ($choix==2) $dir = "../../pgsql/migration/";
|
||||||
|
else $dir = "../../mssql/migration/";
|
||||||
|
|
||||||
$filelist=array();
|
$filelist=array();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|||||||
@ -61,6 +61,7 @@ $langs->load("suppliers");
|
|||||||
if ($dolibarr_main_db_type == 'mysql') $choix=1;
|
if ($dolibarr_main_db_type == 'mysql') $choix=1;
|
||||||
if ($dolibarr_main_db_type == 'mysqli') $choix=1;
|
if ($dolibarr_main_db_type == 'mysqli') $choix=1;
|
||||||
if ($dolibarr_main_db_type == 'pgsql') $choix=2;
|
if ($dolibarr_main_db_type == 'pgsql') $choix=2;
|
||||||
|
if ($dolibarr_main_db_type == 'mssql') $choix=3;
|
||||||
|
|
||||||
|
|
||||||
dolibarr_install_syslog("upgrade2: Entering upgrade2.php page");
|
dolibarr_install_syslog("upgrade2: Entering upgrade2.php page");
|
||||||
|
|||||||
100
mssql/Makefile
Normal file
100
mssql/Makefile
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
# Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
# Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
#
|
||||||
|
# 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$
|
||||||
|
#
|
||||||
|
# **********************************************************************
|
||||||
|
# Ce makefile permet d'initialiser la base de donnée de dolibarr en manuel.
|
||||||
|
# Il n'est utile que si vous n'utilisez pas l'installateur automatique
|
||||||
|
# accessible à http://localhost/dolibarr/install/
|
||||||
|
#
|
||||||
|
# Pour une installation manuelle, créer la base dolibarr puis faire:
|
||||||
|
# make mssql.sql
|
||||||
|
# mysql dolibarr < mssql.sql
|
||||||
|
#
|
||||||
|
# Le script mssql.sql cotient tous le ordres sql pour créer la base
|
||||||
|
# Tables + Index et Clés + Données
|
||||||
|
#
|
||||||
|
# **********************************************************************
|
||||||
|
|
||||||
|
# Penser à rajouter le commutateur -S pour un serveur autre que localhost
|
||||||
|
# Vous pouvez remplacer -E par -U et -P si vous voulez utiliser l'authentification SQL
|
||||||
|
|
||||||
|
# Vous aurez besoin des outils GNU précompilé pour Windows (provenant de Cygwin par exemple) pour générer et
|
||||||
|
# exécuter ce script
|
||||||
|
SQL=sqlcmd -E -Q
|
||||||
|
BASE=dolibarr
|
||||||
|
OPTIONS=
|
||||||
|
|
||||||
|
FIND=find
|
||||||
|
#FIND="c:/Program files/cygwin/bin/find"
|
||||||
|
|
||||||
|
|
||||||
|
TABLES=$(shell $(FIND) tables/ -name "*sql")
|
||||||
|
|
||||||
|
|
||||||
|
all:
|
||||||
|
cat README
|
||||||
|
|
||||||
|
load:
|
||||||
|
$(SQL) $(OPTIONS) $(BASE) < data/data.sql
|
||||||
|
|
||||||
|
dev:
|
||||||
|
cd data \
|
||||||
|
&& make dev BASE=$(BASE) OPTIONS=$(OPTIONS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
dropall: dropdb droppriv
|
||||||
|
|
||||||
|
droppriv:
|
||||||
|
$(SQL) $(OPTIONS) $(SQL) -e "delete from db where Db='$(BASE)' ; "
|
||||||
|
|
||||||
|
dropdb:
|
||||||
|
$(SQL) $(OPTIONS) $(SQL) -f -e "drop database if exists $(BASE) ; "
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
create: createdb createpriv
|
||||||
|
|
||||||
|
createdb:
|
||||||
|
$(SQL) $(OPTIONS) "create database $(BASE) ; "
|
||||||
|
|
||||||
|
createpriv:
|
||||||
|
$(SQL) $(OPTIONS) "insert into db (Host, Db) values ('localhost', '$(BASE)') ; "
|
||||||
|
$(SQL) $(OPTIONS) "update db set select_priv = 'Y' where db='$(BASE)' ; "
|
||||||
|
$(SQL) $(OPTIONS) "update db set insert_priv = 'Y' where db='$(BASE)' ; "
|
||||||
|
$(SQL) $(OPTIONS) "update db set update_priv = 'Y' where db='$(BASE)' ; "
|
||||||
|
$(SQL) $(OPTIONS) "update db set delete_priv = 'Y' where db='$(BASE)' ; "
|
||||||
|
$(SQL) $(OPTIONS) "update db set create_priv = 'Y' where db='$(BASE)' ; "
|
||||||
|
$(SQL) $(OPTIONS) "update db set drop_priv = 'Y' where db='$(BASE)' ; "
|
||||||
|
$(SQL) $(OPTIONS) "update db set grant_priv = 'Y' where db='$(BASE)' ; "
|
||||||
|
$(SQL) $(OPTIONS) "update db set references_priv = 'Y' where db='$(BASE)' ; "
|
||||||
|
$(SQL) $(OPTIONS) "update db set index_priv = 'Y' where db='$(BASE)' ; "
|
||||||
|
$(SQL) $(OPTIONS) "update db set alter_priv = 'Y' where db='$(BASE)' ; "
|
||||||
|
$(SQL) $(OPTIONS) "flush privileges ; "
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mssql.sql: $(TABLES) data/data.sql Makefile
|
||||||
|
echo "-- Fichier généré par make mssql.sql" > mssql.sql
|
||||||
|
echo "-- Contient les ordres de creation des tables + les clés + les données" >> mssql.sql
|
||||||
|
echo "-- ;" >> mssql.sql
|
||||||
|
$(FIND) tables/ -name "*sql" | grep -v "key.sql" | xargs cat | grep -v "^--" | cut -d "-" -f 1 >> mssql.sql
|
||||||
|
$(FIND) tables/ -name "*sql" | grep "key.sql" | xargs cat | grep -v "^--" | cut -d "-" -f 1 >> mssql.sql
|
||||||
|
cat data/data.sql | grep -v ^-- >> mssql.sql
|
||||||
8
mssql/README
Normal file
8
mssql/README
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Makefile Options
|
||||||
|
#####################
|
||||||
|
|
||||||
|
- mssql.sql Génère un fichier sql unique pour l'installation (Contient les
|
||||||
|
ordres de création des tables + clés et index + données)
|
||||||
|
|
||||||
|
- load Charge les données minimales définies dans data/data.sql
|
||||||
|
|
||||||
Binary file not shown.
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
create table llx_accountingaccount
|
create table llx_accountingaccount
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_pcg_version varchar(12) NOT NULL,
|
fk_pcg_version varchar(12) NOT NULL,
|
||||||
pcg_type varchar(20) NOT NULL,
|
pcg_type varchar(20) NOT NULL,
|
||||||
pcg_subtype varchar(20) NOT NULL,
|
pcg_subtype varchar(20) NOT NULL,
|
||||||
|
|||||||
@ -21,8 +21,8 @@
|
|||||||
|
|
||||||
create table llx_accountingdebcred
|
create table llx_accountingdebcred
|
||||||
(
|
(
|
||||||
fk_transaction int NOT NULL,
|
fk_transaction integer NOT NULL,
|
||||||
fk_account int NOT NULL,
|
fk_account integer NOT NULL,
|
||||||
amount real NOT NULL,
|
amount real NOT NULL,
|
||||||
direction varchar(1) NOT NULL
|
direction varchar(1) NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
create table llx_accountingsystem
|
create table llx_accountingsystem
|
||||||
(
|
(
|
||||||
pcg_version varchar(12) PRIMARY KEY,
|
pcg_version varchar(12) PRIMARY KEY,
|
||||||
fk_pays int NOT NULL,
|
fk_pays integer NOT NULL,
|
||||||
label varchar(128) NOT NULL,
|
label varchar(128) NOT NULL,
|
||||||
datec varchar(12) NOT NULL,
|
datec varchar(12) NOT NULL,
|
||||||
fk_author varchar(20),
|
fk_author varchar(20),
|
||||||
|
|||||||
@ -21,13 +21,13 @@
|
|||||||
|
|
||||||
create table llx_accountingtransaction
|
create table llx_accountingtransaction
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
label varchar(128) NOT NULL,
|
label varchar(128) NOT NULL,
|
||||||
datec datetime NOT NULL,
|
datec datetime NOT NULL,
|
||||||
fk_author varchar(20) NOT NULL,
|
fk_author varchar(20) NOT NULL,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_facture int,
|
fk_facture integer,
|
||||||
fk_facture_fourn int,
|
fk_facture_fourn integer,
|
||||||
fk_paiement int,
|
fk_paiement integer,
|
||||||
fk_paiement_fourn int
|
fk_paiement_fourn integer
|
||||||
);
|
);
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
create table llx_action_def
|
create table llx_action_def
|
||||||
(
|
(
|
||||||
rowid int NOT NULL PRIMARY KEY,
|
rowid integer NOT NULL PRIMARY KEY,
|
||||||
code varchar(25) UNIQUE NOT NULL,
|
code varchar(25) UNIQUE NOT NULL,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
titre varchar(255) NOT NULL,
|
titre varchar(255) NOT NULL,
|
||||||
|
|||||||
@ -25,23 +25,23 @@
|
|||||||
|
|
||||||
create table llx_actioncomm
|
create table llx_actioncomm
|
||||||
(
|
(
|
||||||
id int IDENTITY PRIMARY KEY,
|
id integer IDENTITY PRIMARY KEY,
|
||||||
datec datetime, -- date creation
|
datec datetime, -- SMALLDATETIME creation
|
||||||
datep datetime, -- date debut planifiee
|
datep datetime, -- SMALLDATETIME debut planifiee
|
||||||
datep2 datetime, -- date fin planifiee si action non ponctuelle
|
datep2 datetime, -- SMALLDATETIME fin planifiee si action non ponctuelle
|
||||||
datea datetime, -- date debut realisation
|
datea datetime, -- SMALLDATETIME debut realisation
|
||||||
datea2 datetime, -- date fin realisation si action non ponctuelle
|
datea2 datetime, -- SMALLDATETIME fin realisation si action non ponctuelle
|
||||||
tms timestamp, -- date modif
|
tms timestamp, -- SMALLDATETIME modif
|
||||||
fk_action int, -- type de l'action
|
fk_action integer, -- type de l'action
|
||||||
label varchar(50) NOT NULL, -- libelle de l'action
|
label varchar(50) NOT NULL, -- libelle de l'action
|
||||||
|
|
||||||
fk_project int,
|
fk_project integer,
|
||||||
fk_soc int,
|
fk_soc integer,
|
||||||
fk_contact int,
|
fk_contact integer,
|
||||||
fk_parent int NOT NULL default 0,
|
fk_parent integer NOT NULL default 0,
|
||||||
|
|
||||||
fk_user_action int, -- id de la personne qui doit effectuer l'action
|
fk_user_action integer, -- id de la personne qui doit effectuer l'action
|
||||||
fk_user_author int, -- id de la personne qui a effectuer l'action
|
fk_user_author integer, -- id de la personne qui a effectuer l'action
|
||||||
priority smallint,
|
priority smallint,
|
||||||
punctual smallint NOT NULL default 1,
|
punctual smallint NOT NULL default 1,
|
||||||
[percent] smallint NOT NULL default 0,
|
[percent] smallint NOT NULL default 0,
|
||||||
@ -49,9 +49,9 @@ create table llx_actioncomm
|
|||||||
durationa real, -- duree reellement passee
|
durationa real, -- duree reellement passee
|
||||||
note text,
|
note text,
|
||||||
|
|
||||||
propalrowid int,
|
propalrowid integer,
|
||||||
fk_commande int,
|
fk_commande integer,
|
||||||
fk_facture int
|
fk_facture integer
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
create table llx_adherent
|
create table llx_adherent
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
nom varchar(50),
|
nom varchar(50),
|
||||||
prenom varchar(50),
|
prenom varchar(50),
|
||||||
login varchar(50) NOT NULL, -- login
|
login varchar(50) NOT NULL, -- login
|
||||||
@ -45,18 +45,18 @@ create table llx_adherent
|
|||||||
phone varchar(30),
|
phone varchar(30),
|
||||||
phone_perso varchar(30),
|
phone_perso varchar(30),
|
||||||
phone_mobile varchar(30),
|
phone_mobile varchar(30),
|
||||||
naiss datetime, -- date de naissance
|
naiss datetime, -- SMALLDATETIME de naissance
|
||||||
photo varchar(255), -- url vers photo
|
photo varchar(255), -- url vers photo
|
||||||
statut smallint NOT NULL DEFAULT 0,
|
statut smallint NOT NULL DEFAULT 0,
|
||||||
[public] smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils [public] ou pas ?
|
[public] smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils [public] ou pas ?
|
||||||
datefin datetime, -- date de fin de validité de la cotisation
|
datefin datetime, -- SMALLDATETIME de fin de validité de la cotisation
|
||||||
note text,
|
note text,
|
||||||
datevalid datetime, -- date de validation
|
datevalid datetime, -- SMALLDATETIME de validation
|
||||||
datec datetime, -- date de creation
|
datec datetime, -- SMALLDATETIME de creation
|
||||||
tms timestamp, -- date de modification
|
tms timestamp, -- SMALLDATETIME de modification
|
||||||
fk_user_author int NOT NULL,
|
fk_user_author integer NOT NULL,
|
||||||
fk_user_mod int NOT NULL,
|
fk_user_mod integer NOT NULL,
|
||||||
fk_user_valid int NOT NULL,
|
fk_user_valid integer NOT NULL,
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE UNIQUE INDEX login ON llx_adherent(login)
|
CREATE UNIQUE INDEX login ON llx_adherent(login)
|
||||||
|
|||||||
@ -23,9 +23,9 @@
|
|||||||
|
|
||||||
create table llx_adherent_options
|
create table llx_adherent_options
|
||||||
(
|
(
|
||||||
optid int IDENTITY PRIMARY KEY,
|
optid integer IDENTITY PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
adhid int NOT NULL, -- id de l'adherent auquel correspond ces attributs optionnel
|
adhid integer NOT NULL, -- id de l'adherent auquel correspond ces attributs optionnel
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE UNIQUE INDEX adhid ON llx_adherent_options(adhid)
|
CREATE UNIQUE INDEX adhid ON llx_adherent_options(adhid)
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
create table llx_adherent_type
|
create table llx_adherent_type
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
statut smallint NOT NULL DEFAULT 0,
|
statut smallint NOT NULL DEFAULT 0,
|
||||||
libelle varchar(50),
|
libelle varchar(50),
|
||||||
|
|||||||
@ -22,12 +22,12 @@
|
|||||||
|
|
||||||
create table llx_appro
|
create table llx_appro
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_product int NOT NULL,
|
fk_product integer NOT NULL,
|
||||||
quantity smallint NOT NULL,
|
quantity smallint NOT NULL,
|
||||||
price real,
|
price real,
|
||||||
fk_user_author int
|
fk_user_author integer
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -23,21 +23,21 @@
|
|||||||
|
|
||||||
create table llx_bank
|
create table llx_bank
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
datev datetime, -- date de valeur
|
datev datetime, -- SMALLDATETIME de valeur
|
||||||
dateo datetime, -- date operation
|
dateo datetime, -- SMALLDATETIME operation
|
||||||
amount real NOT NULL default 0,
|
amount real NOT NULL default 0,
|
||||||
label varchar(255),
|
label varchar(255),
|
||||||
fk_account int,
|
fk_account integer,
|
||||||
fk_user_author int,
|
fk_user_author integer,
|
||||||
fk_user_rappro int,
|
fk_user_rappro integer,
|
||||||
fk_type varchar(4), -- CB, Virement, cheque
|
fk_type varchar(4), -- CB, Virement, cheque
|
||||||
num_releve varchar(50),
|
num_releve varchar(50),
|
||||||
num_chq int,
|
num_chq integer,
|
||||||
rappro tinyint default 0,
|
rappro tinyint default 0,
|
||||||
note text,
|
note text,
|
||||||
fk_bordereau int DEFAULT 0,
|
fk_bordereau integer DEFAULT 0,
|
||||||
banque varchar(255), -- banque pour les cheques
|
banque varchar(255), -- banque pour les cheques
|
||||||
emetteur varchar(255), -- emetteur du cheque
|
emetteur varchar(255), -- emetteur du cheque
|
||||||
author varchar(40) -- a supprimer apres migration
|
author varchar(40) -- a supprimer apres migration
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
create table llx_bank_account
|
create table llx_bank_account
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
ref varchar(12) NOT NULL,
|
ref varchar(12) NOT NULL,
|
||||||
@ -48,7 +48,7 @@ create table llx_bank_account
|
|||||||
url varchar(128),
|
url varchar(128),
|
||||||
account_number varchar(8),
|
account_number varchar(8),
|
||||||
currency_code varchar(2) NOT NULL,
|
currency_code varchar(2) NOT NULL,
|
||||||
min_allowed int DEFAULT 0,
|
min_allowed integer DEFAULT 0,
|
||||||
min_desired int DEFAULT 0,
|
min_desired integer DEFAULT 0,
|
||||||
comment varchar(254)
|
comment varchar(254)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -20,6 +20,6 @@
|
|||||||
|
|
||||||
create table llx_bank_categ
|
create table llx_bank_categ
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
label varchar(255)
|
label varchar(255)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -20,8 +20,8 @@
|
|||||||
|
|
||||||
create table llx_bank_class
|
create table llx_bank_class
|
||||||
(
|
(
|
||||||
lineid int NOT NULL,
|
lineid integer NOT NULL,
|
||||||
fk_categ int NOT NULL,
|
fk_categ integer NOT NULL,
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE INDEX lineid ON llx_bank_class(lineid)
|
CREATE INDEX lineid ON llx_bank_class(lineid)
|
||||||
|
|||||||
@ -23,9 +23,9 @@
|
|||||||
|
|
||||||
create table llx_bank_url
|
create table llx_bank_url
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_bank int,
|
fk_bank integer,
|
||||||
url_id int,
|
url_id integer,
|
||||||
url varchar(255),
|
url varchar(255),
|
||||||
label varchar(255),
|
label varchar(255),
|
||||||
type varchar(12) check (type in ('company','payment','member','subscription','donation','sc','payment_sc'))
|
type varchar(12) check (type in ('company','payment','member','subscription','donation','sc','payment_sc'))
|
||||||
|
|||||||
@ -20,9 +20,9 @@
|
|||||||
|
|
||||||
create table llx_bookmark
|
create table llx_bookmark
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_soc int,
|
fk_soc integer,
|
||||||
fk_user int NOT NULL,
|
fk_user integer NOT NULL,
|
||||||
dateb datetime,
|
dateb datetime,
|
||||||
url varchar(128) NOT NULL,
|
url varchar(128) NOT NULL,
|
||||||
target varchar(16),
|
target varchar(16),
|
||||||
|
|||||||
@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
create table llx_bookmark4u_login
|
create table llx_bookmark4u_login
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_user int,
|
fk_user integer,
|
||||||
bk4u_uid int,
|
bk4u_uid integer,
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -5,16 +5,16 @@
|
|||||||
-- $Source$
|
-- $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
|
||||||
-- (at your option) any later version.
|
-- (at your option) any later version.
|
||||||
--
|
--
|
||||||
-- This program is distributed in the hope that it will be useful,
|
-- This program is distributed in the hope that it will be useful,
|
||||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
-- GNU General [public] License for more details.
|
-- GNU General Public License for more details.
|
||||||
--
|
--
|
||||||
-- You should have received a copy of the GNU General [public] License
|
-- You should have received a copy of the GNU General Public License
|
||||||
-- 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.
|
||||||
--
|
--
|
||||||
@ -24,43 +24,14 @@
|
|||||||
--
|
--
|
||||||
create table llx_bordereau_cheque
|
create table llx_bordereau_cheque
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
date_bordereau datetime,
|
date_bordereau SMALLDATETIME,
|
||||||
number varchar(5),
|
number integer,
|
||||||
amount float(12),
|
amount float,
|
||||||
nbcheque smallint DEFAULT 0,
|
nbcheque smallint DEFAULT 0,
|
||||||
fk_bank_account int,
|
fk_bank_account integer,
|
||||||
fk_user_author int,
|
fk_user_author integer,
|
||||||
note text,
|
note text,
|
||||||
statut tinyint DEFAULT 0
|
statut tinyint DEFAULT 0
|
||||||
);
|
);
|
||||||
|
|
||||||
set ANSI_NULLS ON
|
|
||||||
set QUOTED_IDENTIFIER ON
|
|
||||||
GO
|
|
||||||
|
|
||||||
-- FILLZERO du number
|
|
||||||
|
|
||||||
CREATE TRIGGER [dbo].[llx_bordereau_cheque_number]
|
|
||||||
ON [dbo].[llx_bordereau_cheque]
|
|
||||||
AFTER INSERT, UPDATE
|
|
||||||
AS
|
|
||||||
BEGIN
|
|
||||||
-- SET NOCOUNT ON added to prevent extra result sets from
|
|
||||||
-- interfering with SELECT statements.
|
|
||||||
SET NOCOUNT ON;
|
|
||||||
|
|
||||||
DECLARE @numero as varchar(5)
|
|
||||||
SELECT @numero = right('00000' + cast(number AS varchar(5)),5)
|
|
||||||
from llx_bordereau_cheque
|
|
||||||
where rowid in (select rowid from inserted)
|
|
||||||
|
|
||||||
update llx_bordereau_cheque set number = @numero
|
|
||||||
where rowid in (select rowid from inserted)
|
|
||||||
|
|
||||||
END
|
|
||||||
|
|
||||||
set ANSI_NULLS ON
|
|
||||||
set QUOTED_IDENTIFIER ON
|
|
||||||
GO
|
|
||||||
|
|||||||
@ -27,9 +27,9 @@
|
|||||||
|
|
||||||
create table llx_boxes
|
create table llx_boxes
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
box_id int NOT NULL,
|
box_id integer NOT NULL,
|
||||||
position smallint NOT NULL,
|
position smallint NOT NULL,
|
||||||
box_order smallint default 0 NOT NULL,
|
box_order smallint default 0 NOT NULL,
|
||||||
fk_user int default 0 NOT NULL
|
fk_user integer default 0 NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
create table llx_boxes_def
|
create table llx_boxes_def
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
name varchar(255) NOT NULL,
|
name varchar(255) NOT NULL,
|
||||||
[file] varchar(255) NOT NULL,
|
[file] varchar(255) NOT NULL,
|
||||||
note text
|
note text
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
create table llx_c_actioncomm
|
create table llx_c_actioncomm
|
||||||
(
|
(
|
||||||
id int PRIMARY KEY,
|
id integer PRIMARY KEY,
|
||||||
code varchar(12) UNIQUE NOT NULL,
|
code varchar(12) UNIQUE NOT NULL,
|
||||||
type varchar(10) DEFAULT 'system' NOT NULL,
|
type varchar(10) DEFAULT 'system' NOT NULL,
|
||||||
libelle varchar(30) NOT NULL,
|
libelle varchar(30) NOT NULL,
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
create table llx_c_ape
|
create table llx_c_ape
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
code_ape varchar(5) NOT NULL,
|
code_ape varchar(5) NOT NULL,
|
||||||
libelle varchar(255),
|
libelle varchar(255),
|
||||||
active tinyint DEFAULT 1 NOT NULL,
|
active tinyint DEFAULT 1 NOT NULL,
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
create table llx_c_chargesociales
|
create table llx_c_chargesociales
|
||||||
(
|
(
|
||||||
id int IDENTITY PRIMARY KEY,
|
id integer IDENTITY PRIMARY KEY,
|
||||||
libelle varchar(80),
|
libelle varchar(80),
|
||||||
deductible smallint DEFAULT 0 NOT NULL,
|
deductible smallint DEFAULT 0 NOT NULL,
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
create table llx_c_civilite
|
create table llx_c_civilite
|
||||||
(
|
(
|
||||||
rowid int PRIMARY KEY,
|
rowid integer PRIMARY KEY,
|
||||||
code varchar(6) UNIQUE NOT NULL,
|
code varchar(6) UNIQUE NOT NULL,
|
||||||
civilite varchar(50),
|
civilite varchar(50),
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
|||||||
@ -23,11 +23,11 @@
|
|||||||
|
|
||||||
create table llx_c_departements
|
create table llx_c_departements
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
code_departement varchar(6) NOT NULL,
|
code_departement varchar(6) NOT NULL,
|
||||||
fk_region int,
|
fk_region integer,
|
||||||
cheflieu varchar(7),
|
cheflieu varchar(7),
|
||||||
tncc int,
|
tncc integer,
|
||||||
ncc varchar(50),
|
ncc varchar(50),
|
||||||
nom varchar(50),
|
nom varchar(50),
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
create table llx_c_effectif
|
create table llx_c_effectif
|
||||||
(
|
(
|
||||||
id int PRIMARY KEY,
|
id integer PRIMARY KEY,
|
||||||
code varchar(12) UNIQUE NOT NULL,
|
code varchar(12) UNIQUE NOT NULL,
|
||||||
libelle varchar(30),
|
libelle varchar(30),
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
|||||||
@ -23,9 +23,9 @@
|
|||||||
|
|
||||||
create table llx_c_forme_juridique
|
create table llx_c_forme_juridique
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
code varchar(12) UNIQUE NOT NULL,
|
code varchar(12) UNIQUE NOT NULL,
|
||||||
fk_pays int NOT NULL,
|
fk_pays integer NOT NULL,
|
||||||
libelle varchar(255),
|
libelle varchar(255),
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
create table llx_c_methode_commande_fournisseur
|
create table llx_c_methode_commande_fournisseur
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
code varchar(30),
|
code varchar(30),
|
||||||
libelle varchar(60),
|
libelle varchar(60),
|
||||||
active tinyint default 1 NOT NULL,
|
active tinyint default 1 NOT NULL,
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
create table llx_c_paiement
|
create table llx_c_paiement
|
||||||
(
|
(
|
||||||
id int PRIMARY KEY,
|
id integer PRIMARY KEY,
|
||||||
code varchar(6) UNIQUE NOT NULL,
|
code varchar(6) UNIQUE NOT NULL,
|
||||||
libelle varchar(30),
|
libelle varchar(30),
|
||||||
type smallint,
|
type smallint,
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
create table llx_c_pays
|
create table llx_c_pays
|
||||||
(
|
(
|
||||||
rowid int PRIMARY KEY,
|
rowid integer PRIMARY KEY,
|
||||||
code varchar(2) NOT NULL,
|
code varchar(2) NOT NULL,
|
||||||
code_iso varchar(3) ,
|
code_iso varchar(3) ,
|
||||||
libelle varchar(50) NOT NULL,
|
libelle varchar(50) NOT NULL,
|
||||||
|
|||||||
@ -23,11 +23,11 @@
|
|||||||
|
|
||||||
create table llx_c_regions
|
create table llx_c_regions
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
code_region int UNIQUE NOT NULL,
|
code_region integer UNIQUE NOT NULL,
|
||||||
fk_pays int NOT NULL,
|
fk_pays integer NOT NULL,
|
||||||
cheflieu varchar(7),
|
cheflieu varchar(7),
|
||||||
tncc int,
|
tncc integer,
|
||||||
nom varchar(50),
|
nom varchar(50),
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
create table llx_c_stcomm
|
create table llx_c_stcomm
|
||||||
(
|
(
|
||||||
id int PRIMARY KEY,
|
id integer PRIMARY KEY,
|
||||||
code varchar(12) UNIQUE NOT NULL,
|
code varchar(12) UNIQUE NOT NULL,
|
||||||
libelle varchar(30),
|
libelle varchar(30),
|
||||||
active tinyint default 1 NOT NULL
|
active tinyint default 1 NOT NULL
|
||||||
|
|||||||
@ -22,10 +22,10 @@
|
|||||||
|
|
||||||
create table llx_c_tva
|
create table llx_c_tva
|
||||||
(
|
(
|
||||||
rowid int NOT NULL IDENTITY PRIMARY KEY,
|
rowid integer NOT NULL IDENTITY PRIMARY KEY,
|
||||||
fk_pays int NOT NULL,
|
fk_pays integer NOT NULL,
|
||||||
taux FLOAT(25) NOT NULL,
|
taux FLOAT(25) NOT NULL,
|
||||||
recuperableonly int NOT NULL DEFAULT 0,
|
recuperableonly integer NOT NULL DEFAULT 0,
|
||||||
note varchar(128),
|
note varchar(128),
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
create table llx_c_type_contact
|
create table llx_c_type_contact
|
||||||
(
|
(
|
||||||
rowid int PRIMARY KEY,
|
rowid integer PRIMARY KEY,
|
||||||
element varchar(30) NOT NULL,
|
element varchar(30) NOT NULL,
|
||||||
source varchar(8) DEFAULT 'external' NOT NULL,
|
source varchar(8) DEFAULT 'external' NOT NULL,
|
||||||
code varchar(16) NOT NULL,
|
code varchar(16) NOT NULL,
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
create table llx_c_typent
|
create table llx_c_typent
|
||||||
(
|
(
|
||||||
id int PRIMARY KEY,
|
id integer PRIMARY KEY,
|
||||||
code varchar(12) UNIQUE NOT NULL,
|
code varchar(12) UNIQUE NOT NULL,
|
||||||
libelle varchar(30),
|
libelle varchar(30),
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
create table llx_categorie
|
create table llx_categorie
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
label VARCHAR(255), -- nom de la catégorie
|
label VARCHAR(255), -- nom de la catégorie
|
||||||
description text, -- description de la catégorie
|
description text, -- description de la catégorie
|
||||||
visible tinyint DEFAULT 1 NOT NULL -- determine si les produits sont visible ou pas
|
visible tinyint DEFAULT 1 NOT NULL -- determine si les produits sont visible ou pas
|
||||||
|
|||||||
@ -20,6 +20,6 @@
|
|||||||
|
|
||||||
create table llx_categorie_association
|
create table llx_categorie_association
|
||||||
(
|
(
|
||||||
fk_categorie_mere int NOT NULL,
|
fk_categorie_mere integer NOT NULL,
|
||||||
fk_categorie_fille int NOT NULL
|
fk_categorie_fille integer NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
create table llx_categorie_fournisseur
|
create table llx_categorie_fournisseur
|
||||||
(
|
(
|
||||||
fk_categorie int NOT NULL,
|
fk_categorie integer NOT NULL,
|
||||||
fk_societe int NOT NULL,
|
fk_societe integer NOT NULL,
|
||||||
UNIQUE (fk_categorie, fk_societe)
|
UNIQUE (fk_categorie, fk_societe)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -20,6 +20,6 @@
|
|||||||
|
|
||||||
create table llx_categorie_product
|
create table llx_categorie_product
|
||||||
(
|
(
|
||||||
fk_categorie int NOT NULL,
|
fk_categorie integer NOT NULL,
|
||||||
fk_product int NOT NULL
|
fk_product integer NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,10 +22,10 @@
|
|||||||
|
|
||||||
create table llx_chargesociales
|
create table llx_chargesociales
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
date_ech datetime NOT NULL, -- date d'echeance
|
date_ech datetime NOT NULL, -- SMALLDATETIME d'echeance
|
||||||
libelle varchar(80),
|
libelle varchar(80),
|
||||||
fk_type int,
|
fk_type integer,
|
||||||
amount real default 0 NOT NULL,
|
amount real default 0 NOT NULL,
|
||||||
paye smallint default 0 NOT NULL,
|
paye smallint default 0 NOT NULL,
|
||||||
periode datetime
|
periode datetime
|
||||||
|
|||||||
@ -21,9 +21,9 @@
|
|||||||
|
|
||||||
create table llx_co_fa
|
create table llx_co_fa
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_commande int NOT NULL,
|
fk_commande integer NOT NULL,
|
||||||
fk_facture int NOT NULL
|
fk_facture integer NOT NULL
|
||||||
|
|
||||||
--key(fk_commande),
|
--key(fk_commande),
|
||||||
--key(fk_facture)
|
--key(fk_facture)
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
create table llx_co_pr
|
create table llx_co_pr
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_commande int,
|
fk_commande integer,
|
||||||
fk_propale int
|
fk_propale integer
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
create table llx_comfourn_facfourn
|
create table llx_comfourn_facfourn
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_commande int NOT NULL,
|
fk_commande integer NOT NULL,
|
||||||
fk_facture int NOT NULL,
|
fk_facture integer NOT NULL,
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -26,4 +26,4 @@
|
|||||||
|
|
||||||
CREATE INDEX idx_commande_fk_soc ON llx_commande(fk_soc);
|
CREATE INDEX idx_commande_fk_soc ON llx_commande(fk_soc);
|
||||||
|
|
||||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
|
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
|
||||||
|
|||||||
@ -22,20 +22,20 @@
|
|||||||
|
|
||||||
create table llx_commande
|
create table llx_commande
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_soc int NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
fk_projet int DEFAULT 0, -- projet auquel est rattache la commande
|
fk_projet integer DEFAULT 0, -- projet auquel est rattache la commande
|
||||||
ref varchar(30) NOT NULL, -- order number
|
ref varchar(30) NOT NULL, -- order number
|
||||||
ref_client varchar(30), -- customer order number
|
ref_client varchar(30), -- customer order number
|
||||||
|
|
||||||
date_creation datetime, -- date de creation
|
date_creation datetime, -- SMALLDATETIME de creation
|
||||||
date_valid datetime, -- date de validation
|
date_valid datetime, -- SMALLDATETIME de validation
|
||||||
date_cloture datetime, -- date de cloture
|
date_cloture datetime, -- SMALLDATETIME de cloture
|
||||||
date_commande datetime, -- date de la commande
|
date_commande datetime, -- SMALLDATETIME de la commande
|
||||||
fk_user_author int, -- createur de la commande
|
fk_user_author integer, -- createur de la commande
|
||||||
fk_user_valid int, -- valideur de la commande
|
fk_user_valid integer, -- valideur de la commande
|
||||||
fk_user_cloture int, -- auteur cloture
|
fk_user_cloture integer, -- auteur cloture
|
||||||
source smallint NOT NULL,
|
source smallint NOT NULL,
|
||||||
fk_statut smallint default 0,
|
fk_statut smallint default 0,
|
||||||
amount_ht real default 0,
|
amount_ht real default 0,
|
||||||
@ -50,10 +50,10 @@ create table llx_commande
|
|||||||
model_pdf varchar(50),
|
model_pdf varchar(50),
|
||||||
|
|
||||||
facture tinyint default 0,
|
facture tinyint default 0,
|
||||||
fk_cond_reglement int, -- condition de réglement
|
fk_cond_reglement integer, -- condition de réglement
|
||||||
fk_mode_reglement int, -- mode de réglement
|
fk_mode_reglement integer, -- mode de réglement
|
||||||
date_livraison datetime default NULL,
|
date_livraison datetime default NULL,
|
||||||
fk_adresse_livraison int, -- adresse de livraison
|
fk_adresse_livraison integer, -- adresse de livraison
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -26,4 +26,4 @@
|
|||||||
|
|
||||||
CREATE INDEX idx_commande_fournisseur_fk_soc ON llx_commande_fournisseur(fk_soc);
|
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 (idp);
|
ALTER TABLE llx_commande_fournisseur ADD CONSTRAINT fk_commande_fournisseur_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
|
||||||
|
|||||||
@ -22,19 +22,19 @@
|
|||||||
|
|
||||||
create table llx_commande_fournisseur
|
create table llx_commande_fournisseur
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_soc int NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
fk_projet int DEFAULT 0, -- projet auquel est rattache la commande
|
fk_projet integer DEFAULT 0, -- projet auquel est rattache la commande
|
||||||
ref varchar(30) NOT NULL, -- order number
|
ref varchar(30) NOT NULL, -- order number
|
||||||
|
|
||||||
date_creation datetime, -- date de creation
|
date_creation datetime, -- SMALLDATETIME de creation
|
||||||
date_valid datetime, -- date de validation
|
date_valid datetime, -- SMALLDATETIME de validation
|
||||||
date_cloture datetime, -- date de cloture
|
date_cloture datetime, -- SMALLDATETIME de cloture
|
||||||
date_commande datetime, -- date de la commande
|
date_commande datetime, -- SMALLDATETIME de la commande
|
||||||
fk_user_author int, -- createur de la commande
|
fk_user_author integer, -- createur de la commande
|
||||||
fk_user_valid int, -- valideur de la commande
|
fk_user_valid integer, -- valideur de la commande
|
||||||
fk_user_cloture int, -- auteur cloture
|
fk_user_cloture integer, -- auteur cloture
|
||||||
source smallint NOT NULL,
|
source smallint NOT NULL,
|
||||||
fk_statut smallint default 0,
|
fk_statut smallint default 0,
|
||||||
amount_ht real default 0,
|
amount_ht real default 0,
|
||||||
@ -47,7 +47,7 @@ create table llx_commande_fournisseur
|
|||||||
note_public text,
|
note_public text,
|
||||||
model_pdf varchar(50),
|
model_pdf varchar(50),
|
||||||
|
|
||||||
fk_methode_commande int default 0,
|
fk_methode_commande integer default 0,
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -21,11 +21,11 @@
|
|||||||
|
|
||||||
create table llx_commande_fournisseur_dispatch
|
create table llx_commande_fournisseur_dispatch
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_commande int,
|
fk_commande integer,
|
||||||
fk_product int,
|
fk_product integer,
|
||||||
qty float, -- quantité
|
qty float, -- quantité
|
||||||
fk_entrepot int,
|
fk_entrepot integer,
|
||||||
fk_user int,
|
fk_user integer,
|
||||||
datec datetime
|
datec datetime
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,10 +22,10 @@
|
|||||||
|
|
||||||
create table llx_commande_fournisseur_log
|
create table llx_commande_fournisseur_log
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
datelog datetime NOT NULL,
|
datelog datetime NOT NULL,
|
||||||
fk_commande int NOT NULL,
|
fk_commande integer NOT NULL,
|
||||||
fk_statut smallint NOT NULL,
|
fk_statut smallint NOT NULL,
|
||||||
fk_user int NOT NULL
|
fk_user integer NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@ -21,9 +21,9 @@
|
|||||||
|
|
||||||
create table llx_commande_fournisseurdet
|
create table llx_commande_fournisseurdet
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_commande int,
|
fk_commande integer,
|
||||||
fk_product int,
|
fk_product integer,
|
||||||
ref varchar(50),
|
ref varchar(50),
|
||||||
label varchar(255),
|
label varchar(255),
|
||||||
description text,
|
description text,
|
||||||
|
|||||||
@ -22,24 +22,24 @@
|
|||||||
|
|
||||||
create table llx_commandedet
|
create table llx_commandedet
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_commande int,
|
fk_commande integer,
|
||||||
fk_product int,
|
fk_product integer,
|
||||||
description text,
|
description text,
|
||||||
tva_tx real, -- taux tva
|
tva_tx real, -- 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
|
||||||
fk_remise_except int NULL, -- Lien vers table des remises fixes
|
fk_remise_except integer NULL, -- Lien vers table des remises fixes
|
||||||
subprice real, -- prix avant remise
|
subprice real, -- prix avant remise
|
||||||
price real, -- prix final
|
price real, -- prix final
|
||||||
total_ht real, -- Total HT de la ligne toute quantité et incluant remise ligne et globale
|
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_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
|
total_ttc real, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale
|
||||||
info_bits int DEFAULT 0, -- TVA NPR ou non
|
info_bits integer DEFAULT 0, -- TVA NPR ou non
|
||||||
coef real, -- coefficient de marge
|
coef real, -- coefficient de marge
|
||||||
special_code tinyint DEFAULT 0, -- code pour les lignes speciales
|
special_code tinyint DEFAULT 0, -- code pour les lignes speciales
|
||||||
rang int DEFAULT 0
|
rang integer DEFAULT 0
|
||||||
);
|
);
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|||||||
@ -22,14 +22,14 @@
|
|||||||
|
|
||||||
create table llx_compta
|
create table llx_compta
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
datev datetime, -- date de valeur
|
datev datetime, -- SMALLDATETIME de valeur
|
||||||
amount real DEFAULT 0 NOT NULL ,
|
amount real DEFAULT 0 NOT NULL ,
|
||||||
label varchar(255),
|
label varchar(255),
|
||||||
fk_compta_account int,
|
fk_compta_account integer,
|
||||||
fk_user_author int,
|
fk_user_author integer,
|
||||||
fk_user_valid int,
|
fk_user_valid integer,
|
||||||
valid tinyint DEFAULT 0,
|
valid tinyint DEFAULT 0,
|
||||||
note text
|
note text
|
||||||
|
|
||||||
|
|||||||
@ -22,11 +22,11 @@
|
|||||||
|
|
||||||
create table llx_compta_account
|
create table llx_compta_account
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
number varchar(12),
|
number varchar(12),
|
||||||
label varchar(255),
|
label varchar(255),
|
||||||
fk_user_author int,
|
fk_user_author integer,
|
||||||
note text
|
note text
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,11 +22,11 @@
|
|||||||
|
|
||||||
create table llx_compta_compte_generaux
|
create table llx_compta_compte_generaux
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
date_creation datetime,
|
date_creation datetime,
|
||||||
numero varchar(50),
|
numero varchar(50),
|
||||||
intitule varchar(255),
|
intitule varchar(255),
|
||||||
fk_user_author int,
|
fk_user_author integer,
|
||||||
note text,
|
note text,
|
||||||
|
|
||||||
UNIQUE(numero)
|
UNIQUE(numero)
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
create table llx_cond_reglement
|
create table llx_cond_reglement
|
||||||
(
|
(
|
||||||
rowid int PRIMARY KEY,
|
rowid integer PRIMARY KEY,
|
||||||
code varchar(16),
|
code varchar(16),
|
||||||
sortorder smallint,
|
sortorder smallint,
|
||||||
active tinyint DEFAULT 1,
|
active tinyint DEFAULT 1,
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
create table llx_const
|
create table llx_const
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
name varchar(255),
|
name varchar(255),
|
||||||
value text, -- max 65535 caracteres
|
value text, -- max 65535 caracteres
|
||||||
type varchar(6) check (type in ('yesno','texte','chaine')),
|
type varchar(6) check (type in ('yesno','texte','chaine')),
|
||||||
|
|||||||
@ -30,5 +30,5 @@
|
|||||||
CREATE INDEX idx_contrat_fk_soc ON llx_contrat(fk_soc);
|
CREATE INDEX idx_contrat_fk_soc ON llx_contrat(fk_soc);
|
||||||
CREATE INDEX idx_contrat_fk_user_author ON llx_contrat(fk_user_author);
|
CREATE INDEX idx_contrat_fk_user_author ON llx_contrat(fk_user_author);
|
||||||
|
|
||||||
ALTER TABLE llx_contrat ADD CONSTRAINT fk_contrat_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
|
ALTER TABLE llx_contrat ADD CONSTRAINT fk_contrat_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
|
||||||
ALTER TABLE llx_contrat ADD CONSTRAINT fk_contrat_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
ALTER TABLE llx_contrat ADD CONSTRAINT fk_contrat_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
||||||
@ -23,22 +23,22 @@
|
|||||||
|
|
||||||
create table llx_contrat
|
create table llx_contrat
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
ref varchar(30), -- reference de contrat
|
ref varchar(30), -- reference de contrat
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
datec datetime, -- date de creation de l'enregistrement
|
datec datetime, -- SMALLDATETIME de creation de l'enregistrement
|
||||||
date_contrat datetime,
|
date_contrat datetime,
|
||||||
statut smallint DEFAULT 0,
|
statut smallint DEFAULT 0,
|
||||||
mise_en_service datetime,
|
mise_en_service datetime,
|
||||||
fin_validite datetime,
|
fin_validite datetime,
|
||||||
date_cloture datetime,
|
date_cloture datetime,
|
||||||
fk_soc int NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
fk_projet int,
|
fk_projet integer,
|
||||||
fk_commercial_signature int NOT NULL, -- obsolete
|
fk_commercial_signature integer NOT NULL, -- obsolete
|
||||||
fk_commercial_suivi int NOT NULL, -- obsolete
|
fk_commercial_suivi integer NOT NULL, -- obsolete
|
||||||
fk_user_author int NOT NULL default 0,
|
fk_user_author integer NOT NULL default 0,
|
||||||
fk_user_mise_en_service int,
|
fk_user_mise_en_service integer,
|
||||||
fk_user_cloture int,
|
fk_user_cloture integer,
|
||||||
note text,
|
note text,
|
||||||
note_public text
|
note_public text
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,11 +22,11 @@
|
|||||||
|
|
||||||
create table llx_contratdet
|
create table llx_contratdet
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
|
|
||||||
fk_contrat int NOT NULL,
|
fk_contrat integer NOT NULL,
|
||||||
fk_product int NULL, -- doit pouvoir etre nul pour ligne detail sans produits
|
fk_product integer NULL, -- doit pouvoir etre nul pour ligne detail sans produits
|
||||||
|
|
||||||
statut smallint DEFAULT 0,
|
statut smallint DEFAULT 0,
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ create table llx_contratdet
|
|||||||
|
|
||||||
date_commande datetime,
|
date_commande datetime,
|
||||||
date_ouverture_prevue datetime,
|
date_ouverture_prevue datetime,
|
||||||
date_ouverture datetime, -- date d'ouverture du service chez le client
|
date_ouverture datetime, -- SMALLDATETIME d'ouverture du service chez le client
|
||||||
date_fin_validite datetime,
|
date_fin_validite datetime,
|
||||||
date_cloture datetime,
|
date_cloture datetime,
|
||||||
|
|
||||||
@ -43,17 +43,17 @@ create table llx_contratdet
|
|||||||
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
|
||||||
fk_remise_except int NULL, -- Lien vers table des remises fixes
|
fk_remise_except integer NULL, -- Lien vers table des remises fixes
|
||||||
subprice real, -- prix avant remise
|
subprice real, -- prix avant remise
|
||||||
price_ht real, -- prix final
|
price_ht real, -- prix final
|
||||||
total_ht real, -- Total HT de la ligne toute quantité et incluant remise ligne et globale
|
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_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
|
total_ttc real, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale
|
||||||
info_bits int DEFAULT 0, -- TVA NPR ou non
|
info_bits integer DEFAULT 0, -- TVA NPR ou non
|
||||||
|
|
||||||
fk_user_author int NOT NULL default 0,
|
fk_user_author integer NOT NULL default 0,
|
||||||
fk_user_ouverture int,
|
fk_user_ouverture integer,
|
||||||
fk_user_cloture int,
|
fk_user_cloture integer,
|
||||||
commentaire text
|
commentaire text
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|||||||
@ -21,6 +21,6 @@
|
|||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
|
|
||||||
CREATE INDEX idx_contratdet_log_fk_contratdet ON llx_contratdet_log(fk_contratdet);
|
CREATE INDEX idx_contratdet_log_fk_contratdet ON llx_contratdet_log(fk_contratdet);
|
||||||
CREATE INDEX idx_contratdet_log_date ON llx_contratdet_log(date);
|
CREATE INDEX idx_contratdet_log_date ON llx_contratdet_log(SMALLDATETIME);
|
||||||
|
|
||||||
ALTER TABLE llx_contratdet_log ADD CONSTRAINT fk_contratdet_log_fk_contratdet FOREIGN KEY (fk_contratdet) REFERENCES llx_contratdet (rowid);
|
ALTER TABLE llx_contratdet_log ADD CONSTRAINT fk_contratdet_log_fk_contratdet FOREIGN KEY (fk_contratdet) REFERENCES llx_contratdet (rowid);
|
||||||
|
|||||||
@ -22,12 +22,12 @@
|
|||||||
|
|
||||||
create table llx_contratdet_log
|
create table llx_contratdet_log
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_contratdet int NOT NULL,
|
fk_contratdet integer NOT NULL,
|
||||||
date datetime NOT NULL,
|
SMALLDATETIME datetime NOT NULL,
|
||||||
statut smallint NOT NULL,
|
statut smallint NOT NULL,
|
||||||
fk_user_author int NOT NULL,
|
fk_user_author integer NOT NULL,
|
||||||
commentaire text
|
commentaire text
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|||||||
@ -21,12 +21,12 @@
|
|||||||
|
|
||||||
create table llx_cotisation
|
create table llx_cotisation
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
fk_adherent int,
|
fk_adherent integer,
|
||||||
dateadh datetime,
|
dateadh datetime,
|
||||||
cotisation real,
|
cotisation real,
|
||||||
fk_bank int DEFAULT NULL,
|
fk_bank integer DEFAULT NULL,
|
||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,14 +22,14 @@
|
|||||||
|
|
||||||
create table llx_deplacement
|
create table llx_deplacement
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
datec datetime NOT NULL,
|
datec datetime NOT NULL,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
dated datetime,
|
dated datetime,
|
||||||
fk_user int NOT NULL,
|
fk_user integer NOT NULL,
|
||||||
fk_user_author int,
|
fk_user_author integer,
|
||||||
type smallint NOT NULL,
|
type smallint NOT NULL,
|
||||||
km smallint,
|
km smallint,
|
||||||
fk_soc int,
|
fk_soc integer,
|
||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|||||||
@ -21,13 +21,13 @@
|
|||||||
|
|
||||||
create table llx_document
|
create table llx_document
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
name varchar(255) NOT NULL,
|
name varchar(255) NOT NULL,
|
||||||
file_name varchar(255) NOT NULL,
|
file_name varchar(255) NOT NULL,
|
||||||
file_extension varchar(5) NOT NULL,
|
file_extension varchar(5) NOT NULL,
|
||||||
date_generation datetime NULL,
|
date_generation datetime NULL,
|
||||||
fk_owner int NULL,
|
fk_owner integer NULL,
|
||||||
fk_group int NULL,
|
fk_group integer NULL,
|
||||||
permissions char(9) DEFAULT 'rw-rw-rw'
|
permissions char(9) DEFAULT 'rw-rw-rw'
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
create table llx_document_generator
|
create table llx_document_generator
|
||||||
(
|
(
|
||||||
rowid int NOT NULL PRIMARY KEY,
|
rowid integer NOT NULL PRIMARY KEY,
|
||||||
name varchar(255) NOT NULL,
|
name varchar(255) NOT NULL,
|
||||||
classfile varchar(255) NOT NULL,
|
classfile varchar(255) NOT NULL,
|
||||||
class varchar(255) NOT NULL
|
class varchar(255) NOT NULL
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
create table llx_document_model
|
create table llx_document_model
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
nom varchar(50),
|
nom varchar(50),
|
||||||
type varchar(20) NOT NULL,
|
type varchar(20) NOT NULL,
|
||||||
libelle varchar(255),
|
libelle varchar(255),
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
create table llx_dolibarr_modules
|
create table llx_dolibarr_modules
|
||||||
(
|
(
|
||||||
numero int PRIMARY KEY,
|
numero integer PRIMARY KEY,
|
||||||
active tinyint DEFAULT 0 NOT NULL,
|
active tinyint DEFAULT 0 NOT NULL,
|
||||||
active_date datetime NOT NULL,
|
active_date datetime NOT NULL,
|
||||||
active_version varchar(25) NOT NULL
|
active_version varchar(25) NOT NULL
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
create table llx_domain
|
create table llx_domain
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
label varchar(255),
|
label varchar(255),
|
||||||
note text
|
note text
|
||||||
|
|||||||
@ -22,13 +22,13 @@
|
|||||||
|
|
||||||
create table llx_don
|
create table llx_don
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_statut smallint NOT NULL DEFAULT 0,-- etat du don promesse/valid
|
fk_statut smallint NOT NULL DEFAULT 0,-- etat du don promesse/valid
|
||||||
datec datetime, -- date de création de l'enregistrement
|
datec datetime, -- SMALLDATETIME de création de l'enregistrement
|
||||||
datedon datetime, -- date du don/promesse
|
datedon datetime, -- SMALLDATETIME du don/promesse
|
||||||
amount real DEFAULT 0,
|
amount real DEFAULT 0,
|
||||||
fk_paiement int,
|
fk_paiement integer,
|
||||||
prenom varchar(50),
|
prenom varchar(50),
|
||||||
nom varchar(50),
|
nom varchar(50),
|
||||||
societe varchar(50),
|
societe varchar(50),
|
||||||
@ -38,8 +38,8 @@ create table llx_don
|
|||||||
pays varchar(50),
|
pays varchar(50),
|
||||||
email varchar(255),
|
email varchar(255),
|
||||||
[public] smallint DEFAULT 1 NOT NULL, -- le don est-il [public] (0,1)
|
[public] smallint DEFAULT 1 NOT NULL, -- le don est-il [public] (0,1)
|
||||||
fk_don_projet int NOT NULL, -- projet auquel est fait le don
|
fk_don_projet integer NOT NULL, -- projet auquel est fait le don
|
||||||
fk_user_author int NOT NULL,
|
fk_user_author integer NOT NULL,
|
||||||
fk_user_valid int NOT NULL,
|
fk_user_valid integer NOT NULL,
|
||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,10 +22,10 @@
|
|||||||
|
|
||||||
create table llx_don_projet
|
create table llx_don_projet
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
libelle varchar(255),
|
libelle varchar(255),
|
||||||
fk_user_author int NOT NULL,
|
fk_user_author integer NOT NULL,
|
||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|||||||
@ -25,12 +25,12 @@
|
|||||||
|
|
||||||
create table llx_element_contact
|
create table llx_element_contact
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
datecreate datetime NULL, -- date de creation de l'enregistrement
|
datecreate datetime NULL, -- SMALLDATETIME de creation de l'enregistrement
|
||||||
statut smallint DEFAULT 5, -- 5 inactif, 4 actif
|
statut smallint DEFAULT 5, -- 5 inactif, 4 actif
|
||||||
|
|
||||||
element_id int NOT NULL, -- la reference de l'element.
|
element_id integer NOT NULL, -- la reference de l'element.
|
||||||
fk_c_type_contact int NOT NULL, -- nature du contact.
|
fk_c_type_contact integer NOT NULL, -- nature du contact.
|
||||||
fk_socpeople int NOT NULL
|
fk_socpeople integer NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -22,11 +22,11 @@
|
|||||||
|
|
||||||
create table llx_energie_compteur
|
create table llx_energie_compteur
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
libelle varchar(50),
|
libelle varchar(50),
|
||||||
fk_energie int NOT NULL,
|
fk_energie integer NOT NULL,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
fk_user_author int NOT NULL,
|
fk_user_author integer NOT NULL,
|
||||||
|
|
||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,6 +22,6 @@
|
|||||||
|
|
||||||
create table llx_energie_compteur_groupe
|
create table llx_energie_compteur_groupe
|
||||||
(
|
(
|
||||||
fk_energie_compteur int NOT NULL,
|
fk_energie_compteur integer NOT NULL,
|
||||||
fk_energie_groupe int NOT NULL
|
fk_energie_groupe integer NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,12 +22,12 @@
|
|||||||
|
|
||||||
create table llx_energie_compteur_releve
|
create table llx_energie_compteur_releve
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_compteur int NOT NULL,
|
fk_compteur integer NOT NULL,
|
||||||
date_releve datetime,
|
date_releve datetime,
|
||||||
valeur real,
|
valeur real,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
fk_user_author int NOT NULL,
|
fk_user_author integer NOT NULL,
|
||||||
|
|
||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,10 +22,10 @@
|
|||||||
|
|
||||||
create table llx_energie_groupe
|
create table llx_energie_groupe
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
libelle varchar(100),
|
libelle varchar(100),
|
||||||
datec datetime,
|
datec datetime,
|
||||||
fk_user_author int NOT NULL,
|
fk_user_author integer NOT NULL,
|
||||||
|
|
||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
create table llx_entrepot
|
create table llx_entrepot
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
label varchar(255) UNIQUE NOT NULL,
|
label varchar(255) UNIQUE NOT NULL,
|
||||||
@ -32,9 +32,9 @@ create table llx_entrepot
|
|||||||
address varchar(255),
|
address varchar(255),
|
||||||
cp varchar(10),
|
cp varchar(10),
|
||||||
ville varchar(50),
|
ville varchar(50),
|
||||||
fk_pays int DEFAULT 0,
|
fk_pays integer DEFAULT 0,
|
||||||
statut tinyint DEFAULT 1, -- 1 ouvert, 0 fermé
|
statut tinyint DEFAULT 1, -- 1 ouvert, 0 fermé
|
||||||
valo_pmp float(12), -- valoristaion du stock en PMP
|
valo_pmp float(12), -- valoristaion du stock en PMP
|
||||||
fk_user_author int
|
fk_user_author integer
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -22,10 +22,10 @@
|
|||||||
|
|
||||||
create table llx_entrepot_valorisation
|
create table llx_entrepot_valorisation
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
tms timestamp, -- date technique mise à jour automatiquement
|
tms timestamp, -- SMALLDATETIME technique mise à jour automatiquement
|
||||||
date_calcul datetime, -- date auquel a ete calcule la valeur
|
date_calcul datetime, -- SMALLDATETIME auquel a ete calcule la valeur
|
||||||
fk_entrepot int NOT NULL ,
|
fk_entrepot integer NOT NULL ,
|
||||||
valo_pmp float(12) -- valoristaion du stock en PMP
|
valo_pmp float(12) -- valoristaion du stock en PMP
|
||||||
--key(fk_entrepot)
|
--key(fk_entrepot)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,17 +22,17 @@
|
|||||||
|
|
||||||
create table llx_expedition
|
create table llx_expedition
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
ref varchar(30) NOT NULL,
|
ref varchar(30) NOT NULL,
|
||||||
fk_commande int,
|
fk_commande integer,
|
||||||
date_creation datetime, -- date de creation
|
date_creation datetime, -- SMALLDATETIME de creation
|
||||||
date_valid datetime, -- date de validation
|
date_valid datetime, -- SMALLDATETIME de validation
|
||||||
date_expedition datetime, -- date de l'expedition
|
date_expedition datetime, -- SMALLDATETIME de l'expedition
|
||||||
fk_user_author int, -- createur
|
fk_user_author integer, -- createur
|
||||||
fk_user_valid int, -- valideur
|
fk_user_valid integer, -- valideur
|
||||||
fk_entrepot int,
|
fk_entrepot integer,
|
||||||
fk_expedition_methode int,
|
fk_expedition_methode integer,
|
||||||
fk_statut smallint DEFAULT 0,
|
fk_statut smallint DEFAULT 0,
|
||||||
note text,
|
note text,
|
||||||
model_pdf varchar(50)
|
model_pdf varchar(50)
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
create table llx_expedition_methode
|
create table llx_expedition_methode
|
||||||
(
|
(
|
||||||
rowid int PRIMARY KEY,
|
rowid integer PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
code varchar(30) NOT NULL,
|
code varchar(30) NOT NULL,
|
||||||
libelle varchar(50) NOT NULL,
|
libelle varchar(50) NOT NULL,
|
||||||
|
|||||||
@ -21,9 +21,9 @@
|
|||||||
|
|
||||||
create table llx_expeditiondet
|
create table llx_expeditiondet
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_expedition int NOT NULL,
|
fk_expedition integer NOT NULL,
|
||||||
fk_commande_ligne int NOT NULL,
|
fk_commande_ligne integer NOT NULL,
|
||||||
qty real -- quantité
|
qty real -- quantité
|
||||||
|
|
||||||
-- key(fk_expedition),
|
-- key(fk_expedition),
|
||||||
|
|||||||
@ -23,10 +23,10 @@
|
|||||||
|
|
||||||
create table llx_export_compta
|
create table llx_export_compta
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
ref varchar(12) NOT NULL,
|
ref varchar(12) NOT NULL,
|
||||||
date_export datetime NOT NULL, -- date de creation
|
date_export datetime NOT NULL, -- SMALLDATETIME de creation
|
||||||
fk_user int NOT NULL,
|
fk_user integer NOT NULL,
|
||||||
note text
|
note text
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|||||||
@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
create table llx_export_model
|
create table llx_export_model
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_user int DEFAULT 0 NOT NULL,
|
fk_user integer DEFAULT 0 NOT NULL,
|
||||||
label varchar(50) NOT NULL,
|
label varchar(50) NOT NULL,
|
||||||
type varchar(20) NOT NULL,
|
type varchar(20) NOT NULL,
|
||||||
field text NOT NULL
|
field text NOT NULL
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
create table llx_fa_pr
|
create table llx_fa_pr
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_facture int,
|
fk_facture integer,
|
||||||
fk_propal int
|
fk_propal integer
|
||||||
);
|
);
|
||||||
|
|||||||
@ -28,7 +28,7 @@ CREATE INDEX idx_facture_fk_user_valid ON llx_facture(fk_user_valid);
|
|||||||
CREATE INDEX idx_facture_fk_facture_source ON llx_facture(fk_facture_source);
|
CREATE INDEX idx_facture_fk_facture_source ON llx_facture(fk_facture_source);
|
||||||
CREATE INDEX idx_facture_fk_projet ON llx_facture(fk_projet);
|
CREATE INDEX idx_facture_fk_projet ON llx_facture(fk_projet);
|
||||||
|
|
||||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
|
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
|
||||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
||||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
|
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
|
||||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_facture_source FOREIGN KEY (fk_facture_source) REFERENCES llx_facture (rowid);
|
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_facture_source FOREIGN KEY (fk_facture_source) REFERENCES llx_facture (rowid);
|
||||||
|
|||||||
@ -22,15 +22,15 @@
|
|||||||
|
|
||||||
create table llx_facture
|
create table llx_facture
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
facnumber varchar(30) NOT NULL,
|
facnumber varchar(30) NOT NULL,
|
||||||
type smallint DEFAULT 0 NOT NULL,
|
type smallint DEFAULT 0 NOT NULL,
|
||||||
ref_client varchar(30),
|
ref_client varchar(30),
|
||||||
increment varchar(10),
|
increment varchar(10),
|
||||||
fk_soc int NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
datec datetime, -- date de creation de la facture
|
datec datetime, -- SMALLDATETIME de creation de la facture
|
||||||
datef datetime, -- date de la facture
|
datef datetime, -- SMALLDATETIME de la facture
|
||||||
date_valid datetime, -- date de validation
|
date_valid datetime, -- SMALLDATETIME de validation
|
||||||
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_percent real DEFAULT 0, -- remise relative
|
remise_percent real DEFAULT 0, -- remise relative
|
||||||
@ -46,15 +46,15 @@ create table llx_facture
|
|||||||
|
|
||||||
fk_statut smallint DEFAULT 0 NOT NULL,
|
fk_statut smallint DEFAULT 0 NOT NULL,
|
||||||
|
|
||||||
fk_user_author int, -- createur de la facture
|
fk_user_author integer, -- createur de la facture
|
||||||
fk_user_valid int, -- valideur de la facture
|
fk_user_valid integer, -- valideur de la facture
|
||||||
|
|
||||||
fk_facture_source int, -- facture origine si facture avoir
|
fk_facture_source integer, -- facture origine si facture avoir
|
||||||
fk_projet int, -- projet auquel est associée la facture
|
fk_projet integer, -- projet auquel est associée la facture
|
||||||
|
|
||||||
fk_cond_reglement int DEFAULT 1 NOT NULL, -- condition de reglement (30 jours, fin de mois ...)
|
fk_cond_reglement integer DEFAULT 1 NOT NULL, -- condition de reglement (30 jours, fin de mois ...)
|
||||||
fk_mode_reglement int, -- mode de reglement (Virement, Prélèvement)
|
fk_mode_reglement integer, -- mode de reglement (Virement, Prélèvement)
|
||||||
date_lim_reglement datetime, -- date limite de reglement
|
date_lim_reglement datetime, -- SMALLDATETIME limite de reglement
|
||||||
|
|
||||||
note text,
|
note text,
|
||||||
note_public text,
|
note_public text,
|
||||||
|
|||||||
@ -30,7 +30,7 @@ CREATE INDEX idx_facture_fourn_fk_user_author ON llx_facture_fourn(fk_user_autho
|
|||||||
CREATE INDEX idx_facture_fourn_fk_user_valid ON llx_facture_fourn(fk_user_valid);
|
CREATE INDEX idx_facture_fourn_fk_user_valid ON llx_facture_fourn(fk_user_valid);
|
||||||
CREATE INDEX idx_facture_fourn_fk_projet ON llx_facture_fourn(fk_projet);
|
CREATE INDEX idx_facture_fourn_fk_projet ON llx_facture_fourn(fk_projet);
|
||||||
|
|
||||||
ALTER TABLE llx_facture_fourn ADD CONSTRAINT fk_facture_fourn_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
|
ALTER TABLE llx_facture_fourn ADD CONSTRAINT fk_facture_fourn_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
|
||||||
ALTER TABLE llx_facture_fourn ADD CONSTRAINT fk_facture_fourn_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
ALTER TABLE llx_facture_fourn ADD CONSTRAINT fk_facture_fourn_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
||||||
ALTER TABLE llx_facture_fourn ADD CONSTRAINT fk_facture_fourn_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
|
ALTER TABLE llx_facture_fourn ADD CONSTRAINT fk_facture_fourn_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
|
||||||
ALTER TABLE llx_facture_fourn ADD CONSTRAINT fk_facture_fourn_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
|
ALTER TABLE llx_facture_fourn ADD CONSTRAINT fk_facture_fourn_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
|
||||||
|
|||||||
@ -22,12 +22,12 @@
|
|||||||
|
|
||||||
create table llx_facture_fourn
|
create table llx_facture_fourn
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
facnumber varchar(50) NOT NULL,
|
facnumber varchar(50) NOT NULL,
|
||||||
type smallint DEFAULT 0 NOT NULL,
|
type smallint DEFAULT 0 NOT NULL,
|
||||||
fk_soc int NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
datec datetime, -- date de creation de la facture
|
datec datetime, -- SMALLDATETIME de creation de la facture
|
||||||
datef datetime, -- date de la facture
|
datef datetime, -- SMALLDATETIME 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,
|
||||||
@ -40,13 +40,13 @@ create table llx_facture_fourn
|
|||||||
|
|
||||||
fk_statut smallint DEFAULT 0 NOT NULL,
|
fk_statut smallint DEFAULT 0 NOT NULL,
|
||||||
|
|
||||||
fk_user_author int, -- createur de la facture
|
fk_user_author integer, -- createur de la facture
|
||||||
fk_user_valid int, -- valideur de la facture
|
fk_user_valid integer, -- valideur de la facture
|
||||||
|
|
||||||
fk_projet int, -- projet auquel est associée la facture
|
fk_projet integer, -- projet auquel est associée la facture
|
||||||
|
|
||||||
fk_cond_reglement int DEFAULT 1 NOT NULL, -- condition de reglement (30 jours, fin de mois ...)
|
fk_cond_reglement integer DEFAULT 1 NOT NULL, -- condition de reglement (30 jours, fin de mois ...)
|
||||||
date_lim_reglement datetime, -- date limite de reglement
|
date_lim_reglement datetime, -- SMALLDATETIME limite de reglement
|
||||||
|
|
||||||
note text,
|
note text,
|
||||||
note_public text
|
note_public text
|
||||||
|
|||||||
@ -21,9 +21,9 @@
|
|||||||
|
|
||||||
create table llx_facture_fourn_det
|
create table llx_facture_fourn_det
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_facture_fourn int NOT NULL,
|
fk_facture_fourn integer NOT NULL,
|
||||||
fk_product int 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,
|
||||||
|
|||||||
@ -22,10 +22,10 @@
|
|||||||
|
|
||||||
create table llx_facture_rec
|
create table llx_facture_rec
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
titre varchar(50) NOT NULL,
|
titre varchar(50) NOT NULL,
|
||||||
fk_soc int NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
datec datetime, -- date de creation
|
datec datetime, -- SMALLDATETIME de creation
|
||||||
|
|
||||||
amount real DEFAULT 0 NOT NULL,
|
amount real DEFAULT 0 NOT NULL,
|
||||||
remise real DEFAULT 0,
|
remise real DEFAULT 0,
|
||||||
@ -35,11 +35,11 @@ create table llx_facture_rec
|
|||||||
total real DEFAULT 0,
|
total real DEFAULT 0,
|
||||||
total_ttc real DEFAULT 0,
|
total_ttc real DEFAULT 0,
|
||||||
|
|
||||||
fk_user_author int, -- createur
|
fk_user_author integer, -- createur
|
||||||
fk_projet int, -- projet auquel est associé la facture
|
fk_projet integer, -- projet auquel est associé la facture
|
||||||
fk_cond_reglement int DEFAULT 0, -- condition de reglement
|
fk_cond_reglement integer DEFAULT 0, -- condition de reglement
|
||||||
fk_mode_reglement int DEFAULT 0, -- mode de reglement (Virement, Prélèvement)
|
fk_mode_reglement integer DEFAULT 0, -- mode de reglement (Virement, Prélèvement)
|
||||||
date_lim_reglement datetime, -- date limite de reglement
|
date_lim_reglement datetime, -- SMALLDATETIME limite de reglement
|
||||||
|
|
||||||
note text,
|
note text,
|
||||||
note_public text,
|
note_public text,
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
create table llx_facture_tva_sum
|
create table llx_facture_tva_sum
|
||||||
(
|
(
|
||||||
fk_facture int NOT NULL,
|
fk_facture integer NOT NULL,
|
||||||
amount real NOT NULL,
|
amount real NOT NULL,
|
||||||
tva_tx real NOT NULL
|
tva_tx real NOT NULL
|
||||||
);
|
);
|
||||||
|
|||||||
@ -3,16 +3,16 @@
|
|||||||
-- Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
-- Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
--
|
--
|
||||||
-- 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
|
||||||
-- (at your option) any later version.
|
-- (at your option) any later version.
|
||||||
--
|
--
|
||||||
-- This program is distributed in the hope that it will be useful,
|
-- This program is distributed in the hope that it will be useful,
|
||||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
-- GNU General [public] License for more details.
|
-- GNU General Public License for more details.
|
||||||
--
|
--
|
||||||
-- You should have received a copy of the GNU General [public] License
|
-- You should have received a copy of the GNU General Public License
|
||||||
-- 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.
|
||||||
--
|
--
|
||||||
@ -22,24 +22,25 @@
|
|||||||
|
|
||||||
create table llx_facturedet
|
create table llx_facturedet
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_facture int NOT NULL,
|
fk_facture integer NOT NULL,
|
||||||
fk_product int NULL, -- Doit pouvoir etre nul pour ligne detail sans produits
|
fk_product integer NULL, -- Doit pouvoir etre nul pour ligne detail sans produits
|
||||||
description text,
|
description text,
|
||||||
tva_taux real, -- Taux tva produit/service (exemple 19.6)
|
tva_taux real, -- Taux tva produit/service (exemple 19.6)
|
||||||
qty real, -- Quantité (exemple 2)
|
qty real, -- Quantité (exemple 2)
|
||||||
remise_percent real DEFAULT 0, -- % de la remise ligne (exemple 20%)
|
remise_percent real DEFAULT 0, -- % de la remise ligne (exemple 20%)
|
||||||
remise real DEFAULT 0, -- Montant calculé de la remise % sur PU HT (exemple 20)
|
remise real DEFAULT 0, -- Montant calculé de la remise % sur PU HT (exemple 20)
|
||||||
fk_remise_except int NULL, -- Lien vers table des remises fixes
|
fk_remise_except integer NULL, -- Lien vers table des remises fixes
|
||||||
subprice real, -- P.U. HT (exemple 100)
|
subprice real, -- P.U. HT (exemple 100)
|
||||||
price real, -- P.U. HT apres remise % de ligne
|
price real, -- P.U. HT apres remise % de ligne
|
||||||
total_ht real, -- Total HT de la ligne toute quantité et incluant remise ligne et globale
|
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_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
|
total_ttc real, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale
|
||||||
date_start datetime, -- date debut si service
|
date_start datetime, -- SMALLDATETIME debut si service
|
||||||
date_end datetime, -- date fin si service
|
date_end datetime, -- SMALLDATETIME fin si service
|
||||||
info_bits int DEFAULT 0, -- TVA NPR ou non
|
info_bits integer DEFAULT 0, -- TVA NPR ou non
|
||||||
fk_code_ventilation int DEFAULT 0 NOT NULL,
|
fk_code_ventilation integer DEFAULT 0 NOT NULL,
|
||||||
fk_export_compta int DEFAULT 0 NOT NULL,
|
fk_export_compta integer DEFAULT 0 NOT NULL,
|
||||||
rang int DEFAULT 0
|
rang integer DEFAULT 0, -- ordre d'affichage
|
||||||
|
special_code tinyint DEFAULT 0 -- code pour les lignes speciales (livraison=1, ecotaxe=2)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -21,9 +21,9 @@
|
|||||||
|
|
||||||
create table llx_facturedet_rec
|
create table llx_facturedet_rec
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_facture int NOT NULL,
|
fk_facture integer NOT NULL,
|
||||||
fk_product int,
|
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é
|
||||||
|
|||||||
@ -22,4 +22,4 @@
|
|||||||
|
|
||||||
|
|
||||||
CREATE INDEX idx_fichinter_fk_soc ON llx_fichinter(fk_soc);
|
CREATE INDEX idx_fichinter_fk_soc ON llx_fichinter(fk_soc);
|
||||||
ALTER TABLE llx_fichinter ADD CONSTRAINT fk_fichinter_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
|
ALTER TABLE llx_fichinter ADD CONSTRAINT fk_fichinter_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
-- Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
--
|
--
|
||||||
-- 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
|
||||||
-- (at your option) any later version.
|
-- (at your option) any later version.
|
||||||
--
|
--
|
||||||
-- This program is distributed in the hope that it will be useful,
|
-- This program is distributed in the hope that it will be useful,
|
||||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
-- GNU General [public] License for more details.
|
-- GNU General Public License for more details.
|
||||||
--
|
--
|
||||||
-- You should have received a copy of the GNU General [public] License
|
-- You should have received a copy of the GNU General Public License
|
||||||
-- 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.
|
||||||
--
|
--
|
||||||
@ -22,18 +22,23 @@
|
|||||||
|
|
||||||
create table llx_fichinter
|
create table llx_fichinter
|
||||||
(
|
(
|
||||||
rowid int IDENTITY PRIMARY KEY,
|
rowid integer IDENTITY PRIMARY KEY,
|
||||||
fk_soc int NOT NULL,
|
fk_soc integer NOT NULL,
|
||||||
fk_projet int DEFAULT 0, -- projet auquel est rattache la fiche
|
fk_projet integer DEFAULT 0, -- projet auquel est rattache la fiche
|
||||||
|
fk_contrat integer DEFAULT 0, -- contrat auquel est rattache la fiche
|
||||||
ref varchar(30) NOT NULL, -- number
|
ref varchar(30) NOT NULL, -- number
|
||||||
datec datetime, -- date de creation
|
tms timestamp,
|
||||||
date_valid datetime, -- date de validation
|
datec datetime, -- SMALLDATETIME de creation
|
||||||
datei datetime, -- date de l'intervention
|
date_valid datetime, -- SMALLDATETIME de validation
|
||||||
fk_user_author int, -- createur de la fiche
|
datei SMALLDATETIME, -- SMALLDATETIME de livraison du bon d'intervention
|
||||||
fk_user_valid int, -- valideur de la fiche
|
fk_user_author integer, -- createur 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, -- durée totale de l'intervention
|
||||||
note text,
|
description text,
|
||||||
|
note_private text,
|
||||||
|
note_public text,
|
||||||
|
model_pdf varchar(50),
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE UNIQUE INDEX ref ON llx_fichinter(ref)
|
CREATE UNIQUE INDEX ref ON llx_fichinter(ref)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user