e2f9e9ae4f
- Standardize modal dismiss/cancel buttons to btn-outline-secondary across 70+ views - Remove btn-sm from page-level Create and Back buttons (Index + Detail pages) - Fix Edit buttons on Details pages: btn-secondary -> btn-warning - Fix form Cancel/Back links: btn-secondary -> btn-outline-secondary - Add 10 CSS patches to site.css for mobile/tablet responsiveness: top-navbar overflow prevention, page-header flex-wrap at 575px, table action button min-height override, notification dropdown width cap, tablet content padding Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
165 lines
11 KiB
Plaintext
165 lines
11 KiB
Plaintext
@model PowderCoating.Application.DTOs.Job.JobDto
|
|
@{
|
|
var emailDefault = ViewBag.EmailDefaultOnComplete == true;
|
|
var preLoggedPowder = ViewBag.PreLoggedPowder as Dictionary<int, decimal> ?? new Dictionary<int, decimal>();
|
|
// Track remaining credit per InventoryItemId as we allocate it across coat rows
|
|
var remainingCredit = preLoggedPowder.ToDictionary(kv => kv.Key, kv => kv.Value);
|
|
}
|
|
<div class="modal fade" id="completeJobModal" tabindex="-1">
|
|
<div class="modal-dialog modal-dialog-centered modal-lg">
|
|
<div class="modal-content">
|
|
<form asp-action="CompleteJob" method="post">
|
|
@Html.AntiForgeryToken()
|
|
<input type="hidden" name="JobId" value="@Model.Id" />
|
|
<div class="modal-header bg-success bg-opacity-10">
|
|
<h5 class="modal-title">
|
|
<i class="bi bi-check-circle me-2 text-success"></i>Complete Job: @Model.JobNumber
|
|
</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="mb-4">
|
|
<label for="actualTimeSpent" class="form-label fw-semibold">
|
|
<i class="bi bi-clock me-1 text-primary"></i>Actual Time Spent (hours)
|
|
</label>
|
|
<input type="number" class="form-control" id="actualTimeSpent" name="ActualTimeSpentHours"
|
|
step="0.25" min="0" placeholder="Enter total hours spent on this job">
|
|
<div class="form-text">Enter the total time in hours (e.g., 2.5 for 2 hours 30 minutes)</div>
|
|
</div>
|
|
|
|
@if (Model.Items != null && Model.Items.Any())
|
|
{
|
|
<div class="mb-3">
|
|
<h6 class="fw-semibold mb-3">
|
|
<i class="bi bi-palette me-1 text-primary"></i>Actual Powder Usage
|
|
</h6>
|
|
<div class="table-responsive">
|
|
<table class="table table-sm table-hover">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>Item</th>
|
|
<th>Coat</th>
|
|
<th>Color</th>
|
|
<th class="text-end">Estimated (lbs)</th>
|
|
<th>Actual (lbs)</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@{
|
|
var coatIndex = 0;
|
|
}
|
|
@foreach (var item in Model.Items)
|
|
{
|
|
if (item.Coats != null && item.Coats.Any())
|
|
{
|
|
foreach (var coat in item.Coats.OrderBy(c => c.Sequence))
|
|
{
|
|
<tr>
|
|
<td>
|
|
<small>@item.Description</small>
|
|
@if (item.Quantity > 1)
|
|
{
|
|
<span class="badge bg-secondary ms-1">×@item.Quantity</span>
|
|
}
|
|
</td>
|
|
<td><span class="badge bg-secondary">@coat.CoatName</span></td>
|
|
<td>
|
|
@if (!string.IsNullOrEmpty(coat.ColorName))
|
|
{
|
|
<small>
|
|
@coat.ColorName
|
|
@if (!string.IsNullOrEmpty(coat.ColorCode))
|
|
{
|
|
<span class="text-muted">(@coat.ColorCode)</span>
|
|
}
|
|
</small>
|
|
}
|
|
</td>
|
|
<td class="text-end">
|
|
<small class="text-muted">@((coat.PowderToOrder ?? 0).ToString("0.##"))</small>
|
|
</td>
|
|
<td>
|
|
@{
|
|
decimal preFilledLbs = 0m;
|
|
if (coat.InventoryItemId.HasValue && remainingCredit.TryGetValue(coat.InventoryItemId.Value, out var availCredit) && availCredit > 0)
|
|
{
|
|
preFilledLbs = availCredit;
|
|
remainingCredit[coat.InventoryItemId.Value] = 0m;
|
|
}
|
|
}
|
|
<input type="hidden" name="CoatUsages[@coatIndex].JobItemCoatId" value="@coat.Id" />
|
|
<input type="number"
|
|
class="form-control form-control-sm"
|
|
name="CoatUsages[@coatIndex].ActualPowderUsedLbs"
|
|
step="0.01" min="0" placeholder="0.00"
|
|
value="@(preFilledLbs > 0 ? preFilledLbs.ToString("0.##") : "")"
|
|
style="max-width: 120px;">
|
|
@if (preFilledLbs > 0)
|
|
{
|
|
<small class="text-success d-block mt-1">
|
|
<i class="bi bi-check-circle me-1"></i>Already logged — inventory adjusted
|
|
</small>
|
|
}
|
|
</td>
|
|
</tr>
|
|
coatIndex++;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
<tr class="table-secondary">
|
|
<td colspan="5">
|
|
<small class="text-muted fst-italic">
|
|
<i class="bi bi-info-circle me-1"></i>
|
|
@item.Description — No coat information available (legacy job item)
|
|
</small>
|
|
</td>
|
|
</tr>
|
|
}
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="alert alert-info alert-permanent mb-0">
|
|
<i class="bi bi-info-circle me-2"></i>
|
|
<small>Pre-filled values were already logged via scan — inventory is already adjusted for those. You can edit the amount; only the difference will be applied to inventory.</small>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="modal-footer justify-content-between">
|
|
<div class="d-flex align-items-center gap-2 flex-wrap">
|
|
@if (!string.IsNullOrWhiteSpace(Model.CustomerEmail))
|
|
{
|
|
<div class="form-check form-switch mb-0">
|
|
<input class="form-check-input" type="checkbox" role="switch"
|
|
id="completeJobSendEmail" name="SendEmailToCustomer" value="true"
|
|
@(emailDefault ? "checked" : "") />
|
|
<label class="form-check-label small" for="completeJobSendEmail">
|
|
<i class="bi bi-envelope me-1"></i>Notify customer via email
|
|
</label>
|
|
</div>
|
|
}
|
|
@if (Model.CustomerNotifyBySms && !string.IsNullOrWhiteSpace(Model.CustomerMobilePhone))
|
|
{
|
|
<span class="badge bg-info text-white">
|
|
<i class="bi bi-phone me-1"></i>SMS notification will be sent
|
|
</span>
|
|
}
|
|
else if (!string.IsNullOrWhiteSpace(Model.CustomerMobilePhone) && !Model.CustomerNotifyBySms)
|
|
{
|
|
<span class="text-muted small"><i class="bi bi-phone-slash me-1"></i>SMS consent required</span>
|
|
}
|
|
</div>
|
|
<div>
|
|
<button type="button" class="btn btn-outline-secondary me-2" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="submit" class="btn btn-success">
|
|
<i class="bi bi-check-circle me-1"></i>Mark as Completed
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|