Merge pull request #15101 from FHenry/12.0_fix_autofilldate_payment_expensereport

fix MAIN_AUTOFILL_DATE for expense payment date
This commit is contained in:
Laurent Destailleur 2020-10-22 16:58:55 +02:00 committed by GitHub
commit 72505b2ad4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,8 +249,8 @@ if ($action == 'create' || empty($action))
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
$datepaid = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int'));
$datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (empty($_POST["remonth"]) ?-1 : $datepaid) : 0;
print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1);
$datepayment = ($datepaid == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $datepaid);
print $form->selectDate($datepayment, '', '', '', 0, "add_payment", 1, 1);
print "</td>";
print '</tr>';