FIX It was possible to create cashfence without entering data.

This commit is contained in:
Laurent Destailleur 2019-08-18 20:47:40 +02:00
parent bbc1dfb0f7
commit 783e01588c

View File

@ -132,7 +132,16 @@ elseif ($action=="add")
$error=0;
foreach($arrayofpaymentmode as $key=>$val)
{
$object->$key = price2num(GETPOST($key.'_amount', 'alpha'));
if (GETPOST($key.'_amount', 'alpha') == '')
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val)), null, 'errors');
$action='start';
$error++;
}
else
{
$object->$key = price2num(GETPOST($key.'_amount', 'alpha'));
}
}
if (! $error)