From f6a5cc67c8a2513508cfa285ea34bbd6e3a6474b Mon Sep 17 00:00:00 2001 From: iouston <4319513+iouston@users.noreply.github.com> Date: Mon, 31 Jul 2023 02:00:55 +0200 Subject: [PATCH] Add hdden option ACCOUNTANCY_JOURNAL_USE_CURRENT_MONTH (#25499) Sometimes customers ask to have the current month by default on this form, so this option did it --- htdocs/accountancy/journal/sellsjournal.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 7cae93566c6..b37f94483f9 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -101,6 +101,10 @@ if (empty($date_startmonth) || empty($date_endmonth)) { $pastmonth = $dates['pastmonth']; } +if($conf->global->ACCOUNTANCY_JOURNAL_USE_CURRENT_MONTH){ + $pastmonth+=1; +} + if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) { // We define date_start and date_end, only if we did not submit the form $date_start = dol_get_first_day($pastmonthyear, $pastmonth, false); $date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);