diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index d9e9e2c63d0..23580fb6429 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -902,6 +902,11 @@ if (($action == 'addline' || $action == 'addline_predef') && $user->rights->fact { $result=0; + if ($_POST['np_price'] < 0 && $_POST["qty"] < 0) + { + $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")).'
';