diff --git a/modules/shared/auth/ui/home.php b/modules/shared/auth/ui/home.php index 8612894..3a6ce49 100644 --- a/modules/shared/auth/ui/home.php +++ b/modules/shared/auth/ui/home.php @@ -225,6 +225,7 @@ function auth_render_lager_table(string $title, array $rows, array $columns, str : (string) ($row['item_code'] ?? ''); $forecastText = ''; $forecastWarning = false; + $forecastMhdWarning = false; if ($tableKey === 'products') { $forecastStatus = (string) ($row['sellout_forecast_status'] ?? 'no_demand'); $forecastDate = $row['sellout_date'] ?? null; @@ -238,7 +239,8 @@ function auth_render_lager_table(string $title, array $rows, array $columns, str $expiryDate = new DateTimeImmutable((string) $row['expiry_date']); $forecastWarning = $forecastDateObject >= $expiryDate->modify('-3 months') && $forecastDateObject <= $expiryDate; - if ($forecastWarning || $forecastDateObject > $expiryDate) { + $forecastMhdWarning = $forecastDateObject > $expiryDate; + if ($forecastWarning || $forecastMhdWarning) { $forecastText .= ' (MHD: ' . $expiryDate->format('d.m.Y') . ')'; } } @@ -254,7 +256,9 @@ function auth_render_lager_table(string $title, array $rows, array $columns, str $html[] = '
'; $html[] = ''; if ($tableKey === 'products') { - $forecastClass = $forecastWarning ? ' sg-strong lager-forecast-warning' : ''; + $forecastClass = $forecastWarning + ? ' sg-strong lager-forecast-warning' + : ($forecastMhdWarning ? ' sg-strong lager-forecast-mhd-warning' : ''); $html[] = '