Use yellow signal for expired stock forecast
This commit is contained in:
1 parent
4d3fbdad8c
commit
c3afd9e2bf
2 files changed
+10
-2
No files matched your search
@@ -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[] = '<div class="sg-large-table__cell" role="cell"><a class="sg-hyperlink" href="#" aria-haspopup="dialog" aria-expanded="false" data-lager-drawer-open="true"' . $nameData . $valueData . $typeData . '>' . auth_escape_html($name) . '</a></div>';
|
||||
$html[] = '<div class="sg-large-table__cell" role="cell"><a class="sg-hyperlink" href="#" aria-haspopup="dialog" aria-expanded="false" data-lager-drawer-open="true"' . $nameData . $valueData . $typeData . '>' . auth_escape_html($value) . '</a></div>';
|
||||
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[] = '<div class="sg-large-table__cell' . $forecastClass . '" role="cell">' . auth_escape_html($forecastText) . '</div>';
|
||||
}
|
||||
$html[] = '</div>';
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user