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:
2026-05-14 20:09:22 -04:00
parent 3eda91f170
commit 4ec55e7290
240 changed files with 73116 additions and 0 deletions
@@ -0,0 +1,109 @@
@model PowderCoating.Core.Entities.BankReconciliation
@using PowderCoating.Web.Controllers
@{
ViewData["Title"] = $"Reconciliation Report {Model.Account?.Name}";
var clearedDeposits = ViewBag.ClearedDeposits as IEnumerable<PowderCoating.Core.Entities.Payment> ?? Enumerable.Empty<PowderCoating.Core.Entities.Payment>();
var clearedPayments = ViewBag.ClearedPayments as List<ReconciliationItem> ?? new();
}
<div class="d-flex align-items-center mb-3 gap-2 no-print">
<a asp-action="Index" class="btn btn-sm btn-outline-secondary">
<i class="bi bi-arrow-left me-1"></i>Back
</a>
<h4 class="mb-0 fw-semibold ms-2">Reconciliation Report</h4>
<button class="btn btn-sm btn-outline-secondary ms-auto" onclick="window.print()">
<i class="bi bi-printer me-1"></i>Print
</button>
</div>
<div class="card shadow-sm mb-3">
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h5 class="fw-semibold">@Model.Account?.Name</h5>
<p class="text-muted mb-0">Statement Date: @Model.StatementDate.ToString("MMMM d, yyyy")</p>
@if (Model.CompletedAt.HasValue)
{
<p class="text-muted small">Completed by @Model.CompletedBy on @Model.CompletedAt.Value.ToLocalTime().ToString("MMM d, yyyy")</p>
}
</div>
<div class="col-md-6 text-md-end">
<table class="table table-sm table-borderless mb-0 ms-auto" style="width:auto">
<tr>
<td class="text-muted">Beginning Balance:</td>
<td class="fw-semibold text-end">@Model.BeginningBalance.ToString("C")</td>
</tr>
<tr>
<td class="text-muted">+ Cleared Deposits:</td>
<td class="fw-semibold text-end text-success">@clearedDeposits.Sum(p => p.Amount).ToString("C")</td>
</tr>
<tr>
<td class="text-muted"> Cleared Payments:</td>
<td class="fw-semibold text-end text-danger">@clearedPayments.Sum(p => p.Amount).ToString("C")</td>
</tr>
<tr class="border-top">
<td class="fw-semibold">Statement Ending Balance:</td>
<td class="fw-bold text-end">@Model.EndingBalance.ToString("C")</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="row g-3">
<div class="col-md-6">
<div class="card shadow-sm">
<div class="card-header fw-semibold">Cleared Deposits (@clearedDeposits.Count())</div>
<div class="card-body p-0">
<table class="table table-sm mb-0">
<thead class="table-light"><tr><th>Date</th><th>Reference</th><th class="text-end">Amount</th></tr></thead>
<tbody>
@foreach (var p in clearedDeposits.OrderBy(p => p.PaymentDate))
{
<tr>
<td class="small">@p.PaymentDate.ToString("MMM d")</td>
<td class="small">@p.Reference</td>
<td class="text-end">@p.Amount.ToString("C")</td>
</tr>
}
</tbody>
<tfoot class="table-light fw-semibold">
<tr><td colspan="2" class="text-end">Total</td><td class="text-end">@clearedDeposits.Sum(p=>p.Amount).ToString("C")</td></tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card shadow-sm">
<div class="card-header fw-semibold">Cleared Payments (@clearedPayments.Count)</div>
<div class="card-body p-0">
<table class="table table-sm mb-0">
<thead class="table-light"><tr><th>Date</th><th>Reference</th><th class="text-end">Amount</th></tr></thead>
<tbody>
@foreach (var p in clearedPayments)
{
<tr>
<td class="small">@p.Date.ToString("MMM d")</td>
<td class="small">@p.Reference</td>
<td class="text-end">@p.Amount.ToString("C")</td>
</tr>
}
</tbody>
<tfoot class="table-light fw-semibold">
<tr><td colspan="2" class="text-end">Total</td><td class="text-end">@clearedPayments.Sum(p=>p.Amount).ToString("C")</td></tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
@if (!string.IsNullOrWhiteSpace(Model.Notes))
{
<div class="card shadow-sm mt-3">
<div class="card-header fw-semibold">Notes</div>
<div class="card-body">@Model.Notes</div>
</div>
}