Fix: Error when amount not provided

This commit is contained in:
Laurent Destailleur 2011-02-09 17:42:38 +00:00
parent 633a45e5a4
commit e7fc318f34

View File

@ -75,6 +75,7 @@ if ($action == 'add_paiement')
$_POST['reyear']); $_POST['reyear']);
$paiement_id = 0; $paiement_id = 0;
$total = 0; $total = 0;
// Genere tableau des montants amounts // Genere tableau des montants amounts
foreach ($_POST as $key => $value) foreach ($_POST as $key => $value)
{ {
@ -104,14 +105,17 @@ if ($action == 'add_paiement')
} }
} }
/* if ($total == 0)
\TODO A activer qd gestion avoir active et que creation facture fournisseur negative interdit {
if ($total <= 0) $mesg = '<div class="error">'.$langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')).'</div>';
{ $error++;
$mesg = '<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Amount')).'</div>'; }
$error++;
} if (empty($datepaye))
*/ {
$fiche_erreur_message = '<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Date')).'</div>';
$error++;
}
if (! $error) if (! $error)
{ {