Dbut implmentation base MSSQL

This commit is contained in:
Regis Houssin
2007-08-17 17:45:55 +00:00
parent 2468887b8b
commit 7e2256cdcf
221 changed files with 10007 additions and 6 deletions

View File

@@ -269,9 +269,15 @@ if ($_POST["action"] == "set")
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
{
$databasefortest='mysql';
}else{
}
else if ($conf->db->type == 'pgsql')
{
$databasefortest='postgres';
}
else if ($conf->db->type == 'mssql')
{
$databasefortest='mssql';
}
// Creation handler de base, verification du support et connexion

View File

@@ -52,6 +52,7 @@ $langs->load("install");
if ($dolibarr_main_db_type == "mysql") $choix=1;
if ($dolibarr_main_db_type == "mysqli") $choix=1;
if ($dolibarr_main_db_type == "pqsql") $choix=2;
if ($dolibarr_main_db_type == "mssql") $choix=3;
dolibarr_install_syslog("etape2: Entering etape2.php page");
@@ -113,7 +114,8 @@ if ($_POST["action"] == "set")
if ($ok)
{
if ($choix==1) $dir = "../../mysql/tables/";
else $dir = "../../pgsql/tables/";
elseif ($choix==2) $dir = "../../pgsql/tables/";
elseif ($choix==3) $dir = "../../mssql/tables/";
$ok = 0;
$handle=opendir($dir);
@@ -183,7 +185,8 @@ if ($_POST["action"] == "set")
if ($ok)
{
if ($choix==1) $dir = "../../mysql/tables/";
else $dir = "../../pgsql/tables/";
elseif ($choix==2) $dir = "../../pgsql/tables/";
elseif ($choix==3) $dir = "../../mssql/tables/";
$okkeys = 0;
$handle=opendir($dir);
@@ -302,7 +305,8 @@ if ($_POST["action"] == "set")
if ($ok)
{
if ($choix==1) $dir = "../../mysql/functions/";
else $dir = "../../pgsql/functions/";
elseif ($choix==2) $dir = "../../pgsql/functions/";
elseif ($choix==3) $dir = "../../mssql/functions/";
// Cr<43>ation donn<6E>es
$file = "functions.sql";
@@ -368,7 +372,8 @@ if ($_POST["action"] == "set")
if ($ok)
{
if ($choix==1) $dir = "../../mysql/data/";
else $dir = "../../pgsql/data/";
elseif ($choix==2) $dir = "../../pgsql/data/";
elseif ($choix==3) $dir = "../../mssql/data/";
// Cr<43>ation donn<6E>es
$file = "data.sql";

View File

@@ -211,12 +211,14 @@ while (($file = readdir($handle))!==false)
if ($type=='mysql') { $versionbasemin=array(3,1,0); $testfunction='mysql_connect'; }
if ($type=='mysqli') { $versionbasemin=array(4,1,0); $testfunction='mysqli_connect'; }
if ($type=='pgsql') { $versionbasemin=array(8,1,0); $testfunction='pg_connect'; }
if ($type=='mssql') { $versionbasemin=array(2000,0,0); $testfunction='mssql_connect'; }
// Remarques
$note='';
if ($type=='mysql') $note='(Mysql >= '.versiontostring($versionbasemin).')';
if ($type=='mysqli') $note='(Mysql >= '.versiontostring($versionbasemin).')';
if ($type=='pgsql') $note='(Postgresql >= '.versiontostring($versionbasemin).')';
if ($type=='mssql') $note='(MSDE >= '.versiontostring($versionbasemin).')';
// Affiche ligne dans liste
$option.='<option value="'.$type.'" '.($defaultype==$type?" selected":"");

View File

@@ -0,0 +1,785 @@
<?php
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@cap-networks.com>
*
* 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$
*/
/**
\file htdocs/lib/mysql.lib.php
\brief Fichier de la classe permettant de g<>rer une base mysql
\author Fabien Seisen
\author Rodolphe Quiedeville.
\author Laurent Destailleur.
\version $Revision$
*/
/**
\class DoliDb
\brief Classe de gestion de la database de dolibarr
*/
class DoliDb
{
//! Handler de base
var $db;
//! Nom du gestionnaire
var $type='mssql';
//! Charset
var $forcecharset='latin1';
//! Collate
var $forcecollate='latin1_swedish_ci';
//! Version min database
var $versionmin=array(3,1,0);
//! Resultset de la derni<6E>re requete
var $results;
//! 1 si connect<63>, 0 sinon
var $connected;
//! 1 si base s<>lectionn<6E>, 0 sinon
var $database_selected;
//! Nom base s<>lectionn<6E>e
var $database_name;
//! 1 si une transaction est en cours, 0 sinon
var $transaction_opened;
//! Derniere requete ex<65>cut<75>e
var $lastquery;
//! Derniere requete ex<65>cut<75>e avec echec
var $lastqueryerror;
//! Message erreur mysql
var $lasterror;
//! Message erreur mysql
var $lasterrno;
var $ok;
var $error;
// Constantes pour conversion code erreur MSSql en code erreur g<>n<EFBFBD>rique
var $errorcode_map = array(
1004 => 'DB_ERROR_CANNOT_CREATE',
1005 => 'DB_ERROR_CANNOT_CREATE',
1006 => 'DB_ERROR_CANNOT_CREATE',
1007 => 'DB_ERROR_ALREADY_EXISTS',
1008 => 'DB_ERROR_CANNOT_DROP',
1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
1046 => 'DB_ERROR_NODBSELECTED',
1048 => 'DB_ERROR_CONSTRAINT',
2714 => 'DB_ERROR_TABLE_ALREADY_EXISTS',
1051 => 'DB_ERROR_NOSUCHTABLE',
1054 => 'DB_ERROR_NOSUCHFIELD',
1060 => 'DB_ERROR_COLUMN_ALREADY_EXISTS',
1061 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS',
2627 => 'DB_ERROR_RECORD_ALREADY_EXISTS',
1064 => 'DB_ERROR_SYNTAX',
1068 => 'DB_ERROR_PRIMARY_KEY_ALREADY_EXISTS',
1075 => 'DB_ERROR_CANT_DROP_PRIMARY_KEY',
1091 => 'DB_ERROR_NOSUCHFIELD',
1100 => 'DB_ERROR_NOT_LOCKED',
1136 => 'DB_ERROR_VALUE_COUNT_ON_ROW',
1146 => 'DB_ERROR_NOSUCHTABLE',
1216 => 'DB_ERROR_NO_PARENT',
1217 => 'DB_ERROR_CHILD_EXISTS',
1451 => 'DB_ERROR_CHILD_EXISTS'
);
/**
\brief Ouverture d'une connection vers le serveur et <20>ventuellement une database.
\param type Type de base de donn<6E>es (mysql ou pgsql)
\param host Addresse de la base de donn<6E>es
\param user Nom de l'utilisateur autoris<69>
\param pass Mot de passe
\param name Nom de la database
\param newlink ???
\return int 1 en cas de succ<63>s, 0 sinon
*/
function DoliDb($type='mssql', $host, $user, $pass, $name='', $newlink=0)
{
global $conf,$langs;
$this->transaction_opened=0;
if (! function_exists("mssql_connect"))
{
$this->connected = 0;
$this->ok = 0;
$this->error="Mssql PHP functions for using MSSql driver are not available in this version of PHP";
dolibarr_syslog("DoliDB::DoliDB : MSsql PHP functions for using MSsql driver are not available in this version of PHP");
return $this->ok;
}
if (! $host)
{
$this->connected = 0;
$this->ok = 0;
$this->error=$langs->trans("ErrorWrongHostParameter");
dolibarr_syslog("DoliDB::DoliDB : Erreur Connect, wrong host parameters");
return $this->ok;
}
// Essai connexion serveur
$this->db = $this->connect($host, $user, $pass, $name, $newlink);
if ($this->db)
{
// Si client connect<63> avec charset different de celui de la base Dolibarr
// (La base Dolibarr a <20>t<EFBFBD> forc<72>e en this->forcecharset <20> l'install)
$this->connected = 1;
$this->ok = 1;
}
else
{
// host, login ou password incorrect
$this->connected = 0;
$this->ok = 0;
dolibarr_syslog("DoliDB::DoliDB : Erreur Connect mssql_get_last_message=".mssql_get_last_message());
}
// Si connexion serveur ok et si connexion base demand<6E>e, on essaie connexion base
if ($this->connected && $name)
{
if ($this->select_db($name))
{
$this->database_selected = 1;
$this->database_name = $name;
$this->ok = 1;
}
else
{
$this->database_selected = 0;
$this->database_name = '';
$this->ok = 0;
$this->error=$this->error();
dolibarr_syslog("DoliDB::DoliDB : Erreur Select_db");
}
}
else
{
// Pas de selection de base demand<6E>e, ok ou ko
$this->database_selected = 0;
}
return $this->ok;
}
/**
\brief Selectionne une database.
\param database Nom de la database
\return boolean true si ok, false si ko
*/
function select_db($database)
{
return mssql_select_db($database, $this->db);
}
/**
\brief Connection vers le serveur
\param host addresse de la base de donn<6E>es
\param login nom de l'utilisateur autoris
\param passwd mot de passe
\param name nom de la database (ne sert pas sous mysql, sert sous pgsql)
\return resource handler d'acc<63>s <20> la base
\seealso close
*/
function connect($host, $login, $passwd, $name)
{
dolibarr_syslog("DoliDB::connect host=$host, login=$login, passwd=--hidden--, name=$name");
$this->db = @mssql_connect($host, $login, $passwd);
//force les enregistrement en latin1 si la base est en utf8 par d<>faut
// Supprim<69> car plante sur mon PHP-Mysql. De plus, la base est forcement en latin1 avec
// les nouvelles version de Dolibarr car forc<72> par l'install Dolibarr.
//$this->query('SET NAMES '.$this->forcecharset);
//print "Resultat fonction connect: ".$this->db;
return $this->db;
}
/**
\brief Renvoie la version du serveur
\return string Chaine version
*/
function getVersion()
{
return '?';
}
/**
\brief Renvoie la version du serveur dans un tableau
\return array Tableau de chaque niveau de version
*/
function getVersionArray()
{
return split('\.',$this->getVersion());
}
/**
\brief Fermeture d'une connection vers une database.
\return resource
\seealso connect
*/
function close()
{
return mssql_close($this->db);
}
/**
\brief Debut d'une transaction.
\return int 1 si ouverture transaction ok ou deja ouverte, 0 en cas d'erreur
*/
function begin()
{
if (! $this->transaction_opened)
{
$ret=$this->query("BEGIN TRANSACTION");
if ($ret) $this->transaction_opened++;
return $ret;
}
else
{
$this->transaction_opened++;
return 1;
}
}
/**
\brief Validation d'une transaction
\return int 1 si validation ok ou niveau de transaction non ouverte, 0 en cas d'erreur
*/
function commit()
{
if ($this->transaction_opened<=1)
{
$ret=$this->query("COMMIT TRANSACTION");
if ($ret) $this->transaction_opened=0;
return $ret;
}
else
{
$this->transaction_opened--;
return 1;
}
}
/**
\brief Annulation d'une transaction et retour aux anciennes valeurs
\return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
*/
function rollback()
{
dolibarr_syslog("ROLLBACK ".$this->transaction_opened, LOG_ERR);
if ($this->transaction_opened<=1)
{
$ret=$this->query("ROLLBACK TRANSACTION");
$this->transaction_opened=0;
return $ret;
}
else
{
$this->transaction_opened--;
return 1;
}
}
/**
\brief Effectue une requete et renvoi le resultset de r<>ponse de la base
\param query Contenu de la query
\return resource Resultset de la reponse
*/
function query($query)
{
$query = trim($query);
// Conversion syntaxe MySql vers MSDE.
$query = str_ireplace("now()", "getdate()", $query);
// Erreur SQL: cannot update timestamp field
$query = str_ireplace(", tms = tms", "", $query);
// Voir si l'on peut directement utiliser $query = str_ireplace("file", "[file]", $query);
// au lieu des 3 lignes ci-dessous
$query = str_ireplace(".file", ".[file]", $query);
$query = str_ireplace(" file ", " [file] ", $query);
$query = str_ireplace(" file,", " [file],", $query);
// Idem file
$query = str_ireplace(".percent", ".[percent]", $query);
$query = str_ireplace("\'", "''", $query);
$limitfound = stripos($query, " limit ");
if ($limitfound !== false) {
$number = stristr($query, " limit ");
$number = substr($number, 7);
$query = str_ireplace("select ", "select top ".$number." ", $query);
$query = str_ireplace(" limit ".$number, "", $query);
}
//print "<!--".$query."-->";
if (! $this->database_name)
{
// Ordre SQL ne n<>cessitant pas de connexion <20> une base (exemple: CREATE DATABASE)
$ret = mssql_query($query, $this->db);
}
else
{
$ret = mssql_query($query, $this->db);
}
if (! eregi("^COMMIT",$query) && ! eregi("^ROLLBACK",$query))
{
// Si requete utilisateur, on la sauvegarde ainsi que son resultset
if (! $ret)
{
$this->lastqueryerror = $query;
$result = mssql_query("SELECT @@ERROR as code", $this->db);
$row = mssql_fetch_array($result);
$this->lasterror = $this->error();
$this->lasterrno = $row["code"];
}
$this->lastquery=$query;
$this->results = $ret;
}
return $ret;
}
/**
\brief Renvoie la ligne courante (comme un objet) pour le curseur resultset.
\param resultset Curseur de la requete voulue
\return resource
*/
function fetch_object($resultset=0)
{
// Si le resultset n'est pas fourni, on prend le dernier utilis<69> sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->results; }
return mssql_fetch_object($resultset);
}
/**
\brief Renvoie les donn<6E>es dans un tableau.
\param resultset Curseur de la requete voulue
\return array
*/
function fetch_array($resultset=0)
{
// Si le resultset n'est pas fourni, on prend le dernier utilis<69> sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->results; }
return mssql_fetch_array($resultset);
}
/**
\brief Renvoie les donn<6E>es comme un tableau.
\param resultset Curseur de la requete voulue
\return array
*/
function fetch_row($resultset=0)
{
// Si le resultset n'est pas fourni, on prend le dernier utilis<69> sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->results; }
return @mssql_fetch_row($resultset);
}
/**
\brief Renvoie le nombre de lignes dans le resultat d'une requete SELECT
\see affected_rows
\param resultset Curseur de la requete voulue
\return int Nombre de lignes
*/
function num_rows($resultset=0)
{
// Si le resultset n'est pas fourni, on prend le dernier utilis<69> sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->results; }
return mssql_num_rows($resultset);
}
/**
\brief Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
\see num_rows
\param resultset Curseur de la requete voulue
\return int Nombre de lignes
*/
function affected_rows($resultset=0)
{
// Si le resultset n'est pas fourni, on prend le dernier utilis<69> sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->results; }
// mssql necessite un link de base pour cette fonction contrairement
// a pqsql qui prend un resultset
return mssql_affected_rows($this->db);
}
/**
\brief Lib<69>re le dernier resultset utilis<69> sur cette connexion.
\param resultset Curseur de la requete voulue
*/
function free($resultset=0)
{
// Si le resultset n'est pas fourni, on prend le dernier utilis<69> sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->results; }
// Si resultset en est un, on libere la m<>moire
if (is_resource($resultset)) mssql_free_result($resultset);
}
/**
\brief D<>fini les limites de la requ<71>te.
\param limit nombre maximum de lignes retourn<72>es
\param offset num<75>ro de la ligne <20> partir de laquelle recup<75>rer les lignes
\return string chaine exprimant la syntax sql de la limite
*/
function plimit($limit=0,$offset=0)
{
global $conf;
if (! $limit) $limit=$conf->liste_limit;
if ($offset > 0) return " LIMIT $offset,$limit ";
else return " LIMIT $limit ";
}
/**
\brief Formatage (par la base de donn<6E>es) d'un champ de la base au format TMS ou Date (YYYY-MM-DD HH:MM:SS)
afin de retourner une donn<6E>e toujours au format universel date TMS unix.
Fonction <20> utiliser pour g<>n<EFBFBD>rer les SELECT.
\param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS'
\return date Date au format TMS.
*/
function pdate($param)
{
return "dbo.unix_timestamp(".$param.")";
}
/**
\brief Formatage (par PHP) d'une date vers format texte pour insertion dans champ date.
Fonction <20> utiliser pour g<>n<EFBFBD>rer les INSERT.
\param param Date TMS <20> convertir
\return date Date au format texte YYYYMMDDHHMMSS.
*/
function idate($param)
{
return strftime("%Y%m%d%H%M%S",$param);
}
/**
\brief Formatage d'un if SQL
\param test chaine test
\param resok resultat si test egal
\param resko resultat si test non egal
\return string chaine format<61> SQL
*/
function ifsql($test,$resok,$resko)
{
return 'IF('.$test.','.$resok.','.$resko.')';
}
/**
\brief Renvoie la derniere requete soumise par la methode query()
\return lastquery
*/
function lastquery()
{
return $this->lastquery;
}
/**
\brief Renvoie la derniere requete en erreur
\return string lastqueryerror
*/
function lastqueryerror()
{
return $this->lastqueryerror;
}
/**
\brief Renvoie le libelle derniere erreur
\return string lasterror
*/
function lasterror()
{
return $this->lasterror;
}
/**
\brief Renvoie le code derniere erreur
\return string lasterrno
*/
function lasterrno()
{
return $this->lasterrno;
}
/**
\brief Renvoie le code erreur generique de l'operation precedente.
\return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...)
*/
function errno()
{
if (! $this->connected) {
// Si il y a eu echec de connection, $this->db n'est pas valide.
return 'DB_ERROR_FAILED_TO_CONNECT';
}
else {
if (isset($this->errorcode_map[$this->lasterrno])) {
return $this->errorcode_map[$this->lasterrno];
}
$errno=$this->lasterrno;
return ($errno?'DB_ERROR_'.$errno:'0');
}
}
/**
\brief Renvoie le texte de l'erreur mssql de l'operation precedente.
\return error_text
*/
function error()
{
if (! $this->connected) {
// Si il y a eu echec de connection, $this->db n'est pas valide pour mssql_get_last_message.
return 'Not connected. Check setup parameters in conf/conf.php file and your mssql client and server versions';
}
else {
return mssql_get_last_message($this->db);
}
}
/**
\brief R<>cup<75>re l'id gen<65>r<EFBFBD> par le dernier INSERT.
\param tab Nom de la table concern<72>e par l'insert. Ne sert pas sous mssql mais requis pour compatibilit<69> avec Postgresql
\return int id
*/
function last_insert_id($tab)
{
return query("SELECT @@identity ');
//return mssql_insert_id($this->db);
}
// Next function are not required. Only minor features use them.
//--------------------------------------------------------------
/**
\brief Renvoie l'id de la connection
\return string Id connection
*/
function getConnectId()
{
$resql=$this->query('SELECT CONNECTION_ID()');
$row=$this->fetch_row($resql);
return $row[0];
}
/**
\brief Renvoie la commande sql qui donne les droits <20> user sur toutes les tables
\param databaseuser User <20> autoriser
\return string Requete sql
*/
function getGrantForUserQuery($databaseuser)
{
/*$query = "DECLARE @tables TABLE(ROWID int IDENTITY(1,1), SQLSTR varchar(500)) INSERT INTO @tables SELECT '"
$query .= "GRANT SELECT ON '+NAME+' TO ".$databaseuser." FROM sysobjects WHERE TYPE = 'U' AND "
$query .= "NAME NOT LIKE 'SYNC%' DECLARE @rowid int, @sqlstr varchar(500) SET @rowid = 0 "
$query .= "SET @sqlstr = '' DECLARE grant_tbl_cursor CURSOR FOR SELECT ROWID, SQLSTR FROM @tables ORDER BY ROWID"
$query .= "OPEN grant_tbl_cursor FETCH NEXT FROM grant_tbl_cursor INTO @rowid,@sqlstr WHILE @@FETCH_STATUS = 0 "
$query .= "BEGIN EXECUTE (@sqlstr) FETCH NEXT FROM grant_tbl_cursor INTO @rowid,@sqlstr END CLOSE grant_tbl_cursor "
$query .= "DEALLOCATE grant_tbl_cursor"*/
return '';
}
/**
\brief Retourne le dsn pear
\return dsn
*/
function getDSN($db_type,$db_user,$db_pass,$db_host,$db_name)
{
return $db_type.'://'.$db_user.':'.$db_pass.'@'.$db_host.'/'.$db_name;
}
/**
\brief Cr<43>ation d'une nouvelle base de donn<EFBFBD>e
\param database nom de la database <EFBFBD> cr<EFBFBD>er
\return resource resource d<EFBFBD>finie si ok, null si ko
\remarks Ne pas utiliser les fonctions xxx_create_db (xxx=mssql, ...) car elles sont deprecated
On force creation de la base avec le charset forcecharset
*/
function DDLCreateDb($database)
{
// ALTER DATABASE dolibarr_db DEFAULT CHARACTER SET latin DEFAULT COLLATE latin1_swedish_ci
$sql = 'CREATE DATABASE '.$database;
$sql.= ' DEFAULT CHARACTER SET '.$this->forcecharset.' DEFAULT COLLATE '.$this->forcecollate;
$ret=$this->query($sql);
if (! $ret)
{
// On r<>essaie pour compatibilit<69> avec mssql < 5.0
$sql = 'CREATE DATABASE '.$database;
$ret=$this->query($sql);
}
return $ret;
}
/**
\brief Liste des tables dans une database.
\param database Nom de la database
\return resource
*/
function DDLListTables($database)
{
$this->results = mssql_list_tables($database, $this->db);
return $this->results;
}
/**
\brief Cr<43>e une table
\param table Nom de la table
\param fields Tableau associatif [nom champ][tableau des descriptions]
\param primary_key Nom du champ qui sera la clef primaire
\param unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
\param fulltext Tableau des Nom de champs qui seront index<65>s en fulltext
\param key Tableau des champs cl<63>s noms => valeur
\param type Type de la table
\return int <0 si KO, >=0 si OK
*/
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
{
// cl<63>s recherch<63>es dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
// ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql = "create table ".$table."(";
$i=0;
foreach($fields as $field_name => $field_desc)
{
$sqlfields[$i] = $field_name." ";
$sqlfields[$i] .= $field_desc['type'];
if( eregi("^[^ ]",$field_desc['value']))
$sqlfields[$i] .= "(".$field_desc['value'].")";
else if( eregi("^[^ ]",$field_desc['attribute']))
$sqlfields[$i] .= " ".$field_desc['attribute'];
else if( eregi("^[^ ]",$field_desc['default']))
{
if(eregi("null",$field_desc['default']))
$sqlfields[$i] .= " default ".$field_desc['default'];
else
$sqlfields[$i] .= " default '".$field_desc['default']."'";
}
else if( eregi("^[^ ]",$field_desc['null']))
$sqlfields[$i] .= " ".$field_desc['null'];
else if( eregi("^[^ ]",$field_desc['extra']))
$sqlfields[$i] .= " ".$field_desc['extra'];
$i++;
}
if($primary_key != "")
$pk = "primary key(".$primary_key.")";
if($unique_keys != "")
{
$i = 0;
foreach($unique_keys as $key => $value)
{
$sqluq[$i] = "UNIQUE KEY '".$key."' ('".$value."')";
$i++;
}
}
if($keys != "")
{
$i = 0;
foreach($keys as $key => $value)
{
$sqlk[$i] = "KEY ".$key." (".$value.")";
$i++;
}
}
$sql .= implode(',',$sqlfields);
if($primary_key != "")
$sql .= ",".$pk;
if($unique_keys != "")
$sql .= ",".implode(',',$sqluq);
if($keys != "")
$sql .= ",".implode(',',$sqlk);
$sql .=") type=".$type;
dolibarr_syslog($sql);
if(! $this -> query($sql))
return -1;
else
return 1;
}
/**
\brief d<>crit une table dans une database.
\param table Nom de la table
\param field Optionnel : Nom du champ si l'on veut la desc d'un champ
\return resource
*/
function DDLDescTable($table,$field="")
{
$sql="DESC ".$table." ".$field;
dolibarr_syslog($sql);
$this->results = $this->query($sql);
return $this->results;
}
/**
\brief Ins<6E>re un nouveau champ dans une table
\param table Nom de la table
\param field_name Nom du champ <20> ins<6E>rer
\param field_desc Tableau associatif de description duchamp <20> ins<6E>rer[nom du param<61>tre][valeur du param<61>tre]
\param field_position Optionnel ex.: "after champtruc"
\return int <0 si KO, >0 si OK
*/
function DDLAddField($table,$field_name,$field_desc,$field_position="")
{
// cl<63>s recherch<63>es dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
$sql .= $field_desc['type'];
if( eregi("^[^ ]",$field_desc['value']))
$sql .= "(".$field_desc['value'].")";
if( eregi("^[^ ]",$field_desc['attribute']))
$sql .= " ".$field_desc['attribute'];
if( eregi("^[^ ]",$field_desc['null']))
$sql .= " ".$field_desc['null'];
if( eregi("^[^ ]",$field_desc['default']))
if(eregi("null",$field_desc['default']))
$sql .= " default ".$field_desc['default'];
else
$sql .= " default '".$field_desc['default']."'";
if( eregi("^[^ ]",$field_desc['extra']))
$sql .= " ".$field_desc['extra'];
$sql .= " ".$field_position;
if(! $this -> query($sql))
return -1;
else
return 1;
}
}
?>

1095
mssql/data/data.sql Normal file

File diff suppressed because it is too large Load Diff

667
mssql/data/data_dev.sql Normal file
View File

@@ -0,0 +1,667 @@
-- ===========================================================================
-- Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2006 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$
--
-- Valeurs de test pour les developpements
-- Ne pas h<>siter a compl<70>ter ce fichier avec de nouvelles valeurs, plus on a
-- de donn<6E>es, mieux on peut tester l'appli.
-- ===========================================================================
-- ;
delete from llx_bank_account;
delete from llx_chargesociales;
delete from llx_contratdet;
delete from llx_contrat;
delete from llx_fichinter;
delete from llx_actioncomm;
delete from llx_propal;
delete from llx_propaldet;
delete from llx_paiement_facture;
delete from llx_paiement;
delete from llx_facturedet;
delete from llx_facture_tva_sum;
delete from llx_facture;
delete from llx_compta_account;
delete from llx_facture_fourn_det;
delete from llx_facture_fourn;
delete from llx_socpeople;
delete from llx_commande_fournisseur;
delete from llx_commande;
delete from llx_societe_remise_except;
delete from llx_societe;
delete from llx_boxes;
delete from llx_user_rights;
delete from llx_user;
delete from llx_tva;
delete from llx_energie_compteur;
delete from llx_energie_compteur_releve;
delete from llx_energie_compteur_groupe;
delete from llx_energie_groupe;
delete from llx_categorie_product;
delete from llx_product;
delete from llx_product_fournisseur_price;
DELETE FROM llx_const WHERE name = 'MAIN_NOT_INSTALLED';
insert into llx_tva (datep, datev, amount) values ('2001-11-11','2001-10-01', 1960.00);
insert into llx_tva (datep, datev, amount) values ('2001-04-11','2001-01-01', 2000.00);
--
-- Societe les fournisseurs sont sur les num<75>ros pairs
--
insert into llx_societe (idp,nom,address,datec,cp,ville,tel,fax, client, prefix_comm)
values (1,'Cumulo','3 place de la R<>publique',getdate(),'56610','Arradon','01 40 15 03 18','01 40 15 06 18',1,'CU');
insert into llx_societe (idp,nom,address,datec,cp,ville,tel,fax, client, prefix_comm, fournisseur, url, fk_forme_juridique)
values (2,'Bolix SA','13 rue Pierre Mend<6E>s France',getdate(),'56350','Allaire','01 40 15 03 18','01 40 15 06 18',1,'LO',1,'www.dolibarr.com',54);
insert into llx_societe (idp,nom,address,cp,ville,tel,fax,client, prefix_comm)
values (10,'Doli INC.','Rue du Port','29300','Arzano','01 55 55 03 18','01 55 55 55 55',1,'DO');
insert into llx_societe (idp,nom,address,cp,ville,tel,fax,client, prefix_comm,url, fournisseur)
values (3,'Foo SARL','3bis Avenue de la Libert<72>','22300','Ploubezre','01 55 55 03 18','01 55 55 55 55',1,'FOO','www.gnu.org', 1);
insert into llx_societe (idp,nom,address,datec,cp,ville,tel,fax, client, prefix_comm)
values (4,'Talphinfo','Place Dolores Ibarruri',getdate(),'29400','Bodilis','01 40 15 03 18','01 40 15 06 18',1,'AP');
insert into llx_societe (idp,nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values (20,'Bouleau','22800','Le Foeil','01 55 55 03 18','01 55 55 55 55',1,'BTP');
insert into llx_societe (nom,datec,cp,ville,tel,fax, client, prefix_comm)
values ('Valphanix',getdate(),'29820','Bohars','01 40 15 03 18','01 40 15 06 18',2,'AL');
insert into llx_societe (idp,nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values (101,'Cerisier','22290','Goudelin','01 55 55 03 18','01 55 55 55 55',1,'CER');
insert into llx_societe (nom,cp,ville,tel,fax,client,url)
values ('Turin','29890','Brignogan-Plage','01 55 55 03 18','01 55 55 55 55',1,'http://www.ot-brignogan-plage.fr/');
insert into llx_societe (idp,nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values (100,'Ch<EFBFBD>ne','22330','Le Gouray','01 55 55 03 18','01 55 55 55 55',1,'DEL');
insert into llx_societe (idp,nom,cp,ville,tel,fax,client)
values (5,'Yratin SA','29660','Carantec','01 55 55 03 18','01 55 55 55 55',1);
insert into llx_societe (idp,nom,cp,ville,tel,fax,client)
values (6,'Raggos SARL','29233','Cl<EFBFBD>der','01 55 55 03 18','01 55 55 55 55',1);
insert into llx_societe (idp,nom,cp,ville,tel,fax,client)
values (7,'Pruitosa','29870','Coat-M<>al','01 55 55 03 18','01 55 55 55 55',2);
insert into llx_societe (idp,nom,cp,ville,tel,fax,client)
values (8,'Stratus','29120','Combrit','01 55 55 03 18','01 55 55 55 55',2);
insert into llx_societe (idp,nom,cp,ville,tel,fax,client,address)
values (9,'Nimbus','29490','Guipavas','01 55 55 03 18','01 55 55 55 55',2,'15 rue des petites <20>curies');
insert into llx_societe (nom,cp,ville,tel,fax,client)
values ('Iono','22110','Rostrenen','01 55 55 03 18','01 55 55 55 55',2);
insert into llx_societe (nom,datec,cp,ville,tel,fax, client, prefix_comm,address)
values ('Bolan',getdate(),'29820','Bohars','01 40 15 03 18','01 40 15 06 18',2,'CAL','104 Avenue de la Marne');
insert into llx_societe (nom,datec,cp,ville,tel,fax, client, prefix_comm,address)
values ('Travail Temporaire Boharssais',getdate(),'29820','Bohars','01 40 15 03 18','01 40 15 06 18',2,'TTBOH','125 Rue des moineaux');
--
-- Utilisateurs
--
if exists(select * from llx_user where rowid = 1)
begin
update llx_user set rowid = 1,name='demo',firstname='demo',code='DEMO',login='demo',
pass='demo',webcal_login='demo',datec=getdate(),admin=0 where rowid = 1
end
else
insert into llx_user values(1,'demo','demo','DEMO','demo','demo','demo',getdate(),0)
if exists(select * from llx_user where rowid = 2)
begin
update llx_user set rowid = 2,name='demo1',firstname='demo1',code='DM1',login='demo1',
pass='demo',webcal_login='demo1',datec=getdate() where rowid = 2
end
else
insert into llx_user values(2,'demo1','demo1','DM1','demo1','demo','demo1',getdate())
if exists(select * from llx_user where rowid = 3)
begin
update llx_user set rowid = 3,name='demo2',firstname='demo2',code='DM2',login='demo2',
pass='demo',webcal_login='demo2',datec=getdate() where rowid = 3
end
else
insert into llx_user values (3,'demo2','demo2','DM2','demo2','demo','demo2',getdate())
--
-- Facture fournisseurs
--
insert into llx_facture_fourn (facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
values ('LOL-509',1,'2001-05-09','2001-05-09',1,1000,0,196,1196,1,1,1,'');
insert into llx_facture_fourn (facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
values ('LOL-510',1,'2001-09-09','2001-09-09',1,100,0,19.6,119.6,1,1,1,'');
insert into llx_facture_fourn (facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
values ('02-1-YHGT',2,getdate(),'2002-01-01',1,100,0,19.6,119.6,1,NULL,NULL,'');
insert into llx_facture_fourn (facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
values ('02-5-YHGT',2,getdate(),'2002-05-01',1,1000,0,196,1196,1,NULL,NULL,'');
insert into llx_facture_fourn (facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
values ('02-10-YHGT',2,getdate(),'2002-10-01',1,1000,0,196,1196,1,NULL,NULL,'');
insert into llx_facture_fourn (facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
values ('02-11-YHGT',2,getdate(),'2002-11-01',1,1000,0,196,1196,1,NULL,NULL,'');
insert into llx_facture_fourn (facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
values ('02-12-YHGT',2,getdate(),'2002-12-01',1,1000,0,196,1196,1,NULL,NULL,'');
DELETE FROM llx_const WHERE name = 'MAIN_THEME'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_THEME', 'eldy_backoffice','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_MENUFRONT_BARRELEFT'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_MENUFRONT_BARRELEFT', 'eldy_frontoffice','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_MENUFRONT_BARRETOP'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_MENUFRONT_BARRETOP', 'eldy_frontoffice','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_MENU_BARRELEFT'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_MENU_BARRELEFT', 'eldy_backoffice','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_MENU_BARRETOP'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_MENU_BARRETOP', 'eldy_backoffice','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_SOCIETE_NOM'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_SOCIETE_NOM','Barridol','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_SOCIETE_ADRESSE'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_SOCIETE_ADRESSE','10 road street','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_SOCIETE_CP'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_SOCIETE_CP','75000','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_SOCIETE_VILLE'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_SOCIETE_VILLE','BigTown','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_SOCIETE_PAYS'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_SOCIETE_PAYS','1','chaine',0);
DELETE FROM llx_const WHERE name = '<EFBFBD>MAIN_INFO_SOCIETE_TEL'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_SOCIETE_TEL','01 02 03 04 05','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_SOCIETE_FAX'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_SOCIETE_FAX','01 02 03 04 06','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_SOCIETE_WEB'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_SOCIETE_WEB','www.dolibarr.org','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_SOCIETE_MAIL'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_SOCIETE_MAIL','mycompany@mycompany.com','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_TVAINTRA'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_TVAINTRA','12345679012345','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_CAPITAL'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_CAPITAL','15000','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_SIREN'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_SIREN','123456789','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_SIRET'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_SIRET','123456789001','chaine',0);
DELETE FROM llx_const WHERE name = 'MAIN_INFO_APE'
INSERT INTO llx_const (name, value, type, visible) VALUES ('MAIN_INFO_APE','721Z','chaine',0);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,11);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,12);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,13);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,14);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,15);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,16);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,17);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,18);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,19);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,21);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,22);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,23);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,24);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,25);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,26);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,27);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,28);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,29);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,31);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,32);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,33);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,34);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,35);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,36);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,37);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,38);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,39);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,41);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,42);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,43);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,44);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,45);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,46);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,47);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,48);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,49);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,61);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,62);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,63);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,64);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,65);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,66);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,67);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,68);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,69);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,71);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,72);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,73);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,74);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,75);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,76);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,77);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,78);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,79);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,81);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,82);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,83);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,84);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,85);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,86);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,87);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,88);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,89);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,91);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,92);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,93);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,94);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,95);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,96);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,97);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,98);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,99);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,101);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,102);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,103);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,104);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,105);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,106);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,107);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,108);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,109);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,111);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,112);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,113);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,114);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,115);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,116);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,117);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,118);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,119);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,121);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,122);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,123);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,124);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,125);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,126);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,127);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,128);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,129);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,161);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,162);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,163);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,164);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,165);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,166);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,167);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,168);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,169);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,221);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,222);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,223);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,224);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,225);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,226);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,227);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,228);
INSERT INTO llx_user_rights (fk_user, fk_id) VALUES (1,229);
--
-- Boites
--
INSERT INTO llx_boxes VALUES (8, 1, 0, 1);
INSERT INTO llx_boxes VALUES (9, 2, 0, 2);
INSERT INTO llx_boxes VALUES (11, 4, 0, 4);
INSERT INTO llx_boxes VALUES (12, 5, 0, 5);
INSERT INTO llx_boxes VALUES (13, 6, 0, 6);
INSERT INTO llx_boxes VALUES (14, 7, 0, 7);
INSERT INTO llx_boxes VALUES (15, 14, 0, 4);
INSERT INTO llx_boxes VALUES (17, 26, 0, 11);
INSERT INTO llx_boxes VALUES (18, 22, 0, 8);
INSERT INTO llx_boxes VALUES (19, 23, 0, 9);
INSERT INTO llx_boxes VALUES (20, 24, 0, 10);
INSERT INTO llx_boxes VALUES (21, 25, 0, 7);
INSERT INTO llx_boxes VALUES (24, 20, 0, 1);
INSERT INTO llx_boxes VALUES (25, 21, 0, 2);
--
-- Contact
--
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email,poste)
values (10,1,'Mar<EFBFBD>chal','Ferdinand','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net','Administrateur syst<73>me');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (11,5,'Pejat','Jean-Marie','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email,poste)
values (12,1,'Poulossi<EFBFBD>re','Paul','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net','Directeur technique');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (13,6,'Myriam','Isabelle','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (20,2,'Corin','Arnaud','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (30,3,'Philippine','Sagan','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (31,3,'Marie','Jeanne','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (41,4,'Alix','Hopper','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (14,7,'Victoire','Renoir','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (15,7,'Baudelaire','Matthias','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (16,8,'Hugo','Benjamin','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (17,9,'Rembrandt','St<EFBFBD>phanie','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (18,10,'Picasso','Myriam','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (19,1,'Beethoven','John','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (22,6,'Dumas','Elisabeth','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into llx_socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (21,10,'','Jos<EFBFBD>phine','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
--
--
-- Produits
--
--
insert into llx_product (ref, label, description, price, tva_tx)
values ('RJ451MR','C<EFBFBD>ble R<>seaux RJ45 1m rouge','C<EFBFBD>ble R<>seaux RJ45 1m rouge',10,19.6);
insert into llx_product (ref, label, description, price, tva_tx)
values ('RJ454M','C<EFBFBD>ble R<>seaux RJ45 4m','C<EFBFBD>ble R<>seaux RJ45 4m\n couleur suivant stock',19.5,19.6);
insert into llx_product (ref, label, description, price, tva_tx)
values ('RJ452M','C<EFBFBD>ble R<>seaux RJ45 2m','C<EFBFBD>ble R<>seaux RJ45 2m',10,19.6);
insert into llx_product (ref, label, description, price, tva_tx)
values ('RJ458M','C<EFBFBD>ble R<>seaux RJ45 8m','C<EFBFBD>ble R<>seaux RJ45 8m',10,19.6);
insert into llx_product (ref, label, description, price, tva_tx)
values ('RJ4515M','C<EFBFBD>ble R<>seaux RJ45 15m','C<EFBFBD>ble R<>seaux RJ45 15m',10,19.6);
insert into llx_product (ref, label, description, price, tva_tx, fk_product_type, duration)
values ('HEB12MS','H<EFBFBD>bergement serveur 12 mois','H<EFBFBD>bergement serveur 12 mois',2400,19.6,1,'12m');
insert into llx_product (ref, label, description, price, tva_tx, fk_product_type, duration)
values ('HEB03MS','H<EFBFBD>bergement serveur 3 mois','H<EFBFBD>bergement serveur 3 mois',600,19.6,1,'3m');
insert into llx_product (ref, label, description, price, tva_tx, fk_product_type, duration)
values ('HEB06MS','H<EFBFBD>bergement serveur 6 mois','H<EFBFBD>bergement serveur 6 mois',1200,19.6,1,'6m');
insert into llx_product (ref, label, description, price, tva_tx)
values ('SW8','Switch 8 ports 100Mbits','Switch 8 ports 100Mbits',1000,19.6);
insert into llx_product (ref, label, description, price, tva_tx)
values ('SER1U','Serveur 1U Serie 3W','Serveur avec 1G de RAM et 2 processeurs',9750,19.6);
insert into llx_product (ref, label, description, price, tva_tx)
values ('HUB8-10','Hub 8 ports 10Mbits','Hub 8 ports',750,19.6);
insert into llx_product (ref, label, description, price, tva_tx)
values ('PB-16','Pan. Brass. 16','Panneau de brassage extensible, incluant 1 barre de 16 prises',650,19.6);
insert into llx_product (ref, label, description, price, tva_tx)
values ('PB-32','Pan. Brass. 32','Panneau de brassage extensible, incluant 2 barres de 16 prises',1200,19.6);
insert into llx_product (ref, label, description, price, tva_tx)
values ('HB-USB1','Hub Usb 4 ports','Hub USB 4 ports avec bloc d''alimentation ind<6E>pendant',31,19.6);
--
-- Liens produits fournisseurs
--
insert into llx_product_fournisseur (datec, fk_product,fk_soc,ref_fourn,fk_user_author)
values (getdate(),1,2,'2313487',1);
insert into llx_product_fournisseur (datec, fk_product,fk_soc,ref_fourn,fk_user_author)
values (getdate(),2,2,'2313409',1);
insert into llx_product_fournisseur (datec, fk_product,fk_soc,ref_fourn,fk_user_author)
values (getdate(),3,2,'2323134',1);
insert into llx_product_fournisseur (datec, fk_product,fk_soc,ref_fourn,fk_user_author)
values (getdate(),3,4,'2313784',1);
--
-- Fichinter
--
--
insert into llx_fichinter (fk_soc, ref, datec, date_valid, datei, fk_user_author, fk_user_valid, fk_statut, duree, note)
values (1, 'FI-LP-1','2001-12-05','2001-12-05','2001-12-05',1,1,1,4,'Mise <20> jour de la doc');
--
-- Actions commerciales
--
insert into llx_actioncomm (datea, fk_action,fk_soc,fk_user_author,fk_user_action,fk_contact)
values ('2002-04-06',1,1,1,1,10);
insert into llx_actioncomm (datea, fk_action,fk_soc,fk_user_author,fk_user_action,fk_contact)
values ('2002-04-05',2,1,1,1,12);
insert into llx_actioncomm (datea, fk_action,fk_soc,fk_user_author,fk_user_action,fk_contact)
values ('2002-04-05',1,1,1,2,10);
insert into llx_actioncomm (datea, fk_action,fk_soc,fk_user_author,fk_user_action,fk_contact)
values ('2002-04-02',3,1,1,1,13);
insert into llx_actioncomm (datea, fk_action,fk_soc,fk_user_author,fk_user_action,fk_contact)
values ('2002-04-02',3,1,1,1,13);
insert into llx_actioncomm (datea, fk_action,fk_soc,fk_user_author,fk_user_action,fk_contact)
values ('2002-03-05',3,1,1,1,13);
insert into llx_actioncomm (datea, fk_action,fk_soc,fk_user_author,fk_user_action,fk_contact)
values ('2002-03-04',1,1,1,1,11);
insert into llx_actioncomm (datea, fk_action,fk_soc,fk_user_author,fk_user_action,fk_contact)
values ('2001-03-05',1,1,1,1,11);
--
--
--
--
insert into llx_societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm,datec)
values ('Peuplier','22300','Lanm<EFBFBD>rin','01 55 55 03 18','01 55 55 55 55',1,'JP',getdate());
insert into llx_societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm,datec)
values ('Poirier','22290','Lannebert','01 55 55 03 18','01 55 55 55 55',1,'PO',getdate());
insert into llx_societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('Orme','22400','Noyal','01 55 55 03 18','01 55 55 55 55',1,'ORM');
insert into llx_societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('Pin','22200','Pabu','01 55 55 03 18','01 55 55 55 55',1,'PIN');
insert into llx_societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('Merisier','22510','Penguily','01 55 55 03 18','01 55 55 55 55',1,'IKE');
insert into llx_societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('H<EFBFBD>tre','22480','Peumerit-Quintin','01 55 55 03 18','01 55 55 55 55',1,'CAS');
insert into llx_societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('Saule','22800','Quintin','01 55 55 03 18','01 55 55 55 55',1,'ME');
insert into llx_societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('Tek','22300','Rospez','01 55 55 03 18','01 55 55 55 55',1,'LMT');
--
--
--
--
insert into llx_compta_account (datec, number, label, fk_user_author) values (getdate(),'431000','URSSAF',1);
insert into llx_compta_account (datec, number, label, fk_user_author) values (getdate(),'654000','Clients',1);
--
-- Charges sociales
--
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
('2002-05-15',NULL,'Acompte 1er Trimestre 2002',1,120,0,'2002-1-1');
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
('2002-05-15',NULL,'Acompte 1er Trimestre 2002',2,200,0,'2002-1-1');
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
('2002-05-15',NULL,'Acompte 1er Trimestre 2002',3,170,0,'2002-1-1');
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
('2002-02-15','2002-02-10','Acompte 4<>me Trimestre 2001',1,120,1,'2001-10-1');
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
('2002-02-15','2002-02-10','Acompte 4<>me Trimestre 2001',2,200,1,'2001-10-1');
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
('2002-02-15','2002-02-10','Acompte 4<>me Trimestre 2001',3,170,1,'2001-10-1');
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
('2001-11-15','2001-10-10','Acompte 3<>me Trimestre 2001',1,70,1,'2001-7-1');
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
('2001-11-15','2001-10-10','Acompte 3<>me Trimestre 2001',2,180,1,'2001-7-1');
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
('2001-11-15','2001-10-10','Acompte 3<>me Trimestre 2001',3,150,1,'2001-7-1');
-- MySQL dump 9.09
--
-- Host: localhost Database: dolibarr
-- -------------------------------------------------------
-- Server version 4.0.15-log
--
-- Dumping data for table llx_bank
--
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-01-13','2002-01-13',4000,'D<EFBFBD>p<EFBFBD>t liquide',1,1,1,'DEP',200201,NULL,1,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-01-14','2002-01-14',-20,'Liquide',1,1,1,'CB',200201,NULL,1,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-02-14','2002-02-14',-23.2,'Essence',1,1,1,'CB',200201,NULL,1,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-02-15','2002-02-15',-53.32,'Cartouches imprimante',1,1,1,'CB',200202,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-02-17','2002-02-17',-100,'Liquide',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-02-18','2002-02-18',-153.32,'Restaurant',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-02-20','2002-02-20',-1532,'R<EFBFBD>paration climatisation',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-02-21','2002-02-21',-100,'Liquide',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-02-22','2002-02-22',-46,'Timbres postes',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-03-02','2002-03-02',-60,'Liquide',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-03-02','2002-03-02',-25.66,'Essence',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-03-03','2002-03-03',-60,'Liquide',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-03-04','2002-03-04',-15.2,'Caf<EFBFBD>',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-03-06','2002-03-06',-12.3,'P<EFBFBD>age',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-03-06','2002-03-06',-25.3,'P<EFBFBD>age',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-03-06','2002-03-06',-9.6,'Tickets de bus',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
INSERT INTO llx_bank (datec, datev, dateo, amount, label, fk_account, fk_user_author, fk_user_rappro, fk_type, num_releve, num_chq, rappro, note, author)
VALUES (getdate(),'2002-03-13','2002-03-13',-10,'Liquide',1,1,NULL,'CB',NULL,NULL,0,NULL,NULL);
-- MySQL dump 9.09
--
-- Host: localhost Database: dolibarr
-- -------------------------------------------------------
-- Server version 4.0.15-log
--
-- Dumping data for table llx_bank_account
--
INSERT INTO llx_bank_account (rowid, datec, tms, label, bank, code_banque, code_guichet, number, cle_rib, bic, iban_prefix, domiciliation, courant, clos) VALUES (1,'2001-01-01 13:06:11',20031014173428,'CCP','La PosteToto','','','','','','','',1,0);
--
-- Energie
--
INSERT INTO llx_energie_compteur VALUES (1,'EDF Vitr<74>',1,getdate(),1,'');
INSERT INTO llx_energie_compteur VALUES (2,'Eau Vitr<74>',2,getdate(),1,'');
INSERT INTO llx_energie_compteur VALUES (3,'Gaz Vitr<74>',3,getdate(),1,'');
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-07-26',1139);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-07-21',1129);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-07-16',1128);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-07-11',1128);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-07-06',1128);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-07-01',1127);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-06-26',1127);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-06-21',1126);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-06-16',1116);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-06-11',1107);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-06-06',1097);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-06-01',1087);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-05-26',1078);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-05-21',1068);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-05-16',1059);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-05-11',1049);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-05-06',1038);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-05-01',1028);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-04-26',1013);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-04-21',1003);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-04-16',984);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-04-11',965);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-04-06',945);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-04-01',926);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-03-26',906);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-03-21',884);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-03-16',862);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-03-11',841);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-03-06',828);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-03-01',807);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-02-26',785);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-02-21',760);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-02-16',737);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-02-11',713);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-02-06',688);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-02-01',662);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-01-26',637);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-01-21',605);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-01-16',575);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-01-11',545);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-01-06',510);
INSERT INTO llx_energie_compteur_releve (fk_compteur, date_releve,valeur) VALUES (1,'2005-01-01',480);

