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>
96 lines
4.2 KiB
Plaintext
96 lines
4.2 KiB
Plaintext
@model PowderCoating.Web.ViewModels.Reports.SalesByCustomerViewModel
|
|
@{ ViewData["Title"] = "Sales by Customer"; }
|
|
|
|
<partial name="_ReportHeader" model="Model" />
|
|
|
|
<div class="row g-3 mb-3">
|
|
<div class="col-sm-4">
|
|
<div class="card text-bg-primary">
|
|
<div class="card-body py-2">
|
|
<div class="small">Total Invoiced</div>
|
|
<div class="fs-5 fw-bold">@Model.TotalInvoiced.ToString("C")</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-4">
|
|
<div class="card text-bg-success">
|
|
<div class="card-body py-2">
|
|
<div class="small">Total Collected</div>
|
|
<div class="fs-5 fw-bold">@Model.TotalPaid.ToString("C")</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-4">
|
|
<div class="card text-bg-warning">
|
|
<div class="card-body py-2">
|
|
<div class="small">Outstanding Balance</div>
|
|
<div class="fs-5 fw-bold">@((Model.TotalInvoiced - Model.TotalPaid).ToString("C"))</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<span class="fw-semibold">Customer Sales Summary</span>
|
|
<span class="text-muted small">@Model.Items.Count customers</span>
|
|
</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>Customer</th>
|
|
<th>Type</th>
|
|
<th class="text-end">Invoices</th>
|
|
<th class="text-end">Total Invoiced</th>
|
|
<th class="text-end">Total Paid</th>
|
|
<th class="text-end">Balance Due</th>
|
|
<th class="text-end">Avg Invoice</th>
|
|
<th>Last Invoice</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in Model.Items)
|
|
{
|
|
<tr>
|
|
<td>
|
|
<a asp-controller="Customers" asp-action="Details" asp-route-id="@item.CustomerId">
|
|
@item.CustomerName
|
|
</a>
|
|
</td>
|
|
<td>
|
|
@if (item.IsCommercial)
|
|
{
|
|
<span class="badge bg-info-subtle text-info">Commercial</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="badge bg-secondary-subtle text-secondary">Individual</span>
|
|
}
|
|
</td>
|
|
<td class="text-end">@item.InvoiceCount</td>
|
|
<td class="text-end fw-semibold">@item.TotalInvoiced.ToString("C")</td>
|
|
<td class="text-end text-success">@item.TotalPaid.ToString("C")</td>
|
|
<td class="text-end @(item.BalanceDue > 0 ? "text-warning fw-semibold" : "")">
|
|
@item.BalanceDue.ToString("C")
|
|
</td>
|
|
<td class="text-end">@item.AvgInvoiceValue.ToString("C")</td>
|
|
<td>@Html.Raw(item.LastInvoiceDate?.ToString("MMM d, yyyy") ?? "—")</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
<tfoot class="table-light fw-bold">
|
|
<tr>
|
|
<td colspan="3">Totals</td>
|
|
<td class="text-end">@Model.TotalInvoiced.ToString("C")</td>
|
|
<td class="text-end text-success">@Model.TotalPaid.ToString("C")</td>
|
|
<td class="text-end">@((Model.TotalInvoiced - Model.TotalPaid).ToString("C"))</td>
|
|
<td colspan="2"></td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|