@model PowderCoating.Application.DTOs.Accounting.SalesIncomeReportDto @{ ViewData["Title"] = "Sales & Income"; ViewData["PageIcon"] = "bi-currency-dollar"; var today = DateTime.Today; var ytdFrom = new DateTime(today.Year, 1, 1).ToString("yyyy-MM-dd"); var ytdTo = today.ToString("yyyy-MM-dd"); var lastYrFrom = new DateTime(today.Year - 1, 1, 1).ToString("yyyy-MM-dd"); var lastYrTo = new DateTime(today.Year - 1, 12, 31).ToString("yyyy-MM-dd"); var thisMonthFrom = new DateTime(today.Year, today.Month, 1).ToString("yyyy-MM-dd"); var thisMonthTo = today.ToString("yyyy-MM-dd"); var lastMonthFrom = new DateTime(today.Year, today.Month, 1).AddMonths(-1).ToString("yyyy-MM-dd"); var lastMonthTo = new DateTime(today.Year, today.Month, 1).AddDays(-1).ToString("yyyy-MM-dd"); var monthLabels = Model.ByMonth.Select(m => m.Label).ToList(); var monthInvoiced = Model.ByMonth.Select(m => m.TotalInvoiced).ToList(); var monthCollected = Model.ByMonth.Select(m => m.TotalCollected).ToList(); }

@Model.From.ToString("MMM d") – @Model.To.ToString("MMM d, yyyy") · @Model.InvoiceCount invoices · @Model.CustomerCount customers

Download PDF Print

@Model.CompanyName

Sales & Income Report

@Model.From.ToString("MMMM d, yyyy") – @Model.To.ToString("MMMM d, yyyy")

@Model.TotalInvoiced.ToString("C")
Total Invoiced
@Model.TotalCollected.ToString("C")
Collected (period)
@Model.AverageInvoiceValue.ToString("C")
Avg Invoice Value
@Model.CustomerCount
Active Customers
@if (!Model.Invoices.Any()) {

No invoices found for this period.

} else {
@if (Model.ByMonth.Count > 1) {
Monthly Sales Trend
}
By Month
@foreach (var m in Model.ByMonth) { }
Month Invoiced Collected #
@m.Label @m.TotalInvoiced.ToString("C") @m.TotalCollected.ToString("C") @m.InvoiceCount
Total @Model.TotalInvoiced.ToString("C") @Model.TotalCollected.ToString("C") @Model.InvoiceCount
Sales by Customer
@foreach (var c in Model.ByCustomer) { }
Customer Invoices Total Invoiced Paid Balance Due % of Sales
@c.CustomerName @c.InvoiceCount @c.TotalInvoiced.ToString("C") @c.TotalPaid.ToString("C") @c.BalanceDue.ToString("C") @(Model.TotalInvoiced == 0 ? "—" : (c.TotalInvoiced / Model.TotalInvoiced * 100).ToString("F1") + "%")
Total (@Model.CustomerCount customers) @Model.InvoiceCount @Model.TotalInvoiced.ToString("C") @Model.TotalCollected.ToString("C") @Model.Invoices.Sum(i => i.BalanceDue).ToString("C")
Invoice Detail @Model.InvoiceCount invoices
@foreach (var inv in Model.Invoices) { string statusBadge = inv.Status switch { "Paid" => "bg-success-subtle text-success", "PartiallyPaid" => "bg-warning-subtle text-warning", "Sent" => "bg-info-subtle text-info", "Overdue" => "bg-danger-subtle text-danger", _ => "bg-secondary-subtle text-secondary" }; }
Invoice Customer Date Due Subtotal Tax Total Paid Status
@inv.InvoiceNumber @inv.CustomerName @inv.InvoiceDate.ToString("MM/dd/yyyy") @(inv.DueDate?.ToString("MM/dd/yyyy") ?? "—") @inv.SubTotal.ToString("C") @(inv.TaxAmount > 0 ? inv.TaxAmount.ToString("C") : "—") @inv.Total.ToString("C") @inv.AmountPaid.ToString("C") @inv.Status
Totals @Model.Invoices.Sum(i => i.SubTotal).ToString("C") @Model.TotalTax.ToString("C") @Model.TotalInvoiced.ToString("C") @Model.Invoices.Sum(i => i.AmountPaid).ToString("C")
}
Generated @DateTime.Now.ToString("MMM d, yyyy h:mm tt") · Excludes Draft and Voided invoices. "Collected" reflects payments received within the period, regardless of invoice date.
@if (Model.ByMonth.Count > 1) { @section Scripts { } }