View File

@@ -0,0 +1,65 @@
-- MySQL dump 8.21
--
-- Host: localhost Database: dolibarr
-- -------------------------------------------------------
-- Server version 3.23.49-log
--
-- Dumping data for table 'llx_paiement'
--
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (1,1,'2002-05-09 03:05:03','2001-05-19 12:00:00',11960,'rodo',0,'321654654','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (2,2,'2002-05-09 03:18:10','2002-04-12 12:00:00',500,'rodo',0,'255555','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (3,2,'2002-05-09 03:18:32','2002-05-02 12:00:00',588.36,'rodo',0,'25555','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (4,3,'2002-05-09 03:21:43','2002-03-30 12:00:00',11.96,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (5,4,'2002-05-09 03:23:47','2002-02-20 12:00:00',11960,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (6,5,'2002-05-09 03:37:05','2002-02-09 12:00:00',23.92,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (7,6,'2002-05-09 03:40:58','2002-05-09 12:00:00',35.88,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (8,8,'2002-05-09 14:44:56','2002-03-12 12:00:00',5000,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (9,7,'2002-05-09 14:49:51','2002-05-09 12:00:00',23920,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (10,8,'2002-05-09 15:00:35','2002-05-09 12:00:00',9483.56,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (11,9,'2002-05-09 15:02:36','2002-05-09 12:00:00',43355,'rodo',0,'','');
--
-- Dumping data for table 'llx_facture'
--
insert into llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
values (1,'F-BO-010509',1,'2001-05-09 03:04:48','2001-05-09',1,10000,0,1960,11960,1,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
VALUES (2,'F-DO-020410',3,'2002-05-09 03:17:44','2002-04-10',1,910,100,178.36,1088.36,1,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
VALUES (3,'F-BO-020314',1,'2002-05-09 03:21:25','2002-03-14',1,10,0,1.96,11.96,1,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
VALUES (4,'F-CU-020215',2,'2002-05-09 03:23:31','2002-02-15',1,10000,0,1960,11960,1,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
VALUES (5,'F-BO-020117',1,'2002-05-09 03:36:43','2002-01-17',1,20,0,3.92,23.92,1,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
VALUES (6,'F-BO-020119',1,'2002-05-09 03:40:26','2002-05-09',1,30,0,5.88,35.88,1,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
VALUES (7,'F-CU-020509',2,'2002-05-09 03:46:54','2002-05-09',1,20000,0,3920,23920,1,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
VALUES (8,'F-FOO-020309',4,'2002-05-09 14:44:34','2002-03-09',1,12110,0,2373.56,14483.56,1,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
VALUES (9,'F-CU-020509.1',2,'2002-05-09 15:02:08','2002-05-09',1,36250,0,7105,43355,1,NULL,NULL,'');
insert into llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
values (10,'F-BO-010310',1,'2001-03-10 03:04:48','2001-03-10',1,20000,0,3920,13920,1,NULL,NULL,'');
insert into llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
VALUES (11,'F-DO-010410',3,'2001-04-10 03:17:44','2001-04-10',1,910,100,178.36,1088.36,1,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
VALUES (12,'F-BO-010117',1,'2001-05-09 03:36:43','2001-01-17',1,20,0,3.92,23.92,1,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
VALUES (13,'F-CU-010509.1',2,'2001-05-09 15:02:08','2001-05-09',1,36250,0,7105,43355,1,NULL,NULL,'');

59
mssql/data/propal_dev.sql Normal file
View File

@@ -0,0 +1,59 @@
-- MySQL dump 8.21
--
-- Host: localhost Database: dolibarr
-- -------------------------------------------------------
-- Server version 3.23.49-log
--
-- Dumping data for table 'llx_propal'
--
INSERT INTO llx_propal (rowid, fk_soc, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES ( 1,1,0,'PR-BO-020509','2002-05-09 03:04:29','2002-05-09 03:04:37','2002-05-09 03:04:42','2002-05-09',1,1,1,2,10000,0,1960,11960,'');
INSERT INTO llx_propal (rowid, fk_soc, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES ( 2,1,0,'PR-BO-020111','2002-05-09 03:08:33','2002-05-09 03:36:25','2002-05-09 03:36:29','2002-01-11',1,1,1,2,20,0,3.92,23.92,'');
INSERT INTO llx_propal (rowid, fk_soc, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES ( 3,1,0,'PR-BO-020113','2002-05-09 03:08:50','2002-05-09 03:40:09','2002-05-09 03:40:13','2002-01-13',1,1,1,2,30,0,5.88,35.88,'');
INSERT INTO llx_propal (rowid, fk_soc, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES ( 4,1,0,'PR-BO-020313','2002-05-09 03:09:13','2002-05-09 03:21:06','2002-05-09 03:21:10','2002-03-13',1,1,1,2,10,0,1.96,11.96,'');
INSERT INTO llx_propal (rowid, fk_soc, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES ( 5,1,0,'PR-BO-020313.1','2002-05-09 03:09:28','2002-05-09 03:42:09','2002-05-09 03:42:15','2002-03-13',1,1,1,3,20,0,3.92,23.92,'');
INSERT INTO llx_propal (rowid, fk_soc, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES ( 6,3,0,'PR-DO-020404','2002-05-09 03:16:26','2002-05-09 03:17:04','2002-05-09 03:17:13','2002-04-04',1,1,1,3,1010,0,197.96,1207.96,'');
INSERT INTO llx_propal (rowid, fk_soc, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES ( 7,3,0,'PR-DO-020405','2002-05-09 03:16:51','2002-05-09 03:17:24','2002-05-09 03:17:28','2002-04-05',1,1,1,2,1010,100,178.36,1088.36,'');
INSERT INTO llx_propal (rowid, fk_soc, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES ( 8,2,0,'PR-CU-020202','2002-05-09 03:22:49','2002-05-09 03:23:00','2002-05-09 03:23:05','2002-02-02',1,1,1,2,10000,0,1960,11960,'');
INSERT INTO llx_propal (rowid, fk_soc, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES ( 9,2,0,'PR-CU-020409','2002-05-09 03:46:39','2002-05-09 03:46:45','2002-05-09 03:46:50','2002-04-09',1,1,1,2,20000,0,3920,23920,'');
INSERT INTO llx_propal (rowid, fk_soc, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (10,4,0,'PR-FOO-020509','2002-05-09 14:43:47','2002-05-09 15:07:19','2002-05-09 15:07:23','2002-05-09',1,1,1,2,12110,0,2373.56,14483.56,'');
INSERT INTO llx_propal (rowid, fk_soc, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (11,4,0,'PR-FOO-020304','2002-05-09 14:44:08','2002-05-09 14:44:18','2002-05-09 14:44:22','2002-03-04',1,1,1,2,12110,0,2373.56,14483.56,'');
INSERT INTO llx_propal (rowid, fk_soc, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (12,2,0,'PR-CU-020509','2002-05-09 15:01:37','2002-05-09 15:01:45','2002-05-09 15:01:49','2002-05-09',1,1,1,2,36250,0,7105,43355,'');
-- MySQL dump 8.21
--
-- Host: localhost Database: dolibarr
-- -------------------------------------------------------
-- Server version 3.23.49-log
--
-- Dumping data for table 'llx_propaldet'
--
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (1,1,2,10,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (2,2,1,2,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (3,3,1,3,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (4,4,1,1,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (5,5,1,2,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (6,6,1,1,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (7,6,2,1,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (8,7,1,1,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (9,7,2,1,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (10,8,2,10,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (11,9,2,20,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (12,10,2,1,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (13,10,3,1,9750);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (14,10,1,16,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (15,10,6,1,1200);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (16,11,2,1,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (17,11,3,1,9750);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (18,11,1,16,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (19,11,6,1,1200);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (20,12,3,3,9750);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (21,12,2,1,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (22,12,6,5,1200);

Binary file not shown.

View File

@@ -0,0 +1,78 @@
-- ============================================================================
-- Copyright (C) 2007 Regis Houssin <regis.houssin@cap-networks.com>
-- Copyright (C) 2007 Simon Desee <simon@dedisoft.com>
--
-- 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$
--
-- ============================================================================
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
-- FILLZERO du number
CREATE TRIGGER llx_bordereau_cheque_number
ON 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
GO
CREATE FUNCTION unix_timestamp
(
@Date datetime
)
RETURNS datetime
AS
BEGIN
DECLARE @Result int
--SET @Result = NULL
--IF @Date IS NOT NULL SET @Result = DATEDIFF(s, '19700101', @Date)
RETURN @Date;
END
GO
CREATE FUNCTION from_unixtime
(
@Epoch int
)
RETURNS datetime
AS
BEGIN
RETURN DATEADD(s, @Epoch, '19700101');
END
GO

View File

@@ -0,0 +1,27 @@
-- ============================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2006 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$
-- ===========================================================================
CREATE INDEX idx_accountingaccount_fk_pcg_version On llx_accountingaccount(fk_pcg_version);
ALTER TABLE llx_accountingaccount ADD CONSTRAINT fk_accountingaccount_fk_pcg_version FOREIGN KEY (fk_pcg_version) REFERENCES llx_accountingsystem (pcg_version);

View File

@@ -0,0 +1,31 @@
-- ============================================================================
-- Copyright (C) 2004-2006 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$
-- ============================================================================
create table llx_accountingaccount
(
rowid int IDENTITY PRIMARY KEY,
fk_pcg_version varchar(12) NOT NULL,
pcg_type varchar(20) NOT NULL,
pcg_subtype varchar(20) NOT NULL,
label varchar(128) NOT NULL,
account_number varchar(20) NOT NULL,
account_parent varchar(20)
);

View File

@@ -0,0 +1,28 @@
-- ============================================================================
-- Copyright (C) 2004-2006 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$
-- ============================================================================
create table llx_accountingdebcred
(
fk_transaction int NOT NULL,
fk_account int NOT NULL,
amount real NOT NULL,
direction varchar(1) NOT NULL
);

View File

@@ -0,0 +1,31 @@
-- ============================================================================
-- Copyright (C) 2004-2006 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$
-- ============================================================================
create table llx_accountingsystem
(
pcg_version varchar(12) PRIMARY KEY,
fk_pays int NOT NULL,
label varchar(128) NOT NULL,
datec varchar(12) NOT NULL,
fk_author varchar(20),
tms timestamp,
active smallint DEFAULT 0
);

View File

@@ -0,0 +1,33 @@
-- ============================================================================
-- Copyright (C) 2004-2006 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$
-- ============================================================================
create table llx_accountingtransaction
(
rowid int IDENTITY PRIMARY KEY,
label varchar(128) NOT NULL,
datec datetime NOT NULL,
fk_author varchar(20) NOT NULL,
tms timestamp,
fk_facture int,
fk_facture_fourn int,
fk_paiement int,
fk_paiement_fourn int
);

View File

@@ -0,0 +1,33 @@
-- ===================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
-- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
--
-- 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$
--
-- ===================================================================
create table llx_action_def
(
rowid int NOT NULL PRIMARY KEY,
code varchar(25) UNIQUE NOT NULL,
tms timestamp,
titre varchar(255) NOT NULL,
description text,
objet_type varchar(14) check (objet_type in ('ficheinter','facture','propale','mailing','order_supplier'))
);

View File

@@ -0,0 +1,27 @@
-- ============================================================================
-- 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$
--
-- ===========================================================================
CREATE INDEX idx_actioncomm_datea ON llx_actioncomm(datea);
CREATE INDEX idx_actioncomm_fk_soc ON llx_actioncomm(fk_soc);
CREATE INDEX idx_actioncomm_fk_contact ON llx_actioncomm(fk_contact);
CREATE INDEX idx_actioncomm_fk_facture ON llx_actioncomm(fk_facture);

View File

@@ -0,0 +1,60 @@
-- ========================================================================
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- Actions commerciales
--
-- ========================================================================
create table llx_actioncomm
(
id int IDENTITY PRIMARY KEY,
datec datetime, -- date creation
datep datetime, -- date debut planifiee
datep2 datetime, -- date fin planifiee si action non ponctuelle
datea datetime, -- date debut realisation
datea2 datetime, -- date fin realisation si action non ponctuelle
tms timestamp, -- date modif
fk_action int, -- type de l'action
label varchar(50) NOT NULL, -- libelle de l'action
fk_project int,
fk_soc int,
fk_contact int,
fk_parent int NOT NULL default 0,
fk_user_action int, -- id de la personne qui doit effectuer l'action
fk_user_author int, -- id de la personne qui a effectuer l'action
priority smallint,
punctual smallint NOT NULL default 1,
[percent] smallint NOT NULL default 0,
durationp real, -- duree planifiee
durationa real, -- duree reellement passee
note text,
propalrowid int,
fk_commande int,
fk_facture int
);

View File

@@ -0,0 +1,62 @@
-- ===================================================================
-- Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
-- Copyright (C) 2006 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$
--
-- ===================================================================
--
-- statut
-- -1 : brouillon
-- 0 : resilie
-- 1 : valide
create table llx_adherent
(
rowid int IDENTITY PRIMARY KEY,
nom varchar(50),
prenom varchar(50),
login varchar(50) NOT NULL, -- login
pass varchar(50), -- password
fk_adherent_type smallint,
morphy varchar(3) check (morphy in ('mor','phy')) NOT NULL, -- personne morale / personne physique
societe varchar(50),
adresse text,
cp varchar(30),
ville varchar(50),
pays varchar(50),
email varchar(255),
phone varchar(30),
phone_perso varchar(30),
phone_mobile varchar(30),
naiss datetime, -- date de naissance
photo varchar(255), -- url vers photo
statut smallint NOT NULL DEFAULT 0,
[public] smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils [public] ou pas ?
datefin datetime, -- date de fin de validit<69> de la cotisation
note text,
datevalid datetime, -- date de validation
datec datetime, -- date de creation
tms timestamp, -- date de modification
fk_user_author int NOT NULL,
fk_user_mod int NOT NULL,
fk_user_valid int NOT NULL,
);
CREATE UNIQUE INDEX login ON llx_adherent(login)

View File

@@ -0,0 +1,31 @@
-- ===================================================================
-- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
--
-- 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$
--
-- ===================================================================
create table llx_adherent_options
(
optid int IDENTITY PRIMARY KEY,
tms timestamp,
adhid int NOT NULL, -- id de l'adherent auquel correspond ces attributs optionnel
);
CREATE UNIQUE INDEX adhid ON llx_adherent_options(adhid)

View File

@@ -0,0 +1,29 @@
-- ===================================================================
-- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
--
-- 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$
--
-- ===================================================================
create table llx_adherent_options_label
(
name varchar(64) PRIMARY KEY, -- nom de l'attribut
tms timestamp,
label varchar(255) NOT NULL -- label correspondant a l'attribut
);

View File

@@ -0,0 +1,38 @@
-- ===================================================================
-- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
--
-- 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$
--
-- ===================================================================
--
-- statut
-- 0 : actif
-- 1 : inactif
create table llx_adherent_type
(
rowid int IDENTITY PRIMARY KEY,
tms timestamp,
statut smallint NOT NULL DEFAULT 0,
libelle varchar(50),
cotisation varchar(3) check (cotisation in ('yes','no')) NOT NULL DEFAULT 'yes',
vote varchar(3) check (vote in ('yes','no')) DEFAULT 'yes',
note text,
mail_valid text -- mail envoye a la validation
);

View File

@@ -0,0 +1,33 @@
-- ============================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ============================================================================
create table llx_appro
(
rowid int IDENTITY PRIMARY KEY,
datec datetime,
tms timestamp,
fk_product int NOT NULL,
quantity smallint NOT NULL,
price real,
fk_user_author int
);

44
mssql/tables/llx_bank.sql Normal file
View File

@@ -0,0 +1,44 @@
-- ===================================================================
-- Copyright (C) 2000-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ===================================================================
create table llx_bank
(
rowid int IDENTITY PRIMARY KEY,
datec datetime,
datev datetime, -- date de valeur
dateo datetime, -- date operation
amount real NOT NULL default 0,
label varchar(255),
fk_account int,
fk_user_author int,
fk_user_rappro int,
fk_type varchar(4), -- CB, Virement, cheque
num_releve varchar(50),
num_chq int,
rappro tinyint default 0,
note text,
fk_bordereau int DEFAULT 0,
banque varchar(255), -- banque pour les cheques
emetteur varchar(255), -- emetteur du cheque
author varchar(40) -- a supprimer apres migration
);

View File

@@ -0,0 +1,24 @@
-- ============================================================================
-- 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$
--
-- ============================================================================
ALTER TABLE llx_bank_account add constraint uk_bank_account_label UNIQUE (label);

View File

@@ -0,0 +1,54 @@
-- =============================================================================
-- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004-2006 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$
--
--
-- courant : type de compte: 0 epargne, 1 courant, 2 caisse
-- clos : le compte est-il clos ou encore ouvert
--
-- =============================================================================
create table llx_bank_account
(
rowid int IDENTITY PRIMARY KEY,
datec datetime,
tms timestamp,
ref varchar(12) NOT NULL,
label varchar(30) NOT NULL,
bank varchar(60),
code_banque varchar(7),
code_guichet varchar(6),
number varchar(255),
cle_rib varchar(5),
bic varchar(11),
iban_prefix varchar(5),
domiciliation varchar(255),
proprio varchar(60),
adresse_proprio varchar(255),
courant smallint DEFAULT 0 NOT NULL,
clos smallint DEFAULT 0 NOT NULL,
rappro smallint DEFAULT 1,
url varchar(128),
account_number varchar(8),
currency_code varchar(2) NOT NULL,
min_allowed int DEFAULT 0,
min_desired int DEFAULT 0,
comment varchar(254)
);

View File

@@ -0,0 +1,25 @@
-- ===================================================================
-- $Id$
-- $Source$
--
-- 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.
--
-- ===================================================================
create table llx_bank_categ
(
rowid int IDENTITY PRIMARY KEY,
label varchar(255)
);

View File

@@ -0,0 +1,27 @@
-- ===================================================================
-- $Id$
-- $Source$
--
-- 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.
--
-- ===================================================================
create table llx_bank_class
(
lineid int NOT NULL,
fk_categ int NOT NULL,
);
CREATE INDEX lineid ON llx_bank_class(lineid)

View File

@@ -0,0 +1,26 @@
-- ===================================================================
-- Copyright (C) 2005-2007 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$
--
-- ===================================================================
CREATE UNIQUE INDEX uk_bank_url ON llx_bank_url(fk_bank,type);
--ALTER TABLE llx_bank_url ADD INDEX idx_bank_url_fk_bank (fk_bank);

View File

@@ -0,0 +1,32 @@
-- ===================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2007 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$
--
-- ===================================================================
create table llx_bank_url
(
rowid int IDENTITY PRIMARY KEY,
fk_bank int,
url_id int,
url varchar(255),
label varchar(255),
type varchar(12) check (type in ('company','payment','member','subscription','donation','sc','payment_sc'))
);

View File

@@ -0,0 +1,25 @@
-- ===================================================================
-- 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$
--
-- ===================================================================
CREATE UNIQUE INDEX uk_bookmark_url ON llx_bookmark(fk_user, url);
CREATE UNIQUE INDEX uk_bookmark_title ON llx_bookmark(fk_user, title);

View File

@@ -0,0 +1,31 @@
-- ===================================================================
-- $Id$
-- $Source$
--
-- 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.
--
-- ===================================================================
create table llx_bookmark
(
rowid int IDENTITY PRIMARY KEY,
fk_soc int,
fk_user int NOT NULL,
dateb datetime,
url varchar(128) NOT NULL,
target varchar(16),
title varchar(64),
favicon varchar(24)
);

View File

@@ -0,0 +1,31 @@
-- ============================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ===========================================================================
create table llx_bookmark4u_login
(
rowid int IDENTITY PRIMARY KEY,
fk_user int,
bk4u_uid int,
);
CREATE UNIQUE INDEX fk_user ON llx_bookmark4u_login(fk_user)

View File

@@ -0,0 +1,66 @@
-- ===================================================================
-- Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ===================================================================
--
-- Bordereaux de remise de cheque
--
create table llx_bordereau_cheque
(
rowid int IDENTITY PRIMARY KEY,
datec datetime,
date_bordereau datetime,
number varchar(5),
amount float(12),
nbcheque smallint DEFAULT 0,
fk_bank_account int,
fk_user_author int,
note text,
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

View File

@@ -0,0 +1,30 @@
-- ===================================================================
-- Copyright (C) 2006 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$
-- ===================================================================
-- Supprimme orphelins pour permettre mont<6E>e de la cl<63>
-- V4 DELETE llx_boxes FROM llx_boxes LEFT JOIN llx_boxes_def ON llx_boxes.box_id = llx_boxes_def.rowid WHERE llx_boxes_def.rowid IS NULL;
CREATE INDEX idx_boxes_boxid ON llx_boxes(box_id);
ALTER TABLE llx_boxes ADD CONSTRAINT fk_boxes_box_id FOREIGN KEY (box_id) REFERENCES llx_boxes_def (rowid);
CREATE INDEX idx_boxes_fk_user ON llx_boxes(fk_user);

View File

@@ -0,0 +1,35 @@
-- ============================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2006 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$
--
-- ===========================================================================
--
-- position : 0=index.php
-- box_order : Box sort order
--
create table llx_boxes
(
rowid int IDENTITY PRIMARY KEY,
box_id int NOT NULL,
position smallint NOT NULL,
box_order smallint default 0 NOT NULL,
fk_user int default 0 NOT NULL
);

View File

@@ -0,0 +1,29 @@
-- ============================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ===========================================================================
create table llx_boxes_def
(
rowid int IDENTITY PRIMARY KEY,
name varchar(255) NOT NULL,
[file] varchar(255) NOT NULL,
note text
);

View File

@@ -0,0 +1,33 @@
-- ========================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
create table llx_c_actioncomm
(
id int PRIMARY KEY,
code varchar(12) UNIQUE NOT NULL,
type varchar(10) DEFAULT 'system' NOT NULL,
libelle varchar(30) NOT NULL,
module varchar(16) DEFAULT NULL,
active tinyint DEFAULT 1 NOT NULL,
todo tinyint
);

View File

@@ -0,0 +1,32 @@
-- ========================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
create table llx_c_ape
(
rowid int IDENTITY PRIMARY KEY,
code_ape varchar(5) NOT NULL,
libelle varchar(255),
active tinyint DEFAULT 1 NOT NULL,
);
CREATE UNIQUE INDEX code_ape ON llx_c_ape(code_ape)

View File

@@ -0,0 +1,33 @@
-- ========================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 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$
--
-- ========================================================================
create table llx_c_chargesociales
(
id int IDENTITY PRIMARY KEY,
libelle varchar(80),
deductible smallint DEFAULT 0 NOT NULL,
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,30 @@
-- ========================================================================
-- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
-- Copyright (C) 2004 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$
-- ========================================================================
create table llx_c_civilite
(
rowid int PRIMARY KEY,
code varchar(6) UNIQUE NOT NULL,
civilite varchar(50),
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,24 @@
-- ========================================================================
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
CREATE UNIQUE INDEX uk_c_currencies_code_iso ON llx_c_currencies(code_iso);

View File

@@ -0,0 +1,30 @@
-- ========================================================================
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
create table llx_c_currencies
(
code varchar(2) PRIMARY KEY,
code_iso varchar(3) NOT NULL,
label varchar(64),
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,27 @@
-- ============================================================================
-- 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$
--
-- ============================================================================
CREATE UNIQUE INDEX uk_departements ON llx_c_departements(code_departement,fk_region);
CREATE INDEX idx_departements_fk_region ON llx_c_departements(fk_region);

View File

@@ -0,0 +1,37 @@
-- ========================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
create table llx_c_departements
(
rowid int IDENTITY PRIMARY KEY,
code_departement varchar(6) NOT NULL,
fk_region int,
cheflieu varchar(7),
tncc int,
ncc varchar(50),
nom varchar(50),
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,31 @@
-- ========================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
create table llx_c_effectif
(
id int PRIMARY KEY,
code varchar(12) UNIQUE NOT NULL,
libelle varchar(30),
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,33 @@
-- ========================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 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$
--
-- ========================================================================
create table llx_c_forme_juridique
(
rowid int IDENTITY PRIMARY KEY,
code varchar(12) UNIQUE NOT NULL,
fk_pays int NOT NULL,
libelle varchar(255),
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,32 @@
-- ========================================================================
-- Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
create table llx_c_methode_commande_fournisseur
(
rowid int IDENTITY PRIMARY KEY,
code varchar(30),
libelle varchar(60),
active tinyint default 1 NOT NULL,
);
CREATE UNIQUE INDEX code ON llx_c_methode_commande_fournisseur(code)

View File

@@ -0,0 +1,40 @@
-- ========================================================================
-- Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 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$
--
-- ========================================================================
--
-- Type :
--
-- 0 : entr<74>e d'argent
-- 1 : sortie d'argent
-- 2 : entr<74>e ou sortie d'argent
create table llx_c_paiement
(
id int PRIMARY KEY,
code varchar(6) UNIQUE NOT NULL,
libelle varchar(30),
type smallint,
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,26 @@
-- ========================================================================
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
CREATE UNIQUE INDEX idx_c_pays_code ON llx_c_pays(code);
CREATE UNIQUE INDEX idx_c_pays_code_iso ON llx_c_pays(code_iso);
CREATE UNIQUE INDEX idx_c_pays_libelle ON llx_c_pays(libelle);

View File

@@ -0,0 +1,31 @@
-- ========================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
create table llx_c_pays
(
rowid int PRIMARY KEY,
code varchar(2) NOT NULL,
code_iso varchar(3) ,
libelle varchar(50) NOT NULL,
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,31 @@
-- ===================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ===================================================================
create table llx_c_propalst
(
id smallint PRIMARY KEY,
code varchar(12) UNIQUE NOT NULL,
label varchar(30),
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,26 @@
-- ========================================================================
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
CREATE INDEX idx_c_regions_fk_pays ON llx_c_regions(fk_pays);
ALTER TABLE llx_c_regions ADD CONSTRAINT fk_c_regions_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_pays (rowid);

View File

@@ -0,0 +1,34 @@
-- ========================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
create table llx_c_regions
(
rowid int IDENTITY PRIMARY KEY,
code_region int UNIQUE NOT NULL,
fk_pays int NOT NULL,
cheflieu varchar(7),
tncc int,
nom varchar(50),
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,31 @@
-- ========================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
create table llx_c_stcomm
(
id int PRIMARY KEY,
code varchar(12) UNIQUE NOT NULL,
libelle varchar(30),
active tinyint default 1 NOT NULL
);

View File

@@ -0,0 +1,33 @@
-- ========================================================================
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ========================================================================
create table llx_c_tva
(
rowid int NOT NULL IDENTITY PRIMARY KEY,
fk_pays int NOT NULL,
taux FLOAT(25) NOT NULL,
recuperableonly int NOT NULL DEFAULT 0,
note varchar(128),
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,33 @@
-- ========================================================================
-- Copyright (C) 2005 Patrick Rouillon <patrick.rouillon.net>
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- Defini les types de contact d'un element sert de reference pour
-- la table llx_element_contact
--
-- element est le nom de la table utilisant le type de contact.
-- i.e. contact, facture, projet, societe (sans le llx_ devant).
-- Libelle est un texte d<>crivant le type de contact.
-- active pr<70>cide si cette valeur est active ou 'archiv<69>'.
--
-- ========================================================================
CREATE UNIQUE INDEX idx_c_type_contact_uk ON llx_c_type_contact(element, source, code);

View File

@@ -0,0 +1,41 @@
-- ========================================================================
-- Copyright (C) 2005 Patrick Rouillon <patrick.rouillon.net>
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- Defini les types de contact d'un element sert de reference pour
-- la table llx_element_contact
--
-- element est le nom de la table utilisant le type de contact.
-- i.e. contact, facture, projet, societe (sans le llx_ devant).
-- Libelle est un texte d<>crivant le type de contact.
-- active pr<70>cide si cette valeur est active ou 'archiv<69>'.
--
-- ========================================================================
create table llx_c_type_contact
(
rowid int PRIMARY KEY,
element varchar(30) NOT NULL,
source varchar(8) DEFAULT 'external' NOT NULL,
code varchar(16) NOT NULL,
libelle varchar(64) NOT NULL,
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,30 @@
-- ========================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 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$
--
-- ========================================================================
create table llx_c_typent
(
id int PRIMARY KEY,
code varchar(12) UNIQUE NOT NULL,
libelle varchar(30),
active tinyint DEFAULT 1 NOT NULL
);

View File

@@ -0,0 +1,20 @@
-- ============================================================================
-- Copyright (C) 2007 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.
--
-- ============================================================================
CREATE INDEX uk_categorie_ref ON llx_categorie(label);

View File

@@ -0,0 +1,31 @@
-- ============================================================================
-- Copyright (C) 2005 Brice Davoleau <e1davole@iu-vannes.fr>
-- Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
-- Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
--
-- 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$
--
-- ============================================================================
create table llx_categorie
(
rowid int IDENTITY PRIMARY KEY,
label VARCHAR(255), -- nom de la cat<61>gorie
description text, -- description de la cat<61>gorie
visible tinyint DEFAULT 1 NOT NULL -- determine si les produits sont visible ou pas
);

View File

@@ -0,0 +1,27 @@
-- ============================================================================
-- Copyright (C) 2005 Brice Davoleau <e1davole@iu-vannes.fr>
-- Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.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.
--
-- ============================================================================
CREATE INDEX idx_categorie_association_fk_categorie_mere ON llx_categorie_association(fk_categorie_mere);
CREATE INDEX idx_categorie_association_fk_categorie_fille ON llx_categorie_association(fk_categorie_fille);
ALTER TABLE llx_categorie_association ADD CONSTRAINT fk_categorie_asso_fk_categorie_mere FOREIGN KEY (fk_categorie_mere) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_association ADD CONSTRAINT fk_categorie_asso_fk_categorie_fille FOREIGN KEY (fk_categorie_fille) REFERENCES llx_categorie (rowid);

View File

@@ -0,0 +1,25 @@
-- ============================================================================
-- Copyright (C) 2005 Brice Davoleau <e1davole@iu-vannes.fr>
-- Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
--
-- 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.
--
-- ============================================================================
create table llx_categorie_association
(
fk_categorie_mere int NOT NULL,
fk_categorie_fille int NOT NULL
);

View File

@@ -0,0 +1,28 @@
-- ============================================================================
-- Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ============================================================================
create table llx_categorie_fournisseur
(
fk_categorie int NOT NULL,
fk_societe int NOT NULL,
UNIQUE (fk_categorie, fk_societe)
);

View File

@@ -0,0 +1,27 @@
-- ============================================================================
-- Copyright (C) 2005 Brice Davoleau <e1davole@iu-vannes.fr>
-- Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.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.
--
-- ============================================================================
ALTER TABLE llx_categorie_product ADD PRIMARY KEY (fk_categorie, fk_product);
CREATE INDEX idx_categorie_product_fk_categorie ON llx_categorie_product(fk_categorie);
CREATE INDEX idx_categorie_product_fk_product ON llx_categorie_product(fk_product);
ALTER TABLE llx_categorie_product ADD CONSTRAINT fk_categorie_product_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_product ADD CONSTRAINT fk_categorie_product_product_rowid FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);

View File

@@ -0,0 +1,25 @@
-- ============================================================================
-- Copyright (C) 2005 Brice Davoleau <e1davole@iu-vannes.fr>
-- Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
--
-- 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.
--
-- ============================================================================
create table llx_categorie_product
(
fk_categorie int NOT NULL,
fk_product int NOT NULL
);

View File

@@ -0,0 +1,35 @@
-- ========================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ========================================================================
create table llx_chargesociales
(
rowid int IDENTITY PRIMARY KEY,
date_ech datetime NOT NULL, -- date d'echeance
libelle varchar(80),
fk_type int,
amount real default 0 NOT NULL,
paye smallint default 0 NOT NULL,
periode datetime
);

View File

@@ -0,0 +1,30 @@
-- ===================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
-- ===================================================================
create table llx_co_fa
(
rowid int IDENTITY PRIMARY KEY,
fk_commande int NOT NULL,
fk_facture int NOT NULL
--key(fk_commande),
--key(fk_facture)
);

View File

@@ -0,0 +1,27 @@
-- ===================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
-- ===================================================================
create table llx_co_pr
(
rowid int IDENTITY PRIMARY KEY,
fk_commande int,
fk_propale int
);

View File

@@ -0,0 +1,36 @@
-- ===================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
--
-- 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$
-- ===================================================================
create table llx_comfourn_facfourn
(
rowid int IDENTITY PRIMARY KEY,
fk_commande int NOT NULL,
fk_facture int NOT NULL,
);
CREATE NONCLUSTERED INDEX llx_comfourn_facfourn ON dbo.llx_comfourn_facfourn
(
fk_commande,
fk_facture
)
WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

View File

@@ -0,0 +1,29 @@
-- ============================================================================
-- Copyright (C) 2006 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$
--
-- ============================================================================
-- Supprimme orphelins pour permettre mont<6E>e de la cl<63>
-- V4 DELETE llx_commande FROM llx_commande LEFT JOIN llx_societe ON llx_commande.fk_soc = llx_societe.idp WHERE llx_societe.idp IS NULL;
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);

View File

@@ -0,0 +1,60 @@
-- ===================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ===================================================================
create table llx_commande
(
rowid int IDENTITY PRIMARY KEY,
tms timestamp,
fk_soc int NOT NULL,
fk_projet int DEFAULT 0, -- projet auquel est rattache la commande
ref varchar(30) NOT NULL, -- order number
ref_client varchar(30), -- customer order number
date_creation datetime, -- date de creation
date_valid datetime, -- date de validation
date_cloture datetime, -- date de cloture
date_commande datetime, -- date de la commande
fk_user_author int, -- createur de la commande
fk_user_valid int, -- valideur de la commande
fk_user_cloture int, -- auteur cloture
source smallint NOT NULL,
fk_statut smallint default 0,
amount_ht real default 0,
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,
note text,
note_public text,
model_pdf varchar(50),
facture tinyint default 0,
fk_cond_reglement int, -- condition de r<>glement
fk_mode_reglement int, -- mode de r<>glement
date_livraison datetime default NULL,
fk_adresse_livraison int, -- adresse de livraison
);
CREATE UNIQUE INDEX ref ON llx_commande(ref)

View File

@@ -0,0 +1,29 @@
-- ============================================================================
-- Copyright (C) 2006 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$
--
-- ============================================================================
-- Supprimme orphelins pour permettre mont<6E>e de la cl<63>
-- V4 DELETE llx_commande_fournisseur FROM llx_commande_fournisseur LEFT JOIN llx_societe ON llx_commande_fournisseur.fk_soc = llx_societe.idp WHERE llx_societe.idp IS NULL;
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);

View File

@@ -0,0 +1,54 @@
-- ===================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ===================================================================
create table llx_commande_fournisseur
(
rowid int IDENTITY PRIMARY KEY,
tms timestamp,
fk_soc int NOT NULL,
fk_projet int DEFAULT 0, -- projet auquel est rattache la commande
ref varchar(30) NOT NULL, -- order number
date_creation datetime, -- date de creation
date_valid datetime, -- date de validation
date_cloture datetime, -- date de cloture
date_commande datetime, -- date de la commande
fk_user_author int, -- createur de la commande
fk_user_valid int, -- valideur de la commande
fk_user_cloture int, -- auteur cloture
source smallint NOT NULL,
fk_statut smallint default 0,
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,
note text,
note_public text,
model_pdf varchar(50),
fk_methode_commande int default 0,
);
CREATE UNIQUE INDEX ref ON llx_commande_fournisseur(ref)

View File

@@ -0,0 +1,22 @@
-- ===================================================================
-- Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
-- ===================================================================
CREATE INDEX fk_commande ON llx_commande_fournisseur_dispatch(fk_commande);

View File

@@ -0,0 +1,31 @@
-- ===================================================================
-- Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
-- ===================================================================
create table llx_commande_fournisseur_dispatch
(
rowid int IDENTITY PRIMARY KEY,
fk_commande int,
fk_product int,
qty float, -- quantit<69>
fk_entrepot int,
fk_user int,
datec datetime
);

View File

@@ -0,0 +1,31 @@
-- ===================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ===================================================================
create table llx_commande_fournisseur_log
(
rowid int IDENTITY PRIMARY KEY,
tms timestamp,
datelog datetime NOT NULL,
fk_commande int NOT NULL,
fk_statut smallint NOT NULL,
fk_user int NOT NULL
);

View File

@@ -0,0 +1,36 @@
-- ===================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
-- ===================================================================
create table llx_commande_fournisseurdet
(
rowid int IDENTITY PRIMARY KEY,
fk_commande int,
fk_product int,
ref varchar(50),
label varchar(255),
description text,
tva_tx real DEFAULT 19.6, -- taux tva
qty real, -- quantit<69>
remise_percent real DEFAULT 0, -- pourcentage de remise
remise real DEFAULT 0, -- montant de la remise
subprice real, -- prix avant remise
price real -- prix final
);

View File

@@ -0,0 +1,28 @@
-- ===================================================================
-- Copyright (C) 2006 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$
-- ===================================================================
-- Supprimme orhpelins pour permettre mont<6E>e de la cl<63>
-- V4 DELETE llx_commandedet FROM llx_commandedet LEFT JOIN llx_commande ON llx_commandedet.fk_commande = llx_commande.rowid WHERE llx_commande.rowid IS NULL;
CREATE INDEX idx_commandedet_fk_commande ON llx_commandedet(fk_commande);
-- V4 ALTER TABLE llx_commandedet ADD CONSTRAINT fk_commandedet_fk_commande FOREIGN KEY (fk_commande) REFERENCES llx_commande (rowid);

View File

@@ -0,0 +1,49 @@
-- ===================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2006 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$
-- ===================================================================
create table llx_commandedet
(
rowid int IDENTITY PRIMARY KEY,
fk_commande int,
fk_product int,
description text,
tva_tx real, -- taux tva
qty real, -- quantit<69>
remise_percent real DEFAULT 0, -- pourcentage de remise
remise real DEFAULT 0, -- montant de la remise
fk_remise_except int 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<69> et incluant remise ligne et globale
total_tva real, -- Total TVA de la ligne toute quantit<69> et incluant remise ligne et globale
total_ttc real, -- Total TTC de la ligne toute quantit<69> et incluant remise ligne et globale
info_bits int DEFAULT 0, -- TVA NPR ou non
coef real, -- coefficient de marge
special_code tinyint DEFAULT 0, -- code pour les lignes speciales
rang int DEFAULT 0
);
--
-- Liste des codes pour special_code
--
-- 1 : frais de port
--

View File

@@ -0,0 +1,36 @@
-- ===================================================================
-- Copyright (C) 2000-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ===================================================================
create table llx_compta
(
rowid int IDENTITY PRIMARY KEY,
datec datetime,
datev datetime, -- date de valeur
amount real DEFAULT 0 NOT NULL ,
label varchar(255),
fk_compta_account int,
fk_user_author int,
fk_user_valid int,
valid tinyint DEFAULT 0,
note text
);

View File

@@ -0,0 +1,32 @@
-- ===================================================================
-- Copyright (C) 2000-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- ===================================================================
create table llx_compta_account
(
rowid int IDENTITY PRIMARY KEY,
datec datetime,
number varchar(12),
label varchar(255),
fk_user_author int,
note text
);

View File

@@ -0,0 +1,33 @@
-- ===================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ===================================================================
create table llx_compta_compte_generaux
(
rowid int IDENTITY PRIMARY KEY,
date_creation datetime,
numero varchar(50),
intitule varchar(255),
fk_user_author int,
note text,
UNIQUE(numero)
);

View File

@@ -0,0 +1,34 @@
-- ============================================================================
-- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ============================================================================
create table llx_cond_reglement
(
rowid int PRIMARY KEY,
code varchar(16),
sortorder smallint,
active tinyint DEFAULT 1,
libelle varchar(255),
libelle_facture text,
fdm tinyint, -- reglement fin de mois
nbjour smallint,
decalage smallint
);

View File

@@ -0,0 +1,37 @@
-- ============================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
--
-- 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$
--
-- ===========================================================================
--
-- Definitions des constantes utilis<69>s comme parametres de configuration
--
create table llx_const
(
rowid int IDENTITY PRIMARY KEY,
name varchar(255),
value text, -- max 65535 caracteres
type varchar(6) check (type in ('yesno','texte','chaine')),
visible tinyint DEFAULT 1 NOT NULL,
note text,
);
CREATE UNIQUE INDEX name ON llx_const(name)

View File

@@ -0,0 +1,34 @@
-- ============================================================================
-- Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004-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$
--
-- ============================================================================
-- Supprimme orhpelins pour permettre mont<6E>e de la cl<63>
-- V4 DELETE llx_contratdet FROM llx_contratdet, llx_contrat LEFT JOIN llx_societe ON llx_contrat.fk_soc = llx_societe.idp WHERE llx_contratdet.fk_contrat = llx_contrat.rowid AND llx_societe.idp IS NULL;
-- V4 DELETE llx_contrat FROM llx_contrat LEFT JOIN llx_societe ON llx_contrat.fk_soc = llx_societe.idp WHERE llx_societe.idp IS NULL;
-- V4 DELETE llx_contrat FROM llx_contrat LEFT JOIN llx_user ON llx_contrat.fk_user_author = llx_user.rowid WHERE llx_user.rowid IS NULL;
CREATE INDEX idx_contrat_fk_soc ON llx_contrat(fk_soc);
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_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);

View File

@@ -0,0 +1,45 @@
-- ============================================================================
-- Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004-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$
--
-- ============================================================================
create table llx_contrat
(
rowid int IDENTITY PRIMARY KEY,
ref varchar(30), -- reference de contrat
tms timestamp,
datec datetime, -- date de creation de l'enregistrement
date_contrat datetime,
statut smallint DEFAULT 0,
mise_en_service datetime,
fin_validite datetime,
date_cloture datetime,
fk_soc int NOT NULL,
fk_projet int,
fk_commercial_signature int NOT NULL, -- obsolete
fk_commercial_suivi int NOT NULL, -- obsolete
fk_user_author int NOT NULL default 0,
fk_user_mise_en_service int,
fk_user_cloture int,
note text,
note_public text
);

View File

@@ -0,0 +1,32 @@
-- ============================================================================
-- Copyright (C) 2004 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$
--
-- ============================================================================
CREATE INDEX idx_contratdet_fk_contrat ON llx_contratdet(fk_contrat);
CREATE INDEX idx_contratdet_fk_product ON llx_contratdet(fk_product);
CREATE INDEX idx_contratdet_date_ouverture_prevue ON llx_contratdet(date_ouverture_prevue);
CREATE INDEX idx_contratdet_date_ouverture ON llx_contratdet(date_ouverture);
CREATE INDEX idx_contratdet_date_fin_validite ON llx_contratdet(date_fin_validite);
ALTER TABLE llx_contratdet ADD CONSTRAINT fk_contratdet_fk_contrat FOREIGN KEY (fk_contrat) REFERENCES llx_contrat (rowid);
ALTER TABLE llx_contratdet ADD CONSTRAINT fk_contratdet_fk_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);

View File

@@ -0,0 +1,59 @@
-- ============================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ============================================================================
create table llx_contratdet
(
rowid int IDENTITY PRIMARY KEY,
tms timestamp,
fk_contrat int NOT NULL,
fk_product int NULL, -- doit pouvoir etre nul pour ligne detail sans produits
statut smallint DEFAULT 0,
label text, -- libell<6C> du produit
description text,
date_commande datetime,
date_ouverture_prevue datetime,
date_ouverture datetime, -- date d'ouverture du service chez le client
date_fin_validite datetime,
date_cloture datetime,
tva_tx real DEFAULT 19.6, -- taux tva
qty real, -- quantit<69>
remise_percent real DEFAULT 0, -- pourcentage de remise
remise real DEFAULT 0, -- montant de la remise
fk_remise_except int NULL, -- Lien vers table des remises fixes
subprice real, -- prix avant remise
price_ht real, -- prix final
total_ht real, -- Total HT de la ligne toute quantit<69> et incluant remise ligne et globale
total_tva real, -- Total TVA de la ligne toute quantit<69> et incluant remise ligne et globale
total_ttc real, -- Total TTC de la ligne toute quantit<69> et incluant remise ligne et globale
info_bits int DEFAULT 0, -- TVA NPR ou non
fk_user_author int NOT NULL default 0,
fk_user_ouverture int,
fk_user_cloture int,
commentaire text
);

View File

@@ -0,0 +1,26 @@
-- ============================================================================
-- Copyright (C) 2006 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$
--
-- ============================================================================
CREATE INDEX idx_contratdet_log_fk_contratdet ON llx_contratdet_log(fk_contratdet);
CREATE INDEX idx_contratdet_log_date ON llx_contratdet_log(date);
ALTER TABLE llx_contratdet_log ADD CONSTRAINT fk_contratdet_log_fk_contratdet FOREIGN KEY (fk_contratdet) REFERENCES llx_contratdet (rowid);

View File

@@ -0,0 +1,33 @@
-- ============================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ============================================================================
create table llx_contratdet_log
(
rowid int IDENTITY PRIMARY KEY,
tms timestamp,
fk_contratdet int NOT NULL,
date datetime NOT NULL,
statut smallint NOT NULL,
fk_user_author int NOT NULL,
commentaire text
);

View File

@@ -0,0 +1,32 @@
-- ===================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
-- ===================================================================
create table llx_cotisation
(
rowid int IDENTITY PRIMARY KEY,
tms timestamp,
datec datetime,
fk_adherent int,
dateadh datetime,
cotisation real,
fk_bank int DEFAULT NULL,
note text
);

View File

@@ -0,0 +1,35 @@
-- ============================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ============================================================================
create table llx_deplacement
(
rowid int IDENTITY PRIMARY KEY,
datec datetime NOT NULL,
tms timestamp,
dated datetime,
fk_user int NOT NULL,
fk_user_author int,
type smallint NOT NULL,
km smallint,
fk_soc int,
note text
);

View File

@@ -0,0 +1,33 @@
-- ===================================================================
-- Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
-- ===================================================================
create table llx_document
(
rowid int IDENTITY PRIMARY KEY,
name varchar(255) NOT NULL,
file_name varchar(255) NOT NULL,
file_extension varchar(5) NOT NULL,
date_generation datetime NULL,
fk_owner int NULL,
fk_group int NULL,
permissions char(9) DEFAULT 'rw-rw-rw'
);

View File

@@ -0,0 +1,29 @@
-- ===================================================================
-- Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
-- ===================================================================
create table llx_document_generator
(
rowid int NOT NULL PRIMARY KEY,
name varchar(255) NOT NULL,
classfile varchar(255) NOT NULL,
class varchar(255) NOT NULL
);

View File

@@ -0,0 +1,24 @@
-- ===================================================================
-- Copyright (C) 2007 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$
--
-- ===================================================================
CREATE UNIQUE INDEX uk_document_model ON llx_document_model(nom,type);

View File

@@ -0,0 +1,33 @@
-- ===================================================================
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2006 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$
--
-- Liste des modeles de document disponibles
--
-- ===================================================================
create table llx_document_model
(
rowid int IDENTITY PRIMARY KEY,
nom varchar(50),
type varchar(20) NOT NULL,
libelle varchar(255),
description text
);

View File

@@ -0,0 +1,32 @@
-- ========================================================================
-- Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ========================================================================
create table llx_dolibarr_modules
(
numero int PRIMARY KEY,
active tinyint DEFAULT 0 NOT NULL,
active_date datetime NOT NULL,
active_version varchar(25) NOT NULL
);

View File

@@ -0,0 +1,30 @@
-- ===================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ===================================================================
create table llx_domain
(
rowid int IDENTITY PRIMARY KEY,
datec datetime,
label varchar(255),
note text
);

45
mssql/tables/llx_don.sql Normal file
View File

@@ -0,0 +1,45 @@
-- ===================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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$
--
-- ===================================================================
create table llx_don
(
rowid int IDENTITY PRIMARY KEY,
tms timestamp,
fk_statut smallint NOT NULL DEFAULT 0,-- etat du don promesse/valid
datec datetime, -- date de cr<63>ation de l'enregistrement
datedon datetime, -- date du don/promesse
amount real DEFAULT 0,
fk_paiement int,
prenom varchar(50),
nom varchar(50),
societe varchar(50),
adresse text,
cp varchar(30),
ville varchar(50),
pays varchar(50),
email varchar(255),
[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_user_author int NOT NULL,
fk_user_valid int NOT NULL,
note text
);

Some files were not shown because too many files have changed in this diff Show More