64a9c1531b
Razor's @() expression auto-encodes &, turning — into &mdash; which rendered as literal text in the browser. Wrapped all such expressions in @Html.Raw() so the em-dash entity is passed through unescaped. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
72 lines
3.4 KiB
Plaintext
72 lines
3.4 KiB
Plaintext
@model PowderCoating.Web.ViewModels.Reports.InventoryTurnoverViewModel
|
|
@{ ViewData["Title"] = "Inventory Turnover"; }
|
|
|
|
<partial name="_ReportHeader" model="Model" />
|
|
|
|
<div class="card">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<span class="fw-semibold">Stock Consumption Rates</span>
|
|
<div class="d-flex gap-2 small">
|
|
<span class="badge bg-danger">Critical ≤ 7 days</span>
|
|
<span class="badge bg-warning text-dark">Low ≤ 30 days</span>
|
|
<span class="badge bg-success">Normal</span>
|
|
<span class="badge bg-info">Overstocked</span>
|
|
</div>
|
|
</div>
|
|
<div class="card-body p-0">
|
|
<div class="table-responsive">
|
|
<table class="table table-sm table-hover mb-0">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>Item / SKU</th>
|
|
<th>Color</th>
|
|
<th class="text-end">Current Stock (lbs)</th>
|
|
<th class="text-end">Consumed (lbs)</th>
|
|
<th class="text-end">Purchased (lbs)</th>
|
|
<th class="text-end">Daily Use (lbs)</th>
|
|
<th class="text-end">Days to Stockout</th>
|
|
<th class="text-end">Turnover Rate</th>
|
|
<th>Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in Model.Items)
|
|
{
|
|
var statusBadge = item.StockStatus switch {
|
|
"Critical" => "bg-danger",
|
|
"Low" => "bg-warning text-dark",
|
|
"Normal" => "bg-success",
|
|
"Overstocked" => "bg-info",
|
|
_ => "bg-secondary"
|
|
};
|
|
var daysClass = item.StockStatus switch {
|
|
"Critical" => "text-danger fw-bold",
|
|
"Low" => "text-warning fw-semibold",
|
|
_ => ""
|
|
};
|
|
<tr>
|
|
<td>
|
|
<div class="fw-semibold">@item.ItemName</div>
|
|
@if (!string.IsNullOrEmpty(item.SKU))
|
|
{
|
|
<div class="small text-muted">@item.SKU</div>
|
|
}
|
|
</td>
|
|
<td>@Html.Raw(item.ColorName ?? "—")</td>
|
|
<td class="text-end">@item.CurrentStockLbs.ToString("N1")</td>
|
|
<td class="text-end">@item.TotalConsumedLbs.ToString("N1")</td>
|
|
<td class="text-end">@item.TotalPurchasedLbs.ToString("N1")</td>
|
|
<td class="text-end">@item.DailyConsumptionLbs.ToString("N3")</td>
|
|
<td class="text-end @daysClass">
|
|
@(item.DaysToStockout >= 9999 ? "∞" : item.DaysToStockout.ToString("N0"))
|
|
</td>
|
|
<td class="text-end">@item.TurnoverRate.ToString("N2")x</td>
|
|
<td><span class="badge @statusBadge">@item.StockStatus</span></td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|