From e7fc318f34e144b40d82bac8131bdf27c1e51b9f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Feb 2011 17:42:38 +0000 Subject: [PATCH] Fix: Error when amount not provided --- htdocs/fourn/facture/paiement.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 27fb98684ed..48f535b6612 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -75,6 +75,7 @@ if ($action == 'add_paiement') $_POST['reyear']); $paiement_id = 0; $total = 0; + // Genere tableau des montants amounts foreach ($_POST as $key => $value) { @@ -104,14 +105,17 @@ if ($action == 'add_paiement') } } - /* - \TODO A activer qd gestion avoir active et que creation facture fournisseur negative interdit - if ($total <= 0) - { - $mesg = '
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Amount')).'
'; - $error++; - } - */ + if ($total == 0) + { + $mesg = '
'.$langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')).'
'; + $error++; + } + + if (empty($datepaye)) + { + $fiche_erreur_message = '
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Date')).'
'; + $error++; + } if (! $error) {