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,94 @@
@model PowderCoating.Application.DTOs.Customer.UpdatePricingTierDto
@{
ViewData["Title"] = "Edit Pricing Tier";
ViewData["PageIcon"] = "bi-tags-fill";
}
<div class="container-fluid mt-4">
<div class="d-flex justify-content-end gap-2 mb-4">
<a asp-controller="Help" asp-action="Settings" class="btn btn-outline-secondary" target="_blank" title="Settings help">
<i class="bi bi-question-circle"></i>
<span class="d-none d-sm-inline ms-1">Help</span>
</a>
<a asp-action="Index" class="btn btn-outline-secondary">
<i class="bi bi-arrow-left me-1"></i>Back to Tiers
</a>
</div>
<div class="row justify-content-center">
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0"><i class="bi bi-tag me-2"></i>Tier Details</h5>
</div>
<div class="card-body">
<form asp-action="Edit" method="post">
@Html.AntiForgeryToken()
<input type="hidden" asp-for="Id" />
<div class="mb-3">
<label asp-for="TierName" class="form-label fw-semibold">Tier Name</label>
<a tabindex="0" class="help-icon" role="button"
data-bs-toggle="popover" data-bs-placement="right"
data-bs-title="Tier Name"
data-bs-content="Choose a name that communicates the customer relationship level — for example &lt;em&gt;Silver&lt;/em&gt;, &lt;em&gt;Gold&lt;/em&gt;, &lt;em&gt;Preferred Shop&lt;/em&gt;, or &lt;em&gt;Wholesale&lt;/em&gt;. The name is visible to your staff when editing customers and appears in the quote pricing breakdown.">
<i class="bi bi-question-circle"></i>
</a>
<input asp-for="TierName" class="form-control" autofocus />
<span asp-validation-for="TierName" class="text-danger"></span>
</div>
<div class="mb-3">
<label asp-for="Description" class="form-label fw-semibold">Description</label>
<input asp-for="Description" class="form-control" placeholder="Optional — shown on customer profiles" />
<span asp-validation-for="Description" class="text-danger"></span>
</div>
<div class="mb-3">
<label asp-for="DiscountPercent" class="form-label fw-semibold">Discount %</label>
<a tabindex="0" class="help-icon" role="button"
data-bs-toggle="popover" data-bs-placement="right"
data-bs-title="Discount Percentage"
data-bs-content="This percentage is automatically deducted from the subtotal of every new quote created for a customer on this tier. &lt;strong&gt;Changing this value affects all future quotes&lt;/strong&gt; for customers on the tier — existing quotes are not recalculated. Enter &lt;strong&gt;0&lt;/strong&gt; for standard pricing with no discount.">
<i class="bi bi-question-circle"></i>
</a>
<div class="input-group" style="max-width: 200px;">
<input asp-for="DiscountPercent" class="form-control" type="number"
min="0" max="100" step="0.01" />
<span class="input-group-text">%</span>
</div>
<div class="form-text">Changes apply immediately to all new quotes for customers on this tier.</div>
<span asp-validation-for="DiscountPercent" class="text-danger"></span>
</div>
<div class="mb-4">
<div class="form-check">
<input asp-for="IsActive" class="form-check-input" type="checkbox" />
<label asp-for="IsActive" class="form-check-label fw-semibold">Active</label>
<a tabindex="0" class="help-icon" role="button"
data-bs-toggle="popover" data-bs-placement="right"
data-bs-title="Active Status"
data-bs-content="Active tiers appear in the tier dropdown when editing a customer record. Uncheck this to hide the tier from the dropdown without deleting it — useful for legacy tiers that still have customers assigned but should not be used for new assignments.">
<i class="bi bi-question-circle"></i>
</a>
<div class="form-text">Inactive tiers cannot be assigned to new customers.</div>
</div>
</div>
<div class="d-flex gap-2 justify-content-end">
<a asp-action="Index" class="btn btn-outline-secondary">Cancel</a>
<button type="submit" class="btn btn-primary">
<i class="bi bi-check-circle me-1"></i>Save Changes
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@section Scripts {
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}