FIX #36090 Accountancy - Inconsistent date on various journal (#36105)

* FIX #36090 Accountancy - Inconsistent date on various journal

* FIX CI

* Update
This commit is contained in:
Alexandre SPANGARO
2025-11-06 17:25:18 +01:00
committed by GitHub
parent af4630c456
commit 20af12a806

View File

@@ -366,7 +366,7 @@ function getDefaultDatesForTransfer()
$obj = $db->fetch_object($res);
$date_start = $db->jdate($obj->date_start);
$date_end = $db->jdate($obj->date_end);
$date_end = dol_get_last_hour($db->jdate($obj->date_end));
} else {
$month_start = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
$year_start = (int) dol_print_date(dol_now(), '%Y');
@@ -380,7 +380,8 @@ function getDefaultDatesForTransfer()
$year_end--;
}
$date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
$date_end = dol_get_last_day($year_end, $month_end);
$lastday = dol_get_last_day($year_end, $month_end);
$date_end = dol_mktime(23, 59, 59, $month_end, (int) dol_print_date($lastday, '%d'), $year_end);
}
} elseif ($periodbydefaultontransfer == 1) { // current month
$year_current = (int) dol_print_date(dol_now('gmt'), "%Y", 'gmt');