From c79436358eea0debd80117ad6de51220ef3d3851 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Apr 2007 09:16:20 +0000 Subject: [PATCH] Fix: controle champ saisi remise fixe --- htdocs/comm/remx.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 32fd5f48f05..5f483adc9cf 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -53,16 +53,13 @@ if ($user->societe_id > 0) if ($_POST["action"] == 'setremise') { - if (! price2num($_POST["amount_ht"]) > 0) - { - $mesg='
'.$langs->trans("ErrorFieldFormat",$langs->trans("NewGlobalDiscount")).'
'; - } - elseif (! $_POST["desc"]) - { - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("ReasonDiscount")).'
'; - } - else + if (price2num($_POST["amount_ht"]) > 0) { + if (! $_POST["desc"]) + { + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("ReasonDiscount")).'
'; + } + $soc = New Societe($db); $soc->fetch($_GET["id"]); $soc->set_remise_except($_POST["amount_ht"],$user,$_POST["desc"],$_POST["tva_tx"]); @@ -77,6 +74,10 @@ if ($_POST["action"] == 'setremise') $mesg='
'.$soc->error.'
'; } } + else + { + $mesg='
'.$langs->trans("ErrorFieldFormat",$langs->trans("NewGlobalDiscount")).'
'; + } } if ($_GET["action"] == 'remove')