diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 1fa95eb0b46ce..4f67f02d7f5cf 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -132,7 +132,16 @@ $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)