@model IEnumerable @using PowderCoating.Core.Enums @{ ViewData["Title"] = "Vendor Credits"; var statusFilter = ViewBag.StatusFilter as string ?? "All"; }

Vendor Credits

New Credit
@if (TempData["Success"] != null) {
@TempData["Success"]
} @if (TempData["Error"] != null) {
@TempData["Error"]
}
@((ViewBag.TotalUnapplied as decimal? ?? 0).ToString("C"))
Total Unapplied Credit
@ViewBag.OpenCount
Open Credits
@ViewBag.PartialCount
Partially Applied
@foreach (var vc in Model) { var (vcBadge, vcLabel) = vc.Status switch { VendorCreditStatus.Open => ("bg-success", "Open"), VendorCreditStatus.PartiallyApplied => ("bg-warning text-dark", "Partial"), VendorCreditStatus.Applied => ("bg-secondary", "Applied"), VendorCreditStatus.Voided => ("bg-danger", "Voided"), _ => ("bg-secondary", vc.Status.ToString()) };
@vc.CreditNumber
@vc.Vendor?.CompanyName
Status @vcLabel
Date @vc.CreditDate.ToString("MM/dd/yy")
Total @vc.Total.ToString("C")
Remaining @(vc.RemainingAmount > 0 ? vc.RemainingAmount.ToString("C") : "—")
@if (!string.IsNullOrWhiteSpace(vc.Memo)) {
Memo @vc.Memo
}
}
@if (!Model.Any()) { } @foreach (var vc in Model) { }
Credit # Date Vendor Memo Total Remaining Status Actions
No vendor credits found.
@vc.CreditNumber @vc.CreditDate.ToString("MMM d, yyyy") @vc.Vendor?.CompanyName @vc.Memo @vc.Total.ToString("C") @if (vc.RemainingAmount > 0) { @vc.RemainingAmount.ToString("C") } else { } @{ var (badgeClass, label) = vc.Status switch { VendorCreditStatus.Open => ("bg-success", "Open"), VendorCreditStatus.PartiallyApplied => ("bg-warning text-dark", "Partial"), VendorCreditStatus.Applied => ("bg-secondary", "Applied"), VendorCreditStatus.Voided => ("bg-danger", "Voided"), _ => ("bg-secondary", vc.Status.ToString()) }; } @label View