From a8cdecf1b8c234af63c13040d7cc03823001b0f1 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 18 Jan 2021 19:17:23 +0100 Subject: [PATCH] better fix --- htdocs/compta/paiement_charge.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index f67bed0ec63..715a0851c65 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -223,16 +223,9 @@ if ($action == 'create') print ''.$langs->trans("RemainderToPay").''.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'';*/ print ''.$langs->trans("Date").''; - $empty=1; - $datepayment=''; - if (GETPOSTISSET('remonth')) { - $datepayment = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); - $empty=0; - } elseif (!empty($conf->global->MAIN_AUTOFILL_DATE)) { - $datepayment = dol_mktime(12, 0, 0, dol_print_date(dol_now(), '%m'), dol_print_date(dol_now(), '%d'), dol_print_date(dol_now(), '%Y')); - $empty=0; - } - print $form->selectDate($datepayment, '', '', '', $empty, "add_payment", 1, 1); + $datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); + $datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (empty($_POST["remonth"]) ?-1 : $datepaye) : ''; + print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1); print ""; print '';