Files
PowderCoatingLogix/src/PowderCoating.Web/Views/Reports/InventoryTurnover.cshtml
T
spouliot 4ec55e7290 Restore all zeroed views + add bulk gift certificate creation
The HTML entity sweep script had a bug where it wrote empty files for any
view that contained no target Unicode characters, zeroing out 215 view files.
All views restored from the pre-sweep commit (cefdf3e).

Bulk gift certificate feature:
- BulkCreateGiftCertificateDto with Quantity (1-500), Amount, Reason, Expiry, Notes
- GenerateBulkGiftCertificatePdfAsync on IPdfService / PdfService: one Letter page
  per cert, reusing the same purple/gold branded ComposeGiftCertificateContent helper
- GiftCertificatesController: BulkCreate GET/POST, BulkResult GET, BulkDownloadPdf POST
- Views: BulkCreate.cshtml (form with live total preview), BulkResult.cshtml (table +
  Download All PDF button that POSTs cert IDs to avoid URL length limits)
- gift-certificate-bulk.js: live preview + spinner/disable on submit
- Index.cshtml: Bulk Create button added alongside New Certificate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 20:09:22 -04:00

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>@(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>