@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
@Model.From.ToString("MMMM d, yyyy") – @Model.To.ToString("MMMM d, yyyy")
No invoices found for this period.
| 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 |
| 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 | 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") | ||||