diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index 1354bfbc579a37f3dc2c5ed4dc1721fb53ae5b55..dcc55f0354b076b406884a341230a159b0d0c1b5 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -31,7 +31,7 @@
    \version    $Revision$
 */
 
-define('DOL_VERSION','2.2-beta3');
+define('DOL_VERSION','2.2-beta4');
 define('EURO',chr(128)); 
 
 // La fonction clearstatcache ne doit pas etre appel�e de mani�re globale car ralenti.
diff --git a/mysql/tables/llx_chargesociales.sql b/mysql/tables/llx_chargesociales.sql
index 5b52121f7bf8a75f302e9967202392415df575b3..1676041ba3876ac66a25d4d63fa3ff46b780caad 100644
--- a/mysql/tables/llx_chargesociales.sql
+++ b/mysql/tables/llx_chargesociales.sql
@@ -16,8 +16,6 @@
 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 --
 -- $Id$
--- $Source$
---
 -- ========================================================================
 
 create table llx_chargesociales
diff --git a/mysql/tables/llx_compta_account.sql b/mysql/tables/llx_compta_account.sql
index 183f0b9678f986e1a03ca3b4da40795f35c6ace8..626ef9a5d14cdfb4d4e12c996f66b93dfa3255c8 100644
--- a/mysql/tables/llx_compta_account.sql
+++ b/mysql/tables/llx_compta_account.sql
@@ -1,9 +1,6 @@
 -- ===================================================================
 -- 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
diff --git a/mysql/tables/llx_societe_log.sql b/mysql/tables/llx_societe_log.sql
index 4cd7f087699e85eda895fb1b3fb6987466f0d206..443a1f4efc8da41156d19d0281fcf965d0d84254 100644
--- a/mysql/tables/llx_societe_log.sql
+++ b/mysql/tables/llx_societe_log.sql
@@ -1,9 +1,6 @@
 -- ========================================================================
 -- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--- Copyright (C) 2007       Laurent Destailleur <eldy@users.sourceforge.net>
---
--- $Id$
--- $Source$
+-- 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
diff --git a/pgsql/tables/llx_action_def.sql b/pgsql/tables/llx_action_def.sql
index 25ec8b5db1a5423128b446764822ee680c30060d..2cbff076e7aef1089063f195a950a5744e11ca1d 100644
--- a/pgsql/tables/llx_action_def.sql
+++ b/pgsql/tables/llx_action_def.sql
@@ -21,7 +21,7 @@
 -- along with this program; if not, write to the Free Software
 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 --
--- Id: llx_action_def.sql,v 1.7 2007/12/02 21:51:12 eldy Exp 
+-- Id: llx_action_def.sql,v 1.8 2007/12/04 19:01:38 eldy Exp 
 -- ===================================================================
 
 create table llx_action_def
@@ -31,5 +31,5 @@ create table llx_action_def
   "tms"             timestamp,
   "titre"           varchar(255) NOT NULL,
   "description"     text,
-  "objet_type" varchar(10) CHECK (objet_type IN ('ficheinter','facture','propale','mailing')) 
+  "objet_type"      varchar(16) NOT NULL
 );
diff --git a/pgsql/tables/llx_categorie_societe.key.sql b/pgsql/tables/llx_categorie_societe.key.sql
index b4caf62f42dcf980f086e7cd0b2c1e33d1ab1159..3f3d55e4af82787eee2b5c1e0bfd163815d2f226 100644
--- a/pgsql/tables/llx_categorie_societe.key.sql
+++ b/pgsql/tables/llx_categorie_societe.key.sql
@@ -19,7 +19,7 @@
 -- along with this program; if not, write to the Free Software
 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 --
--- Id: llx_compta.sql,v 1.4 2004/10/09 10:47:16 opensides Exp 
+-- Id: llx_categorie_societe.key.sql,v 1.13 2007/12/03 00:13:10 eldy Exp 
 -- ============================================================================
 
 ALTER TABLE llx_categorie_societe ADD PRIMARY KEY (fk_categorie, fk_societe);
