From e5ef45562883733fcb7ae5c65533c310105eb73f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 11 Jan 2021 19:46:08 +0100 Subject: [PATCH 1/7] fix: date auto fill date paiement tax --- htdocs/compta/paiement_charge.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 509e20f3613..a1c3a246829 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -224,8 +224,8 @@ if ($action == 'create') print ''.$langs->trans("Date").''; $datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); - $datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (empty($_POST["remonth"]) ?-1 : $datepaye) : 0; - print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1); + $datepaye = ($datepaye == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $datepaye); + print $form->selectDate($datepaye, '', '', '', '', "add_payment", 1, 1); print ""; print ''; From 33d7998a9682fecabd94f9f0e61a50a56ff9b0ce Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 11 Jan 2021 19:47:20 +0100 Subject: [PATCH 2/7] fix: date auto fill date paiement tax --- htdocs/compta/paiement_charge.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index a1c3a246829..37301908693 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -223,9 +223,9 @@ if ($action == 'create') print ''.$langs->trans("RemainderToPay").''.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'';*/ print ''.$langs->trans("Date").''; - $datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); - $datepaye = ($datepaye == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $datepaye); - print $form->selectDate($datepaye, '', '', '', '', "add_payment", 1, 1); + $datepayment = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); + $datepayment = ($datepayment == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $datepayment); + print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1); print ""; print ''; From 7e30812529d6b68e4838d246686a02cd07216a06 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 12 Jan 2021 22:01:53 +0100 Subject: [PATCH 3/7] fix review --- htdocs/compta/paiement_charge.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 37301908693..ac89cfef0b6 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -223,8 +223,13 @@ if ($action == 'create') print ''.$langs->trans("RemainderToPay").''.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'';*/ print ''.$langs->trans("Date").''; - $datepayment = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); - $datepayment = ($datepayment == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $datepayment); + if (GETPOSTISSET('remonth')) { + $datepayment = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + } 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')); + } else { + $datepayment = '' ; + } print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1); print ""; print ''; From 0fa7134bd11559e51ea019dddd06ca15cb25f19b Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 14 Jan 2021 13:04:02 +0100 Subject: [PATCH 4/7] better fix --- htdocs/compta/paiement_charge.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index ac89cfef0b6..f67bed0ec63 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -223,14 +223,16 @@ 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')); - } else { - $datepayment = '' ; + $empty=0; } - print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1); + print $form->selectDate($datepayment, '', '', '', $empty, "add_payment", 1, 1); print ""; print ''; From fb14f7c0b89016c9d80ec2e49fb5e450d9565baa Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 15 Jan 2021 14:40:55 +0100 Subject: [PATCH 5/7] Modify GETPOST parameters to match with v12 --- htdocs/core/tpl/card_presend.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index d9097ee0919..aaaa043e39b 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -209,7 +209,7 @@ if ($action == 'presend') } $formmail->withto = $liste; - $formmail->withtofree = (GETPOSTISSET('sendto') ? (GETPOST('sendto') ? GETPOST('sendto') : '1') : '1'); + $formmail->withtofree = (GETPOSTISSET('sendto') ? (GETPOST('sendto', 'alpha') ? GETPOST('sendto', 'alpha') : '1') : '1'); $formmail->withtocc = $liste; $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; $formmail->withtopic = $topicmail; From a109dd89486bdea61be5483fab74113782560be7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Jan 2021 13:51:35 +0100 Subject: [PATCH 6/7] Fix removed unexpected values in stats graph Conflicts: htdocs/projet/graph_opportunities.inc.php --- htdocs/projet/graph_opportunities.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 97977406a48..bbb2b6f97d9 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -68,8 +68,8 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) $listofstatus = array_keys($listofoppstatus); // Complete with values found into database and not into the dictionary - foreach($valsamount as $key => $val) { - if (!in_array($key, $listofstatus)) { + foreach ($valsamount as $key => $val) { + if (!in_array($key, $listofstatus) && $key) { $listofstatus[] = $key; } } From a8cdecf1b8c234af63c13040d7cc03823001b0f1 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 18 Jan 2021 19:17:23 +0100 Subject: [PATCH 7/7] 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 '';