Initial commit

This commit is contained in:
2026-04-23 21:38:24 -04:00
commit 63e12a9636
1762 changed files with 1672620 additions and 0 deletions
@@ -0,0 +1,58 @@
@model PowderCoating.Web.ViewModels.QuoteApprovalViewModel
@{
Layout = "_QuoteApprovalLayout";
ViewData["Title"] = "Already Responded";
ViewBag.CompanyName = Model.CompanyName;
bool isApproved = Model.CurrentStatus != null &&
(Model.CurrentStatus.Equals("Approved", StringComparison.OrdinalIgnoreCase) ||
Model.CurrentStatus.Equals("Accepted", StringComparison.OrdinalIgnoreCase));
}
<div class="card text-center mb-4">
<div class="card-body py-5">
<div class="mb-3">
<i class="bi bi-info-circle-fill text-info" style="font-size:4rem;"></i>
</div>
<h3 class="fw-bold mb-2">Already Responded</h3>
<p class="text-muted mb-1">
You have already responded to quote <strong>@Model.QuoteNumber</strong>.
</p>
@if (!string.IsNullOrWhiteSpace(Model.CurrentStatus))
{
<p class="mb-1">
Current status: <span class="badge bg-secondary fs-6">@Model.CurrentStatus</span>
</p>
}
@if (!string.IsNullOrWhiteSpace(Model.DeclineReason))
{
<div class="mt-3 p-3 bg-light rounded text-start">
<small class="text-muted fw-semibold">Your reason for declining:</small>
<p class="mb-0 mt-1">@Model.DeclineReason</p>
</div>
}
<p class="text-muted mt-3">
If you need to change your response, please contact <strong>@Model.CompanyName</strong>.
</p>
</div>
</div>
@if (!string.IsNullOrWhiteSpace(Model.CompanyPhone) || !string.IsNullOrWhiteSpace(Model.CompanyEmail))
{
<div class="text-center text-muted small mb-3">
@if (!string.IsNullOrWhiteSpace(Model.CompanyPhone))
{
<a href="tel:@Model.CompanyPhone" class="text-muted me-3">
<i class="bi bi-telephone me-1"></i>@Model.CompanyPhone
</a>
}
@if (!string.IsNullOrWhiteSpace(Model.CompanyEmail))
{
<a href="mailto:@Model.CompanyEmail" class="text-muted">
<i class="bi bi-envelope me-1"></i>@Model.CompanyEmail
</a>
}
</div>
}
@@ -0,0 +1,237 @@
@model PowderCoating.Web.ViewModels.QuoteApprovalViewModel
@{
Layout = "_QuoteApprovalLayout";
ViewData["Title"] = $"Quote {Model.QuoteNumber}";
ViewBag.CompanyName = Model.CompanyName;
var daysUntilExpiry = Model.ExpirationDate.HasValue
? (Model.ExpirationDate.Value.Date - DateTime.UtcNow.Date).TotalDays
: (double?)null;
bool soonExpiry = daysUntilExpiry.HasValue && daysUntilExpiry.Value >= 0 && daysUntilExpiry.Value <= 3;
bool expired = daysUntilExpiry.HasValue && daysUntilExpiry.Value < 0;
bool showDeclinePanel = Model.DeclineError != null;
}
<!-- Quote Header -->
<div class="card mb-4">
<div class="card-body">
<div class="d-flex justify-content-between align-items-start flex-wrap gap-2">
<div>
<h4 class="fw-bold mb-1">Quote <span class="text-primary">@Model.QuoteNumber</span></h4>
<p class="text-muted mb-0">Prepared for <strong>@Model.CustomerName</strong></p>
</div>
<div class="text-end">
@if (Model.ExpirationDate.HasValue)
{
<small class="text-muted d-block">Valid until</small>
<strong class="@(soonExpiry ? "text-warning" : expired ? "text-danger" : "")">
@Model.ExpirationDate.Value.ToString("MMMM d, yyyy")
</strong>
}
</div>
</div>
@if (soonExpiry)
{
<div class="alert alert-warning mt-3 mb-0 py-2">
<i class="bi bi-exclamation-triangle-fill me-1"></i>
This quote expires in @((int)daysUntilExpiry!.Value) day(s). Please respond promptly.
</div>
}
@if (!string.IsNullOrWhiteSpace(Model.Description))
{
<p class="mt-3 mb-0 text-muted">@Model.Description</p>
}
</div>
</div>
<!-- Line Items -->
<div class="card mb-4">
<div class="card-header bg-transparent fw-semibold">
<i class="bi bi-list-ul me-1"></i>Quote Items
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-sm mb-0">
<thead class="table-light">
<tr>
<th class="ps-3">Description</th>
<th class="text-center" style="width:70px;">Qty</th>
<th class="text-end" style="width:110px;">Unit Price</th>
<th class="text-end pe-3" style="width:110px;">Total</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Items)
{
<tr>
<td class="ps-3">@item.Description</td>
<td class="text-center">@item.Quantity</td>
<td class="text-end">@item.UnitPrice.ToString("C")</td>
<td class="text-end pe-3">@item.TotalPrice.ToString("C")</td>
</tr>
}
@if (!Model.Items.Any())
{
<tr>
<td colspan="4" class="text-center text-muted py-3">No line items</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
<!-- Totals -->
<div class="card mb-4">
<div class="card-body">
<div class="row justify-content-end">
<div class="col-sm-6 col-md-5">
<div class="d-flex justify-content-between mb-1">
<span class="text-muted">Subtotal</span>
<span>@Model.SubTotal.ToString("C")</span>
</div>
@if (Model.DiscountAmount > 0 && !Model.HideDiscountFromCustomer)
{
<div class="d-flex justify-content-between mb-1 text-success">
<span>Discount</span>
<span>-@Model.DiscountAmount.ToString("C")</span>
</div>
}
@if (Model.RushFee > 0)
{
<div class="d-flex justify-content-between mb-1 text-warning">
<span><i class="bi bi-lightning-fill me-1"></i>Rush Fee</span>
<span>@Model.RushFee.ToString("C")</span>
</div>
}
@if (Model.TaxAmount > 0)
{
<div class="d-flex justify-content-between mb-1 text-muted">
<span>Tax</span>
<span>@Model.TaxAmount.ToString("C")</span>
</div>
}
<hr class="my-2" />
<div class="d-flex justify-content-between fw-bold fs-5">
<span>Total</span>
<span>@Model.Total.ToString("C")</span>
</div>
</div>
</div>
</div>
</div>
@if (!string.IsNullOrWhiteSpace(Model.Terms))
{
<div class="card mb-4">
<div class="card-header bg-transparent fw-semibold">
<i class="bi bi-file-text me-1"></i>Terms &amp; Conditions
</div>
<div class="card-body text-muted" style="white-space:pre-wrap;">@Model.Terms</div>
</div>
}
@if (!string.IsNullOrWhiteSpace(Model.SpecialInstructions))
{
<div class="card mb-4">
<div class="card-header bg-transparent fw-semibold">
<i class="bi bi-info-circle me-1"></i>Special Instructions
</div>
<div class="card-body text-muted">@Model.SpecialInstructions</div>
</div>
}
<!-- Decline error alert -->
@if (!string.IsNullOrWhiteSpace(Model.DeclineError))
{
<div class="alert alert-danger">
<i class="bi bi-exclamation-circle me-1"></i>@Model.DeclineError
</div>
}
<!-- Action Section -->
<div class="card mb-4">
<div class="card-body">
<h6 class="fw-semibold mb-3">Please review and respond to this quote</h6>
<!-- Approve form -->
<form method="post" action="/quote-approval/@Model.Token/approve">
@Html.AntiForgeryToken()
<button type="submit" class="btn btn-success btn-lg w-100 mb-3">
<i class="bi bi-check-circle me-2"></i>Approve this Quote
</button>
</form>
<!-- Decline toggle button -->
<button type="button" class="btn btn-outline-danger w-100" id="declineToggle">
<i class="bi bi-x-circle me-2"></i>Decline this Quote
</button>
<!-- Decline form (hidden initially unless there was a validation error) -->
<div id="declinePanel" style="display:@(showDeclinePanel ? "block" : "none");" class="mt-3 p-3 border border-danger rounded">
<form method="post" action="/quote-approval/@Model.Token/decline">
@Html.AntiForgeryToken()
<label class="form-label fw-semibold">
Please tell us why you're declining <span class="text-danger">*</span>
</label>
<textarea name="reason"
class="form-control mb-3"
rows="4"
maxlength="1000"
placeholder="Please share your reason so we can improve our service..."
required></textarea>
<button type="submit" class="btn btn-danger w-100">
<i class="bi bi-x-circle me-2"></i>Submit Decline
</button>
</form>
</div>
</div>
</div>
@if (!string.IsNullOrWhiteSpace(Model.CompanyPhone) || !string.IsNullOrWhiteSpace(Model.CompanyEmail))
{
<div class="text-center text-muted small mb-3">
<p class="mb-1">Questions? Contact us:</p>
@if (!string.IsNullOrWhiteSpace(Model.CompanyPhone))
{
<a href="tel:@Model.CompanyPhone" class="text-muted me-3">
<i class="bi bi-telephone me-1"></i>@Model.CompanyPhone
</a>
}
@if (!string.IsNullOrWhiteSpace(Model.CompanyEmail))
{
<a href="mailto:@Model.CompanyEmail" class="text-muted">
<i class="bi bi-envelope me-1"></i>@Model.CompanyEmail
</a>
}
</div>
}
@section Scripts {
<script>
(function () {
var toggle = document.getElementById('declineToggle');
var panel = document.getElementById('declinePanel');
// If panel is already visible (validation error), update button label
if (panel.style.display !== 'none') {
toggle.innerHTML = '<i class="bi bi-x me-2"></i>Cancel';
panel.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
toggle.addEventListener('click', function () {
if (panel.style.display === 'none') {
panel.style.display = 'block';
toggle.innerHTML = '<i class="bi bi-x me-2"></i>Cancel';
panel.scrollIntoView({ behavior: 'smooth', block: 'center' });
} else {
panel.style.display = 'none';
toggle.innerHTML = '<i class="bi bi-x-circle me-2"></i>Decline this Quote';
}
});
})();
</script>
}
@@ -0,0 +1,85 @@
@model PowderCoating.Web.ViewModels.QuoteApprovalViewModel
@{
Layout = "_QuoteApprovalLayout";
ViewData["Title"] = "One Last Step";
ViewBag.CompanyName = Model.CompanyName;
}
<div class="card mb-4">
<div class="card-body">
<h4 class="fw-bold mb-1">Almost done!</h4>
<p class="text-muted mb-0">
You're approving quote <strong>@Model.QuoteNumber</strong> for <strong>@Model.Total.ToString("C")</strong>.
Please confirm your contact details so <strong>@Model.CompanyName</strong> can reach you.
</p>
</div>
</div>
@if (!string.IsNullOrEmpty(Model.DeclineError))
{
<div class="alert alert-danger">@Model.DeclineError</div>
}
<div class="card">
<div class="card-body">
<form method="post" action="/quote-approval/@Model.Token/confirm-details">
@Html.AntiForgeryToken()
<div class="row g-3">
<div class="col-md-6">
<label class="form-label fw-semibold">Your Name <span class="text-danger">*</span></label>
<input type="text" name="contactName" class="form-control"
value="@Model.ProspectContactName" placeholder="First Last" required />
</div>
<div class="col-md-6">
<label class="form-label fw-semibold">Company Name <small class="text-muted fw-normal">(if applicable)</small></label>
<input type="text" name="companyName" class="form-control"
value="@Model.ProspectCompanyName" placeholder="Your Business Name" />
</div>
<div class="col-md-6">
<label class="form-label fw-semibold">Email <span class="text-danger">*</span></label>
<input type="email" name="email" class="form-control"
value="@Model.ProspectEmail" placeholder="you@example.com" />
<div class="form-text">Required if no phone provided.</div>
</div>
<div class="col-md-6">
<label class="form-label fw-semibold">Phone <span class="text-danger">*</span></label>
<input type="tel" name="phone" class="form-control"
value="@Model.ProspectPhone" placeholder="(555) 555-5555" />
<div class="form-text">Required if no email provided.</div>
</div>
<div class="col-12">
<label class="form-label fw-semibold">Street Address <small class="text-muted fw-normal">(optional)</small></label>
<input type="text" name="address" class="form-control"
value="@Model.ProspectAddress" placeholder="123 Main St" />
</div>
<div class="col-md-5">
<label class="form-label fw-semibold">City</label>
<input type="text" name="city" class="form-control"
value="@Model.ProspectCity" placeholder="City" />
</div>
<div class="col-md-3">
<label class="form-label fw-semibold">State</label>
<input type="text" name="state" class="form-control"
value="@Model.ProspectState" placeholder="ST" maxlength="2" />
</div>
<div class="col-md-4">
<label class="form-label fw-semibold">Zip Code</label>
<input type="text" name="zipCode" class="form-control"
value="@Model.ProspectZipCode" placeholder="12345" />
</div>
</div>
<hr class="my-4" />
<div class="d-flex gap-3 justify-content-end">
<a href="/quote-approval/@Model.Token" class="btn btn-outline-secondary">
<i class="bi bi-arrow-left me-1"></i>Back to Quote
</a>
<button type="submit" class="btn btn-success px-4">
<i class="bi bi-check-circle me-1"></i>Confirm &amp; Approve Quote
</button>
</div>
</form>
</div>
</div>
@@ -0,0 +1,78 @@
@model PowderCoating.Web.ViewModels.QuoteApprovalViewModel
@{
Layout = "_QuoteApprovalLayout";
var action = (ViewBag.Action as string) ?? "approved";
bool isApproved = action == "approved";
ViewData["Title"] = isApproved ? "Quote Approved" : "Response Received";
ViewBag.CompanyName = Model.CompanyName;
}
<div class="card text-center mb-4">
<div class="card-body py-5">
@if (isApproved)
{
<div class="mb-3">
<i class="bi bi-check-circle-fill text-success" style="font-size:4rem;"></i>
</div>
<h3 class="fw-bold text-success mb-2">Quote Approved!</h3>
<p class="text-muted mb-1">
Thank you, @Model.CustomerName. Your approval of quote <strong>@Model.QuoteNumber</strong> has been received.
</p>
<p class="text-muted">
<strong>@Model.CompanyName</strong> will be in touch shortly to schedule your job.
</p>
}
else
{
<div class="mb-3">
<i class="bi bi-x-circle-fill text-secondary" style="font-size:4rem;"></i>
</div>
<h3 class="fw-bold mb-2">Response Received</h3>
<p class="text-muted mb-1">
Thank you for letting us know, @Model.CustomerName.
</p>
<p class="text-muted">
<strong>@Model.CompanyName</strong> has been notified of your decision regarding quote <strong>@Model.QuoteNumber</strong>.
</p>
}
</div>
</div>
@if (isApproved && Model.RequiresDeposit
&& !string.IsNullOrEmpty(Model.DepositPaymentLinkToken)
&& Model.DepositAmountPaid <= 0)
{
<div class="card border-warning mb-4">
<div class="card-body text-center py-4">
<i class="bi bi-credit-card text-warning" style="font-size:2rem;"></i>
<h5 class="fw-bold mt-2 mb-1">Deposit Required to Begin Work</h5>
<p class="text-muted mb-3">
A deposit of <strong>@Model.DepositAmount.ToString("C")</strong>
(@Model.DepositPercent.ToString("0.##")% of the quote total)
is required before we can schedule your job.
</p>
<a href="/pay/deposit/@Model.DepositPaymentLinkToken" class="btn btn-warning btn-lg px-4">
<i class="bi bi-lock me-2"></i>Pay Deposit Now — @Model.DepositAmount.ToString("C")
</a>
</div>
</div>
}
@if (!string.IsNullOrWhiteSpace(Model.CompanyPhone) || !string.IsNullOrWhiteSpace(Model.CompanyEmail))
{
<div class="text-center text-muted small mb-3">
<p class="mb-1">Have questions? Reach us at:</p>
@if (!string.IsNullOrWhiteSpace(Model.CompanyPhone))
{
<a href="tel:@Model.CompanyPhone" class="text-muted me-3">
<i class="bi bi-telephone me-1"></i>@Model.CompanyPhone
</a>
}
@if (!string.IsNullOrWhiteSpace(Model.CompanyEmail))
{
<a href="mailto:@Model.CompanyEmail" class="text-muted">
<i class="bi bi-envelope me-1"></i>@Model.CompanyEmail
</a>
}
</div>
}
@@ -0,0 +1,20 @@
@{
Layout = "_QuoteApprovalLayout";
ViewData["Title"] = "Invalid Link";
ViewBag.CompanyName = ViewBag.CompanyName ?? "Powder Coating";
}
<div class="card text-center mb-4">
<div class="card-body py-5">
<div class="mb-3">
<i class="bi bi-link-45deg text-danger" style="font-size:4rem;"></i>
</div>
<h3 class="fw-bold mb-2">Invalid or Expired Link</h3>
<p class="text-muted mb-1">
This quote approval link is invalid or may have already been used.
</p>
<p class="text-muted">
Please contact us directly to request a new quote link.
</p>
</div>
</div>
@@ -0,0 +1,39 @@
@model PowderCoating.Web.ViewModels.QuoteApprovalViewModel
@{
Layout = "_QuoteApprovalLayout";
ViewData["Title"] = "Link Expired";
ViewBag.CompanyName = Model.CompanyName;
}
<div class="card text-center mb-4">
<div class="card-body py-5">
<div class="mb-3">
<i class="bi bi-clock-history text-warning" style="font-size:4rem;"></i>
</div>
<h3 class="fw-bold mb-2">Approval Link Expired</h3>
<p class="text-muted mb-1">
This quote approval link for <strong>@Model.QuoteNumber</strong> has expired.
</p>
<p class="text-muted">
Please contact <strong>@Model.CompanyName</strong> to request a new link.
</p>
</div>
</div>
@if (!string.IsNullOrWhiteSpace(Model.CompanyPhone) || !string.IsNullOrWhiteSpace(Model.CompanyEmail))
{
<div class="text-center text-muted small mb-3">
@if (!string.IsNullOrWhiteSpace(Model.CompanyPhone))
{
<a href="tel:@Model.CompanyPhone" class="text-muted me-3">
<i class="bi bi-telephone me-1"></i>@Model.CompanyPhone
</a>
}
@if (!string.IsNullOrWhiteSpace(Model.CompanyEmail))
{
<a href="mailto:@Model.CompanyEmail" class="text-muted">
<i class="bi bi-envelope me-1"></i>@Model.CompanyEmail
</a>
}
</div>
}