diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php
index 1ce89c4434b..f5ac849db67 100644
--- a/htdocs/admin/limits.php
+++ b/htdocs/admin/limits.php
@@ -37,12 +37,21 @@ if (!$user->admin)
if (isset($_POST["action"]) && $_POST["action"] == 'update')
{
- dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"]);
- dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TTC", $_POST["MAIN_MAX_DECIMALS_TTC"]);
- dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"]);
-
- Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
- exit;
+ if ($_POST["MAIN_MAX_DECIMALS_UNIT"] > 8
+ || $_POST["MAIN_MAX_DECIMALS_TTC"] > 8
+ || $_POST["MAIN_MAX_DECIMALS_SHOWN"] > 8)
+ {
+ $mesg='
'.$langs->trans("ErrorDecimalLargerThanAreForbidden").'
';
+ }
+ else
+ {
+ dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"]);
+ dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TTC", $_POST["MAIN_MAX_DECIMALS_TTC"]);
+ dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"]);
+
+ Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
+ exit;
+ }
}
@@ -53,6 +62,7 @@ print_fiche_titre($langs->trans("LimitsSetup"),'','setup');
print $langs->trans("LimitsDesc")."
\n";
print "
\n";
+if ($mesg) print $mesg.'
';
if (isset($_GET["action"]) && $_GET["action"] == 'edit')
{
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index b02aafcc59a..ef256aba274 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -16,6 +16,7 @@ GUISetup=Display
SetupArea=Setup area
SecuritySetup=Security setup
ErrorModuleRequirePHPVersion=Error, this module requires PHP version %s or higher
+ErrorDecimalLargerThanAreForbidden=Error, precision higher than %s are not supported.
DictionnarySetup=Dictionnary setup
DisableJavascript=Disable JavaScript functions
DisableAjax=Disable AJAX functions
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 1e687fa963b..f86465a8df0 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -16,6 +16,7 @@ GUISetup=Affichage
SetupArea=Espace configuration
SecuritySetup=Configuration de la sécurité
ErrorModuleRequirePHPVersion=Erreur, ce module requiert une version %s ou supérieure de PHP
+ErrorDecimalLargerThanAreForbidden=Erreur, les précisions supérieures à %s ne sont pas supportées.
DictionnarySetup=Dictionnaires
DisableJavascript=Désactiver les fonctions javascript
DisableAjax=Désactiver les fonctions ajax