diff --git a/pgsql/tables/llx_categorie_societe.sql b/pgsql/tables/llx_categorie_societe.sql
index e8b54d92afa7dc49b95977298303e2d01e73a331..270e8ae2d16a82b30b1c091031560271287fa8df 100644
--- a/pgsql/tables/llx_categorie_societe.sql
+++ b/pgsql/tables/llx_categorie_societe.sql
@@ -19,7 +19,7 @@
 -- along with this program; if not, write to the Free Software
 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 --
--- Id: llx_compta.sql,v 1.4 2004/10/09 10:47:16 opensides Exp 
+-- Id: llx_categorie_societe.sql,v 1.5 2007/12/03 00:13:25 eldy Exp 
 -- ============================================================================
 
 create table llx_categorie_societe
diff --git a/pgsql/tables/llx_chargesociales.sql b/pgsql/tables/llx_chargesociales.sql
index 9c05d92494c273e63fb3b29987149b65a0ebb210..f150fabf7dda8a827579a31efef435dbc9a73054 100644
--- a/pgsql/tables/llx_chargesociales.sql
+++ b/pgsql/tables/llx_chargesociales.sql
@@ -19,9 +19,7 @@
 -- along with this program; if not, write to the Free Software
 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 --
--- Id: llx_chargesociales.sql,v 1.7 2007/11/27 05:20:53 eldy Exp 
--- $Source$
---
+-- Id: llx_chargesociales.sql,v 1.8 2007/12/16 20:40:10 eldy Exp 
 -- ========================================================================
 
 create table llx_chargesociales
diff --git a/pgsql/tables/llx_commande_fournisseur_dispatch.key.sql b/pgsql/tables/llx_commande_fournisseur_dispatch.key.sql
index 7ea47e92eaf5ff59daf19b870e411fe79994de5c..56743505f5530164494a3adb041be18494a6d331 100644
--- a/pgsql/tables/llx_commande_fournisseur_dispatch.key.sql
+++ b/pgsql/tables/llx_commande_fournisseur_dispatch.key.sql
@@ -19,7 +19,7 @@
 -- along with this program; if not, write to the Free Software
 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 --
--- Id: llx_commande_fournisseur_dispatch.key.sql,v 1.2 2007/12/02 22:03:23 eldy Exp 
+-- Id: llx_commande_fournisseur_dispatch.key.sql,v 1.3 2007/12/11 01:33:54 eldy Exp 
 -- ===================================================================
 
-ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX (fk_commande);
\ No newline at end of file
+ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_commande (fk_commande);
\ No newline at end of file
diff --git a/pgsql/tables/llx_commande_fournisseurdet.sql b/pgsql/tables/llx_commande_fournisseurdet.sql
index 415485e64c5b0559860b37afca8f710121cf1949..91032642f8d7f0d8dc109258b177f9176f931383 100644
--- a/pgsql/tables/llx_commande_fournisseurdet.sql
+++ b/pgsql/tables/llx_commande_fournisseurdet.sql
@@ -20,14 +20,14 @@
 -- along with this program; if not, write to the Free Software
 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 --
