Fix: controle champ saisi remise fixe
This commit is contained in:
parent
646de93d66
commit
c79436358e
@ -53,16 +53,13 @@ if ($user->societe_id > 0)
|
|||||||
|
|
||||||
if ($_POST["action"] == 'setremise')
|
if ($_POST["action"] == 'setremise')
|
||||||
{
|
{
|
||||||
if (! price2num($_POST["amount_ht"]) > 0)
|
if (price2num($_POST["amount_ht"]) > 0)
|
||||||
{
|
|
||||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldFormat",$langs->trans("NewGlobalDiscount")).'</div>';
|
|
||||||
}
|
|
||||||
elseif (! $_POST["desc"])
|
|
||||||
{
|
|
||||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("ReasonDiscount")).'</div>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
if (! $_POST["desc"])
|
||||||
|
{
|
||||||
|
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("ReasonDiscount")).'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
$soc = New Societe($db);
|
$soc = New Societe($db);
|
||||||
$soc->fetch($_GET["id"]);
|
$soc->fetch($_GET["id"]);
|
||||||
$soc->set_remise_except($_POST["amount_ht"],$user,$_POST["desc"],$_POST["tva_tx"]);
|
$soc->set_remise_except($_POST["amount_ht"],$user,$_POST["desc"],$_POST["tva_tx"]);
|
||||||
@ -77,6 +74,10 @@ if ($_POST["action"] == 'setremise')
|
|||||||
$mesg='<div class="error">'.$soc->error.'</div>';
|
$mesg='<div class="error">'.$soc->error.'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$mesg='<div class="error">'.$langs->trans("ErrorFieldFormat",$langs->trans("NewGlobalDiscount")).'</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET["action"] == 'remove')
|
if ($_GET["action"] == 'remove')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user