Files
PowderCoatingLogix/src/PowderCoating.Web/Views/Vendors/Details.cshtml
T
spouliot 4ec55e7290 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>
2026-05-14 20:09:22 -04:00

300 lines
15 KiB
Plaintext

@model PowderCoating.Application.DTOs.Vendor.VendorDto
@{
ViewData["Title"] = Model.CompanyName;
ViewData["PageIcon"] = "bi-truck";
ViewData["PageHelpTitle"] = "Vendor Details";
ViewData["PageHelpContent"] = "Full detail for this vendor. Use Quick Actions to view or add inventory items assigned to this supplier, or create a purchase order. Business Information shows your account number at the vendor and their payment terms — these pre-fill on bills and purchase orders.";
}
<div class="row justify-content-center">
<div class="col-lg-10">
<div class="d-flex justify-content-end gap-2 mb-4">
<a asp-action="Statement" asp-route-id="@Model.Id" class="btn btn-outline-secondary">
<i class="bi bi-journal-text me-2"></i>Statement
</a>
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-warning">
<i class="bi bi-pencil me-2"></i>Edit
</a>
<a asp-action="Index" class="btn btn-outline-secondary">
<i class="bi bi-arrow-left me-2"></i>Back to List
</a>
</div>
<!-- Status Banner -->
<div class="alert @(Model.IsActive ? "alert-success" : "alert-danger") alert-permanent d-flex align-items-center mb-4">
<i class="bi @(Model.IsActive ? "bi-check-circle" : "bi-x-circle") me-2" style="font-size: 1.5rem;"></i>
<div>
<strong>Status:</strong> @(Model.IsActive ? "Active Vendor" : "Inactive Vendor")
@if (Model.IsPreferred)
{
<span class="badge bg-warning text-dark ms-3">
<i class="bi bi-star-fill"></i> Preferred Vendor
</span>
}
</div>
</div>
<div class="row g-4">
<!-- Left Column -->
<div class="col-lg-8">
<!-- Vendor Information -->
<div class="card border-0 shadow-sm mb-4">
<div class="card-header bg-white border-0 py-3">
<h5 class="mb-0 fw-semibold">
<i class="bi bi-truck me-2 text-primary"></i>Vendor Information
</h5>
</div>
<div class="card-body">
<div class="row g-3">
<div class="col-md-12">
<label class="text-muted small mb-1">Vendor Name</label>
<p class="fw-semibold mb-0">@Model.CompanyName</p>
</div>
</div>
</div>
</div>
<!-- Contact Information -->
<div class="card border-0 shadow-sm mb-4">
<div class="card-header bg-white border-0 py-3">
<h5 class="mb-0 fw-semibold">
<i class="bi bi-person me-2 text-primary"></i>Contact Information
</h5>
</div>
<div class="card-body">
<div class="row g-3">
<div class="col-md-6">
<label class="text-muted small mb-1">Contact Name</label>
<p class="mb-0">
@if (!string.IsNullOrEmpty(Model.ContactName))
{
<span>@Model.ContactName</span>
}
else
{
<span class="text-muted">Not provided</span>
}
</p>
</div>
<div class="col-md-6">
<label class="text-muted small mb-1">Email</label>
<p class="mb-0">
@if (!string.IsNullOrEmpty(Model.Email))
{
<a href="mailto:@Model.Email" class="text-decoration-none">
<i class="bi bi-envelope me-1"></i>@Model.Email
</a>
}
else
{
<span class="text-muted">Not provided</span>
}
</p>
</div>
<div class="col-md-6">
<label class="text-muted small mb-1">Phone</label>
<p class="mb-0">
@if (!string.IsNullOrEmpty(Model.Phone))
{
<a href="tel:@Model.Phone" class="text-decoration-none">
<i class="bi bi-telephone me-1"></i>@Model.Phone
</a>
}
else
{
<span class="text-muted">Not provided</span>
}
</p>
</div>
<div class="col-md-6">
<label class="text-muted small mb-1">Website</label>
<p class="mb-0">
@if (!string.IsNullOrEmpty(Model.Website))
{
<a href="@Model.Website" target="_blank" class="text-decoration-none">
<i class="bi bi-globe me-1"></i>@Model.Website
<i class="bi bi-box-arrow-up-right ms-1 small"></i>
</a>
}
else
{
<span class="text-muted">Not provided</span>
}
</p>
</div>
</div>
</div>
</div>
<!-- Address Information -->
<div class="card border-0 shadow-sm mb-4">
<div class="card-header bg-white border-0 py-3">
<h5 class="mb-0 fw-semibold">
<i class="bi bi-geo-alt me-2 text-primary"></i>Address
</h5>
</div>
<div class="card-body">
@if (!string.IsNullOrEmpty(Model.Address))
{
<p class="mb-2">@Model.Address</p>
<p class="mb-0">
@if (!string.IsNullOrEmpty(Model.City))
{
<span>@Model.City</span>
}
@if (!string.IsNullOrEmpty(Model.State))
{
<span>, @Model.State</span>
}
@if (!string.IsNullOrEmpty(Model.ZipCode))
{
<span> @Model.ZipCode</span>
}
</p>
@if (!string.IsNullOrEmpty(Model.Country))
{
<p class="mb-0 text-muted">@Model.Country</p>
}
}
else
{
<p class="text-muted mb-0">No address provided</p>
}
</div>
</div>
<!-- Business Information -->
<div class="card border-0 shadow-sm mb-4">
<div class="card-header bg-white border-0 py-3 d-flex align-items-center gap-2">
<h5 class="mb-0 fw-semibold">
<i class="bi bi-briefcase me-2 text-primary"></i>Business Information
</h5>
<a tabindex="0" class="help-icon" role="button"
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
data-bs-title="Business Information"
data-bs-content="Account Number is your customer account at this vendor — printed on purchase orders. Payment Terms drives the due date on bills (e.g. Net 30 = 30 days after receipt date). Credit Limit is informational only and does not block orders.">
<i class="bi bi-question-circle"></i>
</a>
</div>
<div class="card-body">
<div class="row g-3">
<div class="col-md-6">
<label class="text-muted small mb-1">Account Number</label>
<p class="mb-0">@(Model.AccountNumber ?? "Not provided")</p>
</div>
<div class="col-md-6">
<label class="text-muted small mb-1">Tax ID / EIN</label>
<p class="mb-0">@(Model.TaxId ?? "Not provided")</p>
</div>
<div class="col-md-6">
<label class="text-muted small mb-1">Payment Terms</label>
<p class="mb-0">@(Model.PaymentTerms ?? "Not set")</p>
</div>
<div class="col-md-6">
<label class="text-muted small mb-1">Credit Limit</label>
<p class="mb-0 fw-semibold">
@if (Model.CreditLimit.HasValue)
{
@Model.CreditLimit.Value.ToString("C")
}
else
{
<span class="text-muted">Not set</span>
}
</p>
</div>
</div>
</div>
</div>
<!-- Notes -->
@if (!string.IsNullOrEmpty(Model.Notes))
{
<div class="card border-0 shadow-sm mb-4">
<div class="card-header bg-white border-0 py-3">
<h5 class="mb-0 fw-semibold">
<i class="bi bi-journal-text me-2 text-primary"></i>Notes
</h5>
</div>
<div class="card-body">
<p class="mb-0" style="white-space: pre-wrap;">@Model.Notes</p>
</div>
</div>
}
</div>
<!-- Right Column - Information & Actions -->
<div class="col-lg-4">
<!-- Record Information -->
<div class="card border-0 shadow-sm mb-4">
<div class="card-header bg-white border-0 py-3">
<h5 class="mb-0 fw-semibold">
<i class="bi bi-clock-history me-2 text-primary"></i>Record Information
</h5>
</div>
<div class="card-body">
<div class="mb-3">
<label class="text-muted small mb-1">Vendor Since</label>
<p class="mb-0">@Model.CreatedAt.ToString("MMMM dd, yyyy")</p>
</div>
<div class="mb-3">
<label class="text-muted small mb-1">Status</label>
<p class="mb-0">
@if (Model.IsActive)
{
<span class="badge bg-success">Active</span>
}
else
{
<span class="badge bg-secondary">Inactive</span>
}
</p>
</div>
<div>
<label class="text-muted small mb-1">Preferred Vendor</label>
<p class="mb-0">
@if (Model.IsPreferred)
{
<span class="badge bg-warning text-dark">
<i class="bi bi-star-fill"></i> Yes
</span>
}
else
{
<span class="text-muted">No</span>
}
</p>
</div>
</div>
</div>
<!-- Quick Actions -->
<div class="card border-0 shadow-sm">
<div class="card-header bg-white border-0 py-3">
<h5 class="mb-0 fw-semibold">
<i class="bi bi-lightning me-2 text-primary"></i>Quick Actions
</h5>
</div>
<div class="card-body">
<div class="d-grid gap-2">
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-outline-primary">
<i class="bi bi-pencil me-2"></i>Edit Vendor
</a>
<a asp-controller="Inventory" asp-action="Index" asp-route-vendorId="@Model.Id" class="btn btn-outline-success">
<i class="bi bi-box-seam me-2"></i>View Inventory Items
</a>
<a asp-controller="Inventory" asp-action="Create" asp-route-vendorId="@Model.Id" class="btn btn-outline-success">
<i class="bi bi-plus-circle me-2"></i>Add Inventory Item
</a>
<a asp-action="Delete" asp-route-id="@Model.Id" class="btn btn-outline-danger">
<i class="bi bi-trash me-2"></i>Delete Vendor
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>