Go to end of month for #11191

This commit is contained in:
James Cole
2025-11-08 19:23:31 +01:00
parent 338ab2a29e
commit aee5f5cdf8
2 changed files with 16 additions and 8 deletions

View File

@@ -157,6 +157,14 @@ class General extends AbstractExtension
/** @var Carbon $date */
$date = now();
// get the date from the current session. If it's in the future, keep `now()`.
/** @var Carbon $session */
$session = clone session('end', today(config('app.timezone'))->endOfMonth());
if($session->lt($date)) {
$date = $session->copy();
$date->endOfDay();
}
Log::debug(sprintf('twig balance: Call finalAccountBalance with date/time "%s"', $date->toIso8601String()));
// 2025-10-08 replace finalAccountBalance with accountsBalancesOptimized.