Fix: Overwrite bad value of limit payment date only if payment date is

defined.
This commit is contained in:
Laurent Destailleur 2013-12-25 18:12:13 +01:00
parent 76e4ba06a4
commit 22412443fe

View File

@ -221,7 +221,7 @@ elseif ($action == 'setdatef' && $user->rights->fournisseur->facture->creer)
{
$object->fetch($id);
$object->date=dol_mktime(12,0,0,$_POST['datefmonth'],$_POST['datefday'],$_POST['datefyear']);
if ($object->date_echeance < $object->date) $object->date_echeance=$object->date;
if ($object->date_echeance && $object->date_echeance < $object->date) $object->date_echeance=$object->date;
$result=$object->update($user);
if ($result < 0) dol_print_error($db,$object->error);
}