';
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index a9aead32ce6..c9db47b74c8 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -350,33 +350,40 @@ class Form
*/
function select_type_socialcontrib($selected='',$htmlname='actioncode', $useempty=0, $maxlen=40, $help=1)
{
- global $db,$langs,$user;
+ global $db,$langs,$user,$mysoc;
$sql = "SELECT c.id, c.libelle as type";
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
$sql.= " WHERE active = 1";
+ $sql.= " AND fk_pays = ".$mysoc->pays_id;
$sql.= " ORDER BY c.libelle ASC";
dol_syslog("Form::select_type_socialcontrib sql=".$sql, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
- print '';
- if ($user->admin && $help) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
}
else
{
diff --git a/htdocs/install/mysql/data/llx_c_chargesociales.sql b/htdocs/install/mysql/data/llx_c_chargesociales.sql
index 7dfe28f8ee3..a11172b78ec 100644
--- a/htdocs/install/mysql/data/llx_c_chargesociales.sql
+++ b/htdocs/install/mysql/data/llx_c_chargesociales.sql
@@ -32,14 +32,14 @@
-- Types de charges
--
-insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values ( 1, 'Allocations familiales', 1,1,'TAXFAM');
-insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values ( 2, 'GSG Deductible', 1,1,'TAXCSGD');
-insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values ( 3, 'GSG/CRDS NON Deductible',0,1,'TAXCSGND');
-insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (10, 'Taxe apprenttissage', 0,1,'TAXAPP');
-insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (11, 'Taxe professionnelle', 0,1,'TAXPRO');
-insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (20, 'Impots locaux/fonciers', 0,1,'TAXFON');
-insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (25, 'Impots revenus', 0,1,'TAXREV');
-insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (30, 'Assurance Sante', 0,1,'TAXSECU');
-insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (40, 'Mutuelle', 0,1,'TAXMUT');
-insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (50, 'Assurance vieillesse', 0,1,'TAXRET');
-insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (60, 'Assurance Chomage', 0,1,'TAXCHOM');
+insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta, fk_pays) values ( 1, 'Allocations familiales', 1,1,'TAXFAM' ,'1');
+insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta, fk_pays) values ( 2, 'GSG Deductible', 1,1,'TAXCSGD' ,'1');
+insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta, fk_pays) values ( 3, 'GSG/CRDS NON Deductible',0,1,'TAXCSGND' ,'1');
+insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta, fk_pays) values (10, 'Taxe apprenttissage', 0,1,'TAXAPP' ,'1');
+insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta, fk_pays) values (11, 'Taxe professionnelle', 0,1,'TAXPRO' ,'1');
+insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta, fk_pays) values (20, 'Impots locaux/fonciers', 0,1,'TAXFON' ,'1');
+insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta, fk_pays) values (25, 'Impots revenus', 0,1,'TAXREV' ,'1');
+insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta, fk_pays) values (30, 'Assurance Sante', 0,1,'TAXSECU' ,'1');
+insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta, fk_pays) values (40, 'Mutuelle', 0,1,'TAXMUT' ,'1');
+insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta, fk_pays) values (50, 'Assurance vieillesse', 0,1,'TAXRET' ,'1');
+insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta, fk_pays) values (60, 'Assurance Chomage', 0,1,'TAXCHOM' ,'1');
diff --git a/htdocs/install/mysql/migration/2.6.0-2.7.0.sql b/htdocs/install/mysql/migration/2.6.0-2.7.0.sql
index 019a6b371a7..1b9b41b8464 100644
--- a/htdocs/install/mysql/migration/2.6.0-2.7.0.sql
+++ b/htdocs/install/mysql/migration/2.6.0-2.7.0.sql
@@ -65,6 +65,9 @@ delete from llx_const where name = 'FACTURE_ENABLE_RECUR';
alter table llx_facturedet_rec add column product_type integer DEFAULT 0 after fk_product;
+alter table llx_c_chargesociales change actioncompta code varchar(12) NOT NULL;
+alter table llx_c_chargesociales add column fk_pays integer DEFAULT 1 NOT NULL;
+
-- Usage of llx_menu_const and llx_menu_constraint is too complicated
-- so we made first change to remove it
alter table llx_menu_const drop foreign key fk_menu_const_fk_menu;
diff --git a/htdocs/install/mysql/tables/llx_c_chargesociales.sql b/htdocs/install/mysql/tables/llx_c_chargesociales.sql
index 90811753109..077040f4627 100644
--- a/htdocs/install/mysql/tables/llx_c_chargesociales.sql
+++ b/htdocs/install/mysql/tables/llx_c_chargesociales.sql
@@ -1,6 +1,6 @@
-- ========================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville
--- Copyright (C) 2004 Laurent Destailleur
+-- Copyright (C) 2004-2009 Laurent Destailleur
--
-- 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
@@ -25,7 +25,8 @@ create table llx_c_chargesociales
libelle varchar(80),
deductible smallint DEFAULT 0 NOT NULL,
active tinyint DEFAULT 1 NOT NULL,
- actioncompta varchar(12) NOT NULL
+ code varchar(12) NOT NULL,
+ fk_pays integer DEFAULT 1 NOT NULL
)type=innodb;
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 03cc9b2ecab..84f93287cc6 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -42,6 +42,7 @@ ErrorSomeErrorWereFoundRollbackIsDone=Some errors were found. We rollback change
ErrorConfigParameterNotDefined=Parameter %s is not defined inside Dolibarr config file conf.php.
ErrorCantLoadUserFromDolibarrDatabase=Failed to find user %s in Dolibarr database.
ErrorNoVATRateDefinedForSellerCountry=Error, no vat rates defined for country '%s'.
+ErrorNoSocialContributionForSellerCountry=Error, no social contribution type defined for country '%s'.
ErrorFailedToSaveFile=Error, failed to save file.
ErrorOnlyPngJpgSupported=Error, only .png and .jpg image format file are supported.
ErrorImageFormatNotSupported=Your PHP does not support functions to convert images of this format.
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index d13583b38e4..698eeb25c31 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -42,6 +42,7 @@ ErrorSomeErrorWereFoundRollbackIsDone=Des erreurs ont été trouvés. On rollbac
ErrorConfigParameterNotDefined=Le parametre %s n'est pas défini dans le fichier de configuration Dolibarr conf.php.
ErrorCantLoadUserFromDolibarrDatabase=Impossible de trouver l'utilisateur %s dans la base Dolibarr.
ErrorNoVATRateDefinedForSellerCountry=Erreur, aucun taux tva défini pour le pays '%s'.
+ErrorNoSocialContributionForSellerCountry=Erreur, aucun type de charges défini pour le pays '%s'.
ErrorFailedToSaveFile=Erreur, l'enregistrement du fichier a échoué.
ErrorOnlyPngJpgSupported=Erreur, seuls les formats images .jpg et .png sont supportés.
ErrorImageFormatNotSupported=Votre PHP ne supporte pas les fonctions de conversion de ce format d'image.
diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index c22ec467e27..7ce1949a189 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -2033,13 +2033,14 @@ function print_titre($titre)
}
/**
- * \brief Affichage d'un titre d'une fiche, aligne a gauche
- * \param titre Le titre a afficher
- * \param mesg Message suplementaire a afficher a droite
+ * \brief Show a title with picto
+ * \param titre Title to show
+ * \param mesg Added message to show on right
* \param picto Icon to use before title (should be a 32x32 transparent png file)
* \param pictoisfullpath 1=Icon name is a full absolute url of image
+ * \param id To force an id on html objects
*/
-function print_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0)
+function print_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0, $id='')
{
global $conf;
@@ -2047,7 +2048,7 @@ function print_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpat
if (empty($conf->browser->firefox) && $picto=='title.png') $picto='title.gif';
print "\n";
- print '
';
+ print '
';
if (empty($conf->browser->phone) && $picto && $titre) print '