@model PowderCoating.Application.DTOs.Accounting.BillDto @using PowderCoating.Core.Enums @{ ViewData["Title"] = $"Bill {Model.BillNumber}"; ViewData["PageIcon"] = "bi-receipt-cutoff"; ViewData["PageHelpTitle"] = "Bill Status"; ViewData["PageHelpContent"] = "Draft: editable, not yet confirmed. Open: awaiting payment. Partially Paid: some payments recorded. Paid: fully settled. Voided: cancelled — preserves history. Edit is only available in Draft status. Use Void instead of deleting to keep a complete audit trail."; string StatusBadge(BillStatus s) => s switch { BillStatus.Draft => "secondary", BillStatus.Open => "primary", BillStatus.PartiallyPaid => "warning", BillStatus.Paid => "success", BillStatus.Voided => "danger", _ => "secondary" }; }
@Model.Status @Model.VendorName
@if (Model.Status == BillStatus.Draft || Model.Status == BillStatus.Open || Model.Status == BillStatus.PartiallyPaid) { Edit } @if (Model.Status == BillStatus.Open || Model.Status == BillStatus.PartiallyPaid) { } @if (Model.Status != BillStatus.Voided && Model.Status != BillStatus.Paid) {
@Html.AntiForgeryToken()
}
@if (TempData["Success"] != null) {
@TempData["Success"]
} @if (TempData["Error"] != null) {
@TempData["Error"]
}

Vendor

@Model.VendorName

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

@Model.VendorEmail

} @if (!string.IsNullOrEmpty(Model.VendorPhone)) {

@Model.VendorPhone

}

Bill Date

@Model.BillDate.ToString("MMM d, yyyy")

@if (Model.DueDate.HasValue) {

Due Date

@Model.DueDate.Value.ToString("MMM d, yyyy")

} @if (!string.IsNullOrEmpty(Model.VendorInvoiceNumber)) {

Vendor Ref #

@Model.VendorInvoiceNumber

} @if (!string.IsNullOrEmpty(Model.Terms)) {

Terms

@Model.Terms

}
@if (!string.IsNullOrEmpty(Model.Memo)) {

Memo

@Model.Memo

}
Line Items
@foreach (var li in Model.LineItems.OrderBy(l => l.DisplayOrder)) { } @if (Model.TaxPercent > 0) { }
Account Description Job Qty Unit Price Amount
@li.AccountNumber @li.AccountName @li.Description @li.JobNumber @li.Quantity.ToString("G") @li.UnitPrice.ToString("C") @li.Amount.ToString("C")
Subtotal @Model.SubTotal.ToString("C")
Tax (@Model.TaxPercent.ToString("G")%) @Model.TaxAmount.ToString("C")
Total @Model.Total.ToString("C")
@if (!string.IsNullOrEmpty(Model.ReceiptFilePath)) {
Receipt / Document
Download Attachment @if (Model.Status == PowderCoating.Core.Enums.BillStatus.Draft) {
@Html.AntiForgeryToken()
}
} @if (Model.Payments.Any()) {
Payment History
@foreach (var pmt in Model.Payments.OrderByDescending(p => p.PaymentDate)) { }
Payment # Date Method Check # Bank Account Memo Amount
@pmt.PaymentNumber @pmt.PaymentDate.ToString("MMM d, yyyy") @pmt.PaymentMethod @pmt.CheckNumber @pmt.BankAccountName @pmt.Memo @pmt.Amount.ToString("C")
@Html.AntiForgeryToken()
}
0 ? "danger" : "secondary")">
Balance Summary
Bill Total @Model.Total.ToString("C")
Amount Paid @Model.AmountPaid.ToString("C")

Balance Due @Model.BalanceDue.ToString("C")
@if (Model.Status == BillStatus.Open || Model.Status == BillStatus.PartiallyPaid) {
}
AP Account

@Model.APAccountName

@if (Model.Status == BillStatus.Open || Model.Status == BillStatus.PartiallyPaid) { } @section Scripts { }