diff --git a/modules/shared/auth/ui/home.php b/modules/shared/auth/ui/home.php index 9597a40..e8307b8 100644 --- a/modules/shared/auth/ui/home.php +++ b/modules/shared/auth/ui/home.php @@ -231,10 +231,16 @@ function auth_render_lager_table(string $title, array $rows, array $columns, str if ($forecastDate !== null && $forecastDate !== '') { $forecastDateObject = new DateTimeImmutable((string) $forecastDate); $forecastText = $forecastDateObject->format('d.m.Y'); - $forecastWarning = $forecastStatus === 'depleted'; - if (!$forecastWarning && !empty($row['expiry_date'])) { + if ($forecastStatus === 'depleted') { + $forecastWarning = true; + $forecastText .= ' (CHARGE ENDE)'; + } elseif (!empty($row['expiry_date'])) { $expiryDate = new DateTimeImmutable((string) $row['expiry_date']); - $forecastWarning = $forecastDateObject >= $expiryDate->modify('-3 months'); + $forecastWarning = $forecastDateObject >= $expiryDate->modify('-3 months') + && $forecastDateObject <= $expiryDate; + if ($forecastWarning) { + $forecastText .= ' (MHD: ' . $expiryDate->format('d.m.Y') . ')'; + } } } else { $forecastText = 'Keine Prognose';