Merge pull request #19304 from daraelmin/daraelmin-patch-3

Fix default enddate subscription must be in futur
This commit is contained in:
Laurent Destailleur 2021-11-08 03:28:35 +01:00 committed by GitHub
commit 621f0812a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -943,8 +943,10 @@ if ($rowid > 0) {
}
if (!$datefrom) {
$datefrom = $object->datevalid;
if ($object->datefin > 0) {
if ($object->datefin > 0 && dol_time_plus_duree($object->datefin, $defaultdelay, $defaultdelayunit) < dol_now()) {
$datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
} else {
$datefrom = dol_get_first_day(dol_print_date(time(), "%Y"));
}
}
print $form->selectDate($datefrom, '', '', '', '', "subscription", 1, 1);