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>
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
@model PowderCoating.Web.ViewModels.Reports.InvoiceAgingDetailViewModel
|
||||
@{ ViewData["Title"] = "Invoice Aging Detail"; }
|
||||
|
||||
<partial name="_ReportHeader" model="Model" />
|
||||
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-sm-6 col-md-3">
|
||||
<div class="card text-bg-danger">
|
||||
<div class="card-body py-2">
|
||||
<div class="small">Total Outstanding</div>
|
||||
<div class="fs-5 fw-bold">@Model.TotalBalance.ToString("C")</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-3">
|
||||
<div class="card border-secondary">
|
||||
<div class="card-body py-2 text-center">
|
||||
<div class="small text-muted">Open Invoices</div>
|
||||
<div class="fs-5 fw-bold">@Model.Items.Count</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-3">
|
||||
<div class="card border-warning">
|
||||
<div class="card-body py-2 text-center">
|
||||
<div class="small text-muted">Overdue (1–30 days)</div>
|
||||
<div class="fs-5 fw-bold text-warning">
|
||||
@Model.Items.Where(i => i.AgingBucket == "1–30 Days").Sum(i => i.BalanceDue).ToString("C")
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-3">
|
||||
<div class="card border-danger">
|
||||
<div class="card-body py-2 text-center">
|
||||
<div class="small text-muted">Overdue (90+ days)</div>
|
||||
<div class="fs-5 fw-bold text-danger">
|
||||
@Model.Items.Where(i => i.AgingBucket == "90+ Days").Sum(i => i.BalanceDue).ToString("C")
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<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>Invoice #</th>
|
||||
<th>Customer</th>
|
||||
<th>Invoice Date</th>
|
||||
<th>Due Date</th>
|
||||
<th class="text-end">Total</th>
|
||||
<th class="text-end">Paid</th>
|
||||
<th class="text-end">Balance Due</th>
|
||||
<th class="text-end">Days Overdue</th>
|
||||
<th>Aging Bucket</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.Items)
|
||||
{
|
||||
var bucketClass = item.AgingBucket switch {
|
||||
"Current" => "text-success",
|
||||
"1–30 Days" => "text-warning",
|
||||
"31–60 Days" => "text-orange",
|
||||
"61–90 Days" => "text-danger",
|
||||
"90+ Days" => "fw-bold text-danger",
|
||||
_ => ""
|
||||
};
|
||||
<tr>
|
||||
<td>
|
||||
<a asp-controller="Invoices" asp-action="Details" asp-route-id="@item.InvoiceId">
|
||||
@item.InvoiceNumber
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
@item.CustomerName
|
||||
@if (!string.IsNullOrEmpty(item.CustomerEmail))
|
||||
{
|
||||
<div class="small text-muted">@item.CustomerEmail</div>
|
||||
}
|
||||
</td>
|
||||
<td>@item.InvoiceDate.ToString("MMM d, yyyy")</td>
|
||||
<td>@(item.DueDate?.ToString("MMM d, yyyy") ?? "—")</td>
|
||||
<td class="text-end">@item.Total.ToString("C")</td>
|
||||
<td class="text-end text-success">@item.AmountPaid.ToString("C")</td>
|
||||
<td class="text-end fw-semibold">@item.BalanceDue.ToString("C")</td>
|
||||
<td class="text-end @bucketClass">
|
||||
@(item.DaysOverdue > 0 ? item.DaysOverdue.ToString() : "—")
|
||||
</td>
|
||||
<td><span class="badge @bucketClass bg-opacity-10 border">@item.AgingBucket</span></td>
|
||||
<td><span class="badge bg-secondary-subtle text-secondary">@item.StatusDisplay</span></td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
<tfoot class="table-light fw-bold">
|
||||
<tr>
|
||||
<td colspan="6">Total Outstanding</td>
|
||||
<td class="text-end">@Model.TotalBalance.ToString("C")</td>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user