New: add waring message when date is too low.

This commit is contained in:
Laurent Destailleur 2012-10-19 13:01:29 +02:00
parent 70cf195fb4
commit 4a10874f54

View File

@ -188,7 +188,11 @@ elseif ($action == 'setdate_lim_reglement' && $user->rights->fournisseur->factur
{
$object->fetch($id);
$object->date_echeance=dol_mktime(12,0,0,$_POST['date_lim_reglementmonth'],$_POST['date_lim_reglementday'],$_POST['date_lim_reglementyear']);
if ($object->date_echeance < $object->date) $object->date_echeance=$object->date;
if ($object->date_echeance < $object->date)
{
$object->date_echeance=$object->date;
setEventMessage($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"),'warnings');
}
$result=$object->update($user);
if ($result < 0) dol_print_error($db,$object->error);
}