From c3afd9e2bf4728bd240369dbaa617816ca9d6577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Gla=CC=88ser?= Date: Sun, 6 Sep 2026 09:12:43 +0200 Subject: [PATCH] Use yellow signal for expired stock forecast --- modules/shared/auth/ui/home.php | 8 ++++++-- public/assets/styles.portal.css | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) 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[] = '
' . auth_escape_html($forecastText) . '
'; } $html[] = ''; diff --git a/public/assets/styles.portal.css b/public/assets/styles.portal.css index 59e50bc..2a755d5 100644 --- a/public/assets/styles.portal.css +++ b/public/assets/styles.portal.css @@ -173,6 +173,10 @@ body.sg-bestellungen-mobile-detail-open > :not([data-bestellungen-mobile-detail- color: var(--color-signal-red); } +.sg-large-table--lager .lager-forecast-mhd-warning { + color: var(--color-signal-yellow); +} + .sg-card-list-page-drawer__title { color: var(--color-white); }