Replace literal Unicode special chars with HTML entities across all 233 views
Sweeps em dashes, en dashes, multiplication signs, ellipses, and curly quotes to their HTML entity equivalents (— – × … ‘ ’) in all .cshtml files, skipping <script> blocks. Prevents encoding corruption from AI tools and Windows encoding mismatches that caused recurring symbol bugs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,230 +0,0 @@
|
||||
@using PowderCoating.Application.DTOs.Common
|
||||
@using PowderCoating.Application.DTOs.PurchaseOrder
|
||||
@using PowderCoating.Core.Enums
|
||||
@model PagedResult<PurchaseOrderListDto>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Purchase Orders";
|
||||
var searchTerm = ViewBag.SearchTerm as string;
|
||||
var statusFilter = ViewBag.StatusFilter as PurchaseOrderStatus?;
|
||||
var vendorId = ViewBag.VendorId as int?;
|
||||
var dateFrom = ViewBag.DateFrom as string;
|
||||
var dateTo = ViewBag.DateTo as string;
|
||||
var sortCol = (ViewBag.SortColumn as string ?? "orderdate").ToLower();
|
||||
var sortDir = (ViewBag.SortDirection as string ?? "desc").ToLower();
|
||||
|
||||
string SortIcon(string col) {
|
||||
if (col != sortCol) return "<i class=\"bi bi-arrow-down-up text-muted opacity-50\"></i>";
|
||||
return sortDir == "asc"
|
||||
? "<i class=\"bi bi-sort-up\"></i>"
|
||||
: "<i class=\"bi bi-sort-down\"></i>";
|
||||
}
|
||||
string SortHref(string col) {
|
||||
var dir = (col == sortCol && sortDir == "asc") ? "desc" : "asc";
|
||||
return $"?sortColumn={col}&sortDirection={dir}&searchTerm={searchTerm}&statusFilter={statusFilter}&vendorId={vendorId}&dateFrom={dateFrom}&dateTo={dateTo}&pageSize={Model.PageSize}";
|
||||
}
|
||||
|
||||
string StatusBadge(PurchaseOrderStatus s) => s switch {
|
||||
PurchaseOrderStatus.Draft => "secondary",
|
||||
PurchaseOrderStatus.Submitted => "primary",
|
||||
PurchaseOrderStatus.PartiallyReceived => "warning",
|
||||
PurchaseOrderStatus.Received => "success",
|
||||
PurchaseOrderStatus.Cancelled => "danger",
|
||||
_ => "secondary"
|
||||
};
|
||||
}
|
||||
|
||||
<!-- Stats Cards -->
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-6 col-md-3">
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<p class="text-muted mb-1 small">Total POs</p>
|
||||
<h3 class="mb-0 fw-bold">@ViewBag.TotalCount</h3>
|
||||
</div>
|
||||
<div class="rounded-circle p-3" style="background:#dbeafe;">
|
||||
<i class="bi bi-cart-check text-primary" style="font-size:1.4rem;"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-md-3">
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<p class="text-muted mb-1 small">Open</p>
|
||||
<h3 class="mb-0 fw-bold">@ViewBag.OpenCount</h3>
|
||||
</div>
|
||||
<div class="rounded-circle p-3" style="background:#fef9c3;">
|
||||
<i class="bi bi-hourglass-split text-warning" style="font-size:1.4rem;"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-md-3">
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<p class="text-muted mb-1 small">Committed Value</p>
|
||||
<h3 class="mb-0 fw-bold">$@ViewBag.CommittedValue?.ToString("N2")</h3>
|
||||
</div>
|
||||
<div class="rounded-circle p-3" style="background:#dcfce7;">
|
||||
<i class="bi bi-currency-dollar text-success" style="font-size:1.4rem;"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-md-3">
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<p class="text-muted mb-1 small">Overdue</p>
|
||||
<h3 class="mb-0 fw-bold text-danger">@ViewBag.OverdueCount</h3>
|
||||
</div>
|
||||
<div class="rounded-circle p-3" style="background:#fee2e2;">
|
||||
<i class="bi bi-exclamation-triangle text-danger" style="font-size:1.4rem;"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Toolbar -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<h4 class="mb-0">Purchase Orders</h4>
|
||||
<a tabindex="0" class="help-icon" role="button"
|
||||
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
|
||||
data-bs-title="Purchase Orders"
|
||||
data-bs-content="Track orders placed with vendors. Lifecycle: Draft (editable) → Submitted (sent to vendor) → Partially Received / Received → Create Bill. Overdue rows are highlighted red when Expected Delivery is past. Open shows Submitted + Partially Received POs. Use From Low Stock to pre-populate a PO with items that have fallen below their reorder point.">
|
||||
<i class="bi bi-question-circle"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<a asp-action="CreateFromLowStock" class="btn btn-outline-warning btn-sm">
|
||||
<i class="bi bi-lightning-charge"></i> From Low Stock
|
||||
</a>
|
||||
<a asp-action="Create" class="btn btn-primary btn-sm">
|
||||
<i class="bi bi-plus-lg"></i> New Purchase Order
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
<form method="get" class="card border-0 shadow-sm mb-3">
|
||||
<div class="card-body py-2">
|
||||
<div class="row g-2 align-items-end">
|
||||
<div class="col-md-3">
|
||||
<input type="text" name="searchTerm" value="@searchTerm" class="form-control form-control-sm"
|
||||
placeholder="Search PO#, vendor, notes…" />
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select name="statusFilter" class="form-select form-select-sm">
|
||||
<option value="">All Statuses</option>
|
||||
@foreach (var s in Enum.GetValues<PurchaseOrderStatus>())
|
||||
{
|
||||
<option value="@((int)s)" selected="@(statusFilter == s)">@s.ToString()</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select name="vendorId" class="form-select form-select-sm" asp-items="@ViewBag.VendorList">
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<input type="date" name="dateFrom" value="@dateFrom" class="form-control form-control-sm" title="From" />
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<input type="date" name="dateTo" value="@dateTo" class="form-control form-control-sm" title="To" />
|
||||
</div>
|
||||
<div class="col-md-1 d-flex gap-1">
|
||||
<button type="submit" class="btn btn-primary btn-sm flex-grow-1">
|
||||
<i class="bi bi-search"></i>
|
||||
</button>
|
||||
<a asp-action="Index" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-x"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="sortColumn" value="@sortCol" />
|
||||
<input type="hidden" name="sortDirection" value="@sortDir" />
|
||||
<input type="hidden" name="pageSize" value="@Model.PageSize" />
|
||||
</form>
|
||||
|
||||
<!-- Grid -->
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th><a href="@SortHref("ponumber")" class="text-decoration-none text-dark">PO # @Html.Raw(SortIcon("ponumber"))</a></th>
|
||||
<th><a href="@SortHref("vendor")" class="text-decoration-none text-dark">Vendor @Html.Raw(SortIcon("vendor"))</a></th>
|
||||
<th><a href="@SortHref("status")" class="text-decoration-none text-dark">Status @Html.Raw(SortIcon("status"))</a></th>
|
||||
<th><a href="@SortHref("orderdate")" class="text-decoration-none text-dark">Order Date @Html.Raw(SortIcon("orderdate"))</a></th>
|
||||
<th><a href="@SortHref("expected")" class="text-decoration-none text-dark">Expected @Html.Raw(SortIcon("expected"))</a></th>
|
||||
<th class="text-center">Items</th>
|
||||
<th class="text-end"><a href="@SortHref("total")" class="text-decoration-none text-dark">Total @Html.Raw(SortIcon("total"))</a></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (!Model.Items.Any())
|
||||
{
|
||||
<tr>
|
||||
<td colspan="8" class="text-center py-5 text-muted">
|
||||
<i class="bi bi-cart-x d-block" style="font-size:2.5rem;"></i>
|
||||
<p class="mt-2 mb-0">No purchase orders found.</p>
|
||||
<a asp-action="Create" class="btn btn-primary btn-sm mt-3">Create Your First PO</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var po in Model.Items)
|
||||
{
|
||||
<tr class="@(po.IsOverdue ? "table-danger" : "")">
|
||||
<td>
|
||||
<a asp-action="Details" asp-route-id="@po.Id" class="fw-semibold text-decoration-none">
|
||||
@po.PoNumber
|
||||
</a>
|
||||
@if (po.IsOverdue)
|
||||
{
|
||||
<span class="badge bg-danger ms-1">Overdue</span>
|
||||
}
|
||||
</td>
|
||||
<td>@po.VendorName</td>
|
||||
<td>
|
||||
<span class="badge bg-@StatusBadge(po.Status)">
|
||||
@po.Status.ToString()
|
||||
</span>
|
||||
</td>
|
||||
<td>@po.OrderDate.ToString("MM/dd/yyyy")</td>
|
||||
<td>@(po.ExpectedDeliveryDate?.ToString("MM/dd/yyyy") ?? "—")</td>
|
||||
<td class="text-center">@po.ItemCount</td>
|
||||
<td class="text-end fw-semibold">$@po.TotalAmount.ToString("N2")</td>
|
||||
<td class="text-end">
|
||||
<a asp-action="Details" asp-route-id="@po.Id" class="btn btn-sm btn-outline-primary">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<partial name="_Pagination" model="Model" />
|
||||
|
||||
Reference in New Issue
Block a user