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
This commit is contained in:
iouston 2023-07-31 02:00:55 +02:00 committed by GitHub
parent cdc8bc1b6f
commit f6a5cc67c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);