diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 8cc637afa0d..9b4b206bd55 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -894,6 +894,12 @@ if (($action == 'addline' || $action == 'addline_predef') && $user->rights->fact
{
$result=0;
+ if ($_POST['np_price'] < 0 && $_POST["qty"] < 0)
+ {
+ $langs->load("errors");
+ $mesg='
'.$langs->trans("ErrorBothFieldCantBeNegative",$langs->transnoentitiesnoconv("UnitPriceHT"),$langs->transnoentitiesnoconv("Qty")).'
';
+ $result = -1 ;
+ }
if (empty($_POST['idprod']) && $_POST["type"] < 0)
{
$mesg=''.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")).'
';
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 12c9a29c11e..6cd3bdb4879 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -97,6 +97,7 @@ ErrorFailedToChangePassword=Failed to change password
ErrorLoginDoesNotExists=User with login %s could not be found.
ErrorLoginHasNoEmail=This user has no email address. Process aborted.
ErrorBadValueForCode=Bad value for security code. Try again with new value...
+ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative
# Warnings
WarningSafeModeOnCheckExecDir=Warning, PHP option safe_mode is on so command must be stored inside a directory declared by php parameter safe_mode_exec_dir.
diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang
index 71f56336a72..c7148b7f8c9 100644
--- a/htdocs/langs/fr_FR/errors.lang
+++ b/htdocs/langs/fr_FR/errors.lang
@@ -98,6 +98,7 @@ ErrorFailedToChangePassword=Échec de modification du mot de passe
ErrorLoginDoesNotExists=Le compte utilisateur de login %s n'a pu être trouvé.
ErrorLoginHasNoEmail=Cet utilisateur n'a pas d'email. Impossible de continuer.
ErrorBadValueForCode=Mauvaise valeur saisie pour le code. Réessayez avec une nouvelle valeur...
+ErrorBothFieldCantBeNegative=Les champs %s et %s ne peuvent être tous deux négatifs
# Warnings
WarningSafeModeOnCheckExecDir=Attention, l'option PHP safe_mode est active, la commande doit dont être dans un répertoire déclaré dans le paramètre php safe_mode_exec_dir.