--- Id: llx_commande_fournisseurdet.sql,v 1.8 2007/12/02 22:03:23 eldy Exp 
+-- Id: llx_commande_fournisseurdet.sql,v 1.9 2007/12/14 19:44:05 hregis Exp 
 -- ===================================================================
 
 create table llx_commande_fournisseurdet
 (
   rowid SERIAL PRIMARY KEY,
   "fk_commande"                integer      NOT NULL,
-  "fk_product"                 integer      NOT NULL,
+  "fk_product"                 integer,
   "ref"                        varchar(50),
   "label"                      varchar(255),
   "description"                text,
diff --git a/pgsql/tables/llx_compta_account.sql b/pgsql/tables/llx_compta_account.sql
index 79d06d7d2da4f944465c39ba1e226d94cb034133..1cf14fff399ae99d6e17b65cf6b6044ae8999603 100644
--- a/pgsql/tables/llx_compta_account.sql
+++ b/pgsql/tables/llx_compta_account.sql
@@ -5,9 +5,6 @@
 -- ===================================================================
 -- Copyright (C) 2000-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
 --
--- Id: llx_compta_account.sql,v 1.4 2007/12/02 22:03:23 eldy Exp 
--- $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
@@ -22,7 +19,7 @@
 -- along with this program; if not, write to the Free Software
 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 --
--- Id: llx_compta_account.sql,v 1.4 2007/12/02 22:03:23 eldy Exp 
+-- Id: llx_compta_account.sql,v 1.5 2007/12/16 20:40:40 eldy Exp 
 -- ===================================================================
 
 
diff --git a/pgsql/tables/llx_droitpret_rapport.sql b/pgsql/tables/llx_droitpret_rapport.sql
index 64f2bb1d4540cff5bee079b0365343853be67701..ec8cd8b6213ac9fc93e051b095813b9efeb54fd7 100644
--- a/pgsql/tables/llx_droitpret_rapport.sql
+++ b/pgsql/tables/llx_droitpret_rapport.sql
@@ -19,7 +19,7 @@
 -- along with this program; if not, write to the Free Software
 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 --
--- Id: llx_droitpret_rapport.sql,v 1.2 2007/02/27 09:40:31 patrickrgn Exp 
+-- Id: llx_droitpret_rapport.sql,v 1.5 2007/12/03 00:13:56 eldy Exp 
 -- ========================================================================
 
 
diff --git a/pgsql/tables/llx_paiement.sql b/pgsql/tables/llx_paiement.sql
index d6dceaedb76cb701bf4ce5753d7933ab90ae20a3..70dd5e76a78a38eace82f19c96378867585afd12 100644
--- a/pgsql/tables/llx_paiement.sql
+++ b/pgsql/tables/llx_paiement.sql
@@ -20,7 +20,7 @@
 -- along with this program; if not, write to the Free Software
 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 --
--- Id: llx_paiement.sql,v 1.13 2007/12/02 21:37:41 eldy Exp 
+-- Id: llx_paiement.sql,v 1.15 2007/12/07 21:27:26 hregis Exp 
 -- ===================================================================
 
 
diff --git a/pgsql/tables/llx_propaldet.sql b/pgsql/tables/llx_propaldet.sql
index 8366c839b831cd6121788629c0e14d82de04fec6..6f3f6d4a3938fb63b4660c91bb2fa3da089da8d1 100644
--- a/pgsql/tables/llx_propaldet.sql
+++ b/pgsql/tables/llx_propaldet.sql
@@ -19,7 +19,7 @@
 -- along with this program; if not, write to the Free Software
 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 --
--- Id: llx_propaldet.sql,v 1.18 2007/12/02 21:37:46 eldy Exp 
+-- Id: llx_propaldet.sql,v 1.19 2007/12/12 16:36:00 hregis Exp 
 -- ===================================================================
 
 create table llx_propaldet
@@ -51,4 +51,5 @@ create table llx_propaldet
 --
 -- 1 : frais de port
 -- 2 : ecotaxe
+-- 3 : option
 --
\ No newline at end of file
diff --git a/pgsql/tables/llx_societe_log.sql b/pgsql/tables/llx_societe_log.sql
index f5bf41022658c7016bbe1443e14be56f6e4c52c3..0e58195227dad227cb8f7922e93b207db9384f9f 100644
--- a/pgsql/tables/llx_societe_log.sql
+++ b/pgsql/tables/llx_societe_log.sql
@@ -4,10 +4,7 @@
 
 -- ========================================================================
 -- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--- Copyright (C) 2007       Laurent Destailleur <eldy@users.sourceforge.net>
---
--- Id: llx_societe_log.sql,v 1.2 2007/12/02 21:37:46 eldy Exp 
--- $Source: /cvsroot/dolibarr/dolibarr/mysql/tables/llx_societe_log.sql,v $
+-- 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
@@ -23,7 +20,7 @@
 -- along with this program; if not, write to the Free Software
 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 --
--- Id: llx_societe_log.sql,v 1.2 2007/12/02 21:37:46 eldy Exp 
+-- Id: llx_societe_log.sql,v 1.3 2007/12/16 20:41:15 eldy Exp 
 -- ========================================================================
 
 create table llx_societe_log