@model PagedResult @{ ViewData["Title"] = "Jobs"; ViewData["PageIcon"] = "bi-briefcase"; ViewData["PageHelpTitle"] = "Jobs"; ViewData["PageHelpContent"] = "A Job is the active work order once a customer's quote is approved. Jobs track the full lifecycle from intake through coating, curing, quality check, and delivery. Each job can contain multiple items with individual coating specifications. Priority and due date help the shop floor triage workload."; } @{ var _allCount = (int)(ViewBag.AllJobCount ?? 0); var _wip = (int)(ViewBag.ActiveCount ?? 0); var _done = (int)(ViewBag.CompletedCount ?? 0); var _ready = (int)(ViewBag.ReadyCount ?? 0); var _overdue = (int)(ViewBag.OverdueCount ?? 0); var _value = Model.Items.Sum(j => j.FinalPrice); }
@await Html.PartialAsync("_Metric", (Label: "TOTAL", Value: Model.TotalCount.ToString(), Delta: (string?)null, DeltaDir: (string?)null))
@await Html.PartialAsync("_Metric", (Label: "IN PROGRESS", Value: _wip.ToString(), Delta: (string?)null, DeltaDir: (string?)null))
@await Html.PartialAsync("_Metric", (Label: "COMPLETED", Value: _done.ToString(), Delta: (string?)null, DeltaDir: (string?)null))
@await Html.PartialAsync("_Metric", (Label: "OVERDUE", Value: _overdue.ToString(), Delta: (string?)null, DeltaDir: (string?)null))
@await Html.PartialAsync("_Metric", (Label: "VALUE", Value: _value.ToString("C0"), Delta: (string?)null, DeltaDir: (string?)null))
@if (!string.IsNullOrEmpty(ViewBag.SearchTerm as string)) {
Showing @Model.TotalCount job(s) matching "@ViewBag.SearchTerm" (searches job number, description, customer, PO, instructions, status, priority)
Clear Filter
} @if (!string.IsNullOrEmpty(ViewBag.StatusGroup as string) && ViewBag.StatusGroup != "active" && ViewBag.StatusGroup != "all") { var groupLabel = ViewBag.StatusGroup == "overdue" ? "Overdue Jobs (past due date)" : ViewBag.StatusGroup == "completed" ? "Completed Jobs (completed, ready for pickup & delivered)" : (string)ViewBag.StatusGroup;
Showing: @groupLabel — @Model.TotalCount result@(Model.TotalCount == 1 ? "" : "s")
Back to On Floor
} @{ var _activeGroup = ViewBag.StatusGroup as string; var _activeSearch = ViewBag.SearchTerm as string; // "all" is the explicit show-everything group (bare URL now redirects to "active") var _noFilter = _activeGroup == "all" && string.IsNullOrEmpty(_activeSearch) && string.IsNullOrEmpty(ViewBag.TagFilter as string); }
@if (!string.IsNullOrEmpty(_activeSearch) || !string.IsNullOrEmpty(ViewBag.TagFilter as string)) { }
@if (!Model.Items.Any()) {
No jobs found

Get started by creating your first job

Create Your First Job
} else {
@foreach (var job in Model.Items) { var isHot = job.DueDate.HasValue && job.DueDate.Value < DateTime.Now && job.StatusCode != "COMPLETED" && job.StatusCode != "READYFORPICKUP" && job.StatusCode != "DELIVERED" && job.StatusCode != "CANCELLED"; }
Job Customer Status Priority Worker Scheduled Due Price Actions
@job.JobNumber @if (job.IsReworkJob) { @await Html.PartialAsync("_StatusChip", (Kind: "warn", Text: "Rework")) }
@job.CreatedAt.ToString("MMM dd, yyyy") @if (!string.IsNullOrWhiteSpace(job.Tags)) {
@foreach (var tag in job.Tags.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(t => t.Trim()).Where(t => !string.IsNullOrWhiteSpace(t))) { @tag }
}
@job.CustomerName @job.StatusDisplayName @job.PriorityDisplayName @if (!string.IsNullOrEmpty(job.AssignedWorkerName)) { @job.AssignedWorkerName } else { Unassigned } @if (job.ScheduledDate.HasValue) { @job.ScheduledDate.Value.ToString("MMM dd, yyyy") } else { Not scheduled } @if (job.DueDate.HasValue) { var isOverdue = job.DueDate.Value < DateTime.Now && job.StatusCode != "COMPLETED" && job.StatusCode != "READYFORPICKUP" && job.StatusCode != "DELIVERED"; @job.DueDate.Value.ToString("MMM dd, yyyy") @if (isOverdue) { } } else { Not set } @job.FinalPrice.ToString("C")
@if (!Model.Items.Any()) {
No jobs found

Get started by creating your first job

Create Your First Job
} else {
@foreach (var job in Model.Items) {
@job.JobNumber
@job.CustomerName
Status @await Html.PartialAsync("_StatusChip", (Kind: StatusChipHelper.JobStatus(job.StatusCode), Text: job.StatusDisplayName))
Priority @await Html.PartialAsync("_StatusChip", (Kind: StatusChipHelper.JobPriority(job.PriorityCode), Text: job.PriorityDisplayName))
@if (!string.IsNullOrEmpty(job.AssignedWorkerName)) {
Worker @job.AssignedWorkerName
} @if (job.ScheduledDate.HasValue) {
Scheduled @job.ScheduledDate.Value.ToString("MMM dd, yyyy")
} @if (job.DueDate.HasValue) { var isOverdue = job.DueDate.Value < DateTime.Now && job.StatusCode != "COMPLETED" && job.StatusCode != "READYFORPICKUP" && job.StatusCode != "DELIVERED";
Due Date @job.DueDate.Value.ToString("MMM dd, yyyy") @if (isOverdue) { }
}
Price @job.FinalPrice.ToString("C")
}
}
}
@if (Model.TotalCount > 0) { @await Html.PartialAsync("_Pagination", Model) } @if (Model.Items.Any()) { }
@Html.AntiForgeryToken() @section Scripts { }