Files
PowderCoatingLogix/src/PowderCoating.Web/Views/Vendors/Create.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

228 lines
15 KiB
Plaintext

@model PowderCoating.Application.DTOs.Vendor.CreateVendorDto
@{
ViewData["Title"] = "Add New Vendor";
ViewData["PageIcon"] = "bi-truck";
ViewData["PageHelpTitle"] = "Add New Vendor";
ViewData["PageHelpContent"] = "Add a supplier you purchase materials from. Mark as Preferred to prioritize them in purchase order pickers. Set Default Expense Account and Payment Terms to pre-fill bills created from this vendor's POs. Account Number is your customer account number at the vendor — useful on purchase orders.";
}
<div class="row justify-content-center">
<div class="col-lg-10">
<div class="d-flex justify-content-end align-items-center mb-4">
<a asp-action="Index" class="btn btn-outline-secondary">
<i class="bi bi-arrow-left me-2"></i>Back to List
</a>
</div>
<div class="card border-0 shadow-sm">
<div class="card-body p-4">
<form asp-action="Create" method="post">
<partial name="_ValidationSummary" />
<!-- Company Information Section -->
<div class="mb-4">
<div class="d-flex align-items-center gap-2 border-bottom pb-2 mb-3">
<h5 class="mb-0">
<i class="bi bi-truck me-2 text-primary"></i>Vendor 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="Vendor Information"
data-bs-content="Vendor Name is required — use the official company name as it appears on invoices. Preferred Vendor marks this supplier as a go-to source; preferred vendors are listed first in purchase order dropdowns.">
<i class="bi bi-question-circle"></i>
</a>
</div>
<div class="row g-3">
<div class="col-md-8">
<label asp-for="CompanyName" class="form-label">Vendor Name</label>
<input asp-for="CompanyName" class="form-control" placeholder="Enter vendor name" />
<span asp-validation-for="CompanyName" class="text-danger"></span>
</div>
<div class="col-md-4">
<label asp-for="IsPreferred" class="form-label">Status</label>
<div class="form-check form-switch mt-2">
<input asp-for="IsPreferred" class="form-check-input" type="checkbox" />
<label asp-for="IsPreferred" class="form-check-label">Preferred Vendor</label>
</div>
</div>
</div>
</div>
<!-- Contact Information Section -->
<div class="mb-4">
<h5 class="border-bottom pb-2 mb-3">
<i class="bi bi-person me-2 text-primary"></i>Contact Information
</h5>
<div class="row g-3">
<div class="col-md-6">
<label asp-for="ContactName" class="form-label">Contact Name</label>
<input asp-for="ContactName" class="form-control" placeholder="Enter contact name" />
<span asp-validation-for="ContactName" class="text-danger"></span>
</div>
<div class="col-md-6">
<label asp-for="Email" class="form-label">Email</label>
<input asp-for="Email" type="email" class="form-control" placeholder="name@example.com" />
<span asp-validation-for="Email" class="text-danger"></span>
</div>
<div class="col-md-6">
<label asp-for="Phone" class="form-label">Phone</label>
<input asp-for="Phone" type="tel" class="form-control" placeholder="(555) 123-4567" />
<span asp-validation-for="Phone" class="text-danger"></span>
</div>
<div class="col-md-6">
<label asp-for="Website" class="form-label">Website</label>
<input asp-for="Website" type="url" class="form-control" placeholder="https://www.example.com" />
<span asp-validation-for="Website" class="text-danger"></span>
</div>
</div>
</div>
<!-- Address Section -->
<div class="mb-4">
<h5 class="border-bottom pb-2 mb-3">
<i class="bi bi-geo-alt me-2 text-primary"></i>Address
</h5>
<div class="row g-3">
<div class="col-12">
<label asp-for="Address" class="form-label">Street Address</label>
<input asp-for="Address" class="form-control" placeholder="Enter street address" />
<span asp-validation-for="Address" class="text-danger"></span>
</div>
<div class="col-md-5">
<label asp-for="City" class="form-label">City</label>
<input asp-for="City" class="form-control" placeholder="Enter city" />
<span asp-validation-for="City" class="text-danger"></span>
</div>
<div class="col-md-3">
<label asp-for="State" class="form-label">State</label>
<input asp-for="State" class="form-control" placeholder="Enter state" maxlength="2" />
<span asp-validation-for="State" class="text-danger"></span>
</div>
<div class="col-md-2">
<label asp-for="ZipCode" class="form-label">Zip Code</label>
<input asp-for="ZipCode" class="form-control" placeholder="12345" />
<span asp-validation-for="ZipCode" class="text-danger"></span>
</div>
<div class="col-md-2">
<label asp-for="Country" class="form-label">Country</label>
<select asp-for="Country" class="form-select">
<option value="">-- Select --</option>
<option value="USA">USA</option>
<option value="Canada">Canada</option>
<option value="Mexico">Mexico</option>
<option value="United Kingdom">United Kingdom</option>
<option value="China">China</option>
<option value="Germany">Germany</option>
<option value="Japan">Japan</option>
<option value="India">India</option>
<option value="Australia">Australia</option>
<option value="France">France</option>
<option value="Italy">Italy</option>
<option value="Spain">Spain</option>
<option value="Brazil">Brazil</option>
<option value="South Korea">South Korea</option>
<option value="Netherlands">Netherlands</option>
<option value="Switzerland">Switzerland</option>
</select>
<span asp-validation-for="Country" class="text-danger"></span>
</div>
</div>
</div>
<!-- Business Information Section -->
<div class="mb-4">
<div class="d-flex align-items-center gap-2 border-bottom pb-2 mb-3">
<h5 class="mb-0">
<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 number at the vendor (printed on POs and bills). Default Expense Account pre-fills the expense category when creating bills from this vendor's purchase orders. Payment Terms sets the expected due date on bills (e.g. Net 30 = due 30 days after receipt). Credit Limit is informational only.">
<i class="bi bi-question-circle"></i>
</a>
</div>
<div class="row g-3">
<div class="col-md-6">
<label asp-for="AccountNumber" class="form-label">Account Number</label>
<input asp-for="AccountNumber" class="form-control" placeholder="Enter account number" />
<span asp-validation-for="AccountNumber" class="text-danger"></span>
</div>
<div class="col-md-6">
<label asp-for="TaxId" class="form-label">Tax ID / EIN</label>
<input asp-for="TaxId" class="form-control" placeholder="Enter tax ID" />
<span asp-validation-for="TaxId" class="text-danger"></span>
</div>
<div class="col-md-6">
<label asp-for="DefaultExpenseAccountId" class="form-label">Default Expense Account</label>
<select asp-for="DefaultExpenseAccountId" asp-items="@ViewBag.ExpenseAccounts" class="form-select"></select>
<div class="form-text text-muted">Used to pre-fill bills created from this vendor's POs.</div>
</div>
<div class="col-md-6">
<label asp-for="PaymentTerms" class="form-label">Payment Terms</label>
<select asp-for="PaymentTerms" class="form-select">
<option value="">Select payment terms</option>
<option value="Net 15">Net 15</option>
<option value="Net 30">Net 30</option>
<option value="Net 45">Net 45</option>
<option value="Net 60">Net 60</option>
<option value="Due on Receipt">Due on Receipt</option>
<option value="Cash on Delivery">Cash on Delivery</option>
<option value="Prepaid">Prepaid</option>
</select>
<span asp-validation-for="PaymentTerms" class="text-danger"></span>
</div>
<div class="col-md-6">
<label asp-for="CreditLimit" class="form-label">Credit Limit</label>
<div class="input-group">
<span class="input-group-text">$</span>
<input asp-for="CreditLimit" type="number" step="0.01" min="0" class="form-control" placeholder="0.00" />
</div>
<span asp-validation-for="CreditLimit" class="text-danger"></span>
</div>
<div class="col-md-6">
<div class="form-check form-switch mt-4">
<input asp-for="IsActive" class="form-check-input" type="checkbox" checked />
<label asp-for="IsActive" class="form-check-label">Active Vendor</label>
</div>
<div class="form-check form-switch mt-2">
<input asp-for="Is1099Vendor" class="form-check-input" type="checkbox" />
<label asp-for="Is1099Vendor" class="form-check-label">1099 Vendor</label>
</div>
<div class="form-text">Check if this vendor requires a 1099-NEC at year end (typically non-incorporated service providers paid ≥ $600).</div>
</div>
</div>
</div>
<!-- Notes Section -->
<div class="mb-4">
<h5 class="border-bottom pb-2 mb-3">
<i class="bi bi-journal-text me-2 text-primary"></i>Notes
</h5>
<div class="row g-3">
<div class="col-12">
<label asp-for="Notes" class="form-label">Notes</label>
<textarea asp-for="Notes" class="form-control" rows="4" placeholder="Enter any additional notes about this vendor"></textarea>
<span asp-validation-for="Notes" class="text-danger"></span>
</div>
</div>
</div>
<!-- Form Actions -->
<div class="d-flex gap-2 justify-content-end pt-3 border-top">
<a asp-action="Index" class="btn btn-outline-secondary px-4">Cancel</a>
<button type="submit" class="btn btn-primary px-4">
<i class="bi bi-check-circle me-2"></i>Create Vendor
</button>
</div>
</form>
</div>
</div>
</div>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}