diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 8e41ce3b1e5..b6bfbeaa833 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -855,8 +855,7 @@ if (($_POST['action'] == 'addline' || $_POST['action'] == 'addline_predef') && $ $result = -1 ; } - // qty can't be null for invoice (no option) - if ($result >= 0 && $_POST['qty'] && (($_POST['pu']!='' && ($_POST['np_desc'] || $_POST['dp_desc'])) || $_POST['idprod'])) + if ($result >= 0 && $_POST['qty']!='' && (($_POST['pu']!='' && ($_POST['np_desc'] || $_POST['dp_desc'])) || $_POST['idprod'])) { $ret=$fac->fetch($_POST['facid']); if ($ret < 0) @@ -959,6 +958,10 @@ if (($_POST['action'] == 'addline' || $_POST['action'] == 'addline_predef') && $ } } } + else + { + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv('Qty')).'
'; + } if ($result > 0) {