@model PowderCoating.Application.DTOs.Customer.CustomerDto @{ ViewData["Title"] = !string.IsNullOrWhiteSpace(Model.CompanyName) ? Model.CompanyName : $"{Model.ContactFirstName} {Model.ContactLastName}".Trim(); ViewData["PageIcon"] = "bi-person-circle"; }
Status: @(Model.IsActive ? "Active Customer" : "Inactive Customer") @if (!Model.IsActive) { - This customer is currently inactive }
Company Information

@Model.CompanyName

@if (Model.IsCommercial) { Commercial } else { Individual }

Contact Information

@if (!string.IsNullOrEmpty(Model.ContactFirstName) || !string.IsNullOrEmpty(Model.ContactLastName)) { @Model.ContactFirstName @Model.ContactLastName } else { Not provided }

@if (!string.IsNullOrEmpty(Model.Email)) { @Model.Email } else { Not provided }

@if (Model.IsCommercial) {

@if (!string.IsNullOrEmpty(Model.BillingEmail)) { @Model.BillingEmail Invoices } else { Not set — invoices go to contact email }

}

@if (!string.IsNullOrEmpty(Model.Phone)) { @Model.Phone } else { Not provided }

@if (!string.IsNullOrEmpty(Model.MobilePhone)) { @Model.MobilePhone } else { Not provided }

@if (Model.NotifyByEmail) { Email on } else { Email off } @if (Model.NotifyBySms) { SMS on } else { SMS off }
Address
@if (!string.IsNullOrEmpty(Model.Address)) {

@Model.Address

@if (!string.IsNullOrEmpty(Model.City)) { @Model.City } @if (!string.IsNullOrEmpty(Model.State)) { , @Model.State } @if (!string.IsNullOrEmpty(Model.ZipCode)) { @Model.ZipCode }

@if (!string.IsNullOrEmpty(Model.Country)) {

@Model.Country

} } else {

No address provided

}
Business Information

@(Model.TaxId ?? "Not provided")

@(Model.PaymentTerms ?? "Not set")

@Model.CreditLimit.ToString("C")

@(Model.PricingTierName ?? "Standard")

@if (Model.IsTaxExempt) { Tax Exempt } else { Taxable }

@if (Model.HasTaxExemptCertificate) {
File on record: @Model.TaxExemptCertificateFileName
Download
} @if (Model.IsTaxExempt && !Model.HasTaxExemptCertificate) {
No certificate on file. Please upload a tax exempt certificate to complete the record.
}
@if (!string.IsNullOrEmpty(Model.GeneralNotes)) {
Notes

@Model.GeneralNotes

} @{ var customerNotes = ViewBag.CustomerNotes as List; }
Internal Notes
@if (customerNotes != null && customerNotes.Count > 0) { @foreach (var note in customerNotes) {
@if (note.IsImportant) { } @note.Note
@(note.CreatedBy ?? "Staff") — @note.CreatedAt.Tz(ViewBag.CompanyTimeZone as string).ToString("MMM dd, yyyy h:mm tt")
} } else {
No notes yet.
}
@{ var timeline = ViewBag.Timeline as List; } @if (timeline != null && timeline.Count > 0) {
Recent Activity
View All
@foreach (var ev in timeline) { var hasLink = ev.LinkController != null && ev.EntityId.HasValue; var rowTag = hasLink ? "a" : "div"; var href = hasLink ? Url.Action(ev.LinkAction, ev.LinkController, new { id = ev.EntityId }) : null; }
}
Financial Summary

@Model.CurrentBalance.ToString("C")

@if (Model.CreditLimit > 0) {

@Model.CreditLimit.ToString("C")

@((Model.CreditLimit - Model.CurrentBalance).ToString("C"))

}

@Model.CreditBalance.ToString("C")

Available for future invoices
@if (User.IsInRole("SuperAdmin") || User.IsInRole("Administrator")) { }
@{ var pendingPickups = ViewBag.PendingPickups as List; } @if (pendingPickups != null && pendingPickups.Count > 0) {
Ready for Pickup @pendingPickups.Count
@foreach (var pickup in pendingPickups) { var daysWaiting = (int)(DateTime.UtcNow - (pickup.UpdatedAt ?? pickup.CreatedAt)).TotalDays;
@pickup.JobNumber @if (!string.IsNullOrEmpty(pickup.Description)) {
@pickup.Description
}
= 3 ? "bg-warning text-dark" : "bg-success")"> @(daysWaiting == 0 ? "Today" : $"{daysWaiting}d waiting")
}
} @{ var creditMemos = ViewBag.CreditMemos as List; } @if (creditMemos != null && creditMemos.Count > 0) {
Store Credit History
@foreach (var memo in creditMemos) { }
Memo # Issued Amount Remaining
@memo.MemoNumber
@memo.Reason
@memo.IssueDate.Tz(ViewBag.CompanyTimeZone as string).ToString("MM/dd/yy") @memo.Amount.ToString("C") @if (memo.RemainingBalance > 0) { @memo.RemainingBalance.ToString("C") } else { Used }
} @{ var crmStats = ViewBag.CrmStats as PowderCoating.Application.DTOs.Customer.CustomerLifetimeStatsDto; } @if (crmStats != null) {
Customer Stats
Total Jobs
@crmStats.TotalJobs
@if (crmStats.ActiveJobs > 0) { @crmStats.ActiveJobs active }
Avg Job Value
@crmStats.AverageJobValue.ToString("C0")

Lifetime Revenue
@crmStats.TotalRevenue.ToString("C")
Total Collected
@crmStats.TotalCollected.ToString("C")

@if (crmStats.DaysSinceLastJob.HasValue) { @if (crmStats.DaysSinceLastJob == 0) { Last job today } else { Last job @crmStats.DaysSinceLastJob days ago } } else { No jobs yet } @crmStats.TotalQuotes quote@(crmStats.TotalQuotes == 1 ? "" : "s")
Customer since @Model.CreatedAt.ToString("MMM yyyy")
} @{ var preferredPowders = ViewBag.PreferredPowders as List; }
Preferred Powders
@if (preferredPowders != null && preferredPowders.Count > 0) { @foreach (var p in preferredPowders) {
@p.InventoryItem.Name @if (!string.IsNullOrEmpty(p.InventoryItem.ColorName)) { — @p.InventoryItem.ColorName } @if (!string.IsNullOrEmpty(p.Notes)) {
@p.Notes
}
} } else {
No preferred powders yet.
}
Quick Actions
Edit Customer Job History View Invoices Statement New Job @{ var crmStatsForActions = ViewBag.CrmStats as PowderCoating.Application.DTOs.Customer.CustomerLifetimeStatsDto; } @if (crmStatsForActions?.LastJobId != null) { Repeat Last Job } New Quote @if (User.IsInRole("SuperAdmin") || User.IsInRole("Administrator")) { } Delete Customer
@if (User.IsInRole("SuperAdmin") || User.IsInRole("Administrator")) { } @section Scripts { }