diff --git a/Controllers/Vehicle/ReportController.cs b/Controllers/Vehicle/ReportController.cs index 1fe6146e..7bfe25ea 100644 --- a/Controllers/Vehicle/ReportController.cs +++ b/Controllers/Vehicle/ReportController.cs @@ -107,7 +107,7 @@ public IActionResult GetReportPartialView(int vehicleId) }).ToList(); if (invertedFuelMileageUnit) { - foreach(CostForVehicleByMonth monthMileage in monthlyMileageData) + foreach (CostForVehicleByMonth monthMileage in monthlyMileageData) { if (monthMileage.Cost != default) { @@ -115,7 +115,7 @@ public IActionResult GetReportPartialView(int vehicleId) } } } - var mpgViewModel = new MPGForVehicleByMonth { + var mpgViewModel = new MPGForVehicleByMonth { CostData = monthlyMileageData, Unit = invertedFuelMileageUnit ? preferredFuelMileageUnit : fuelEconomyMileageUnit, SortedCostData = (userConfig.UseMPG || invertedFuelMileageUnit) ? monthlyMileageData.OrderByDescending(x => x.Cost).ToList() : monthlyMileageData.OrderBy(x => x.Cost).ToList() @@ -322,7 +322,16 @@ public IActionResult GetVehicleAttachments(int vehicleId, List expor } public IActionResult GetReportParameters() { - var viewModel = new ReportParameter(); + var viewModel = new ReportParameter() { + VisibleColumns = new List { + nameof(GenericReportModel.DataType), + nameof(GenericReportModel.Date), + nameof(GenericReportModel.Odometer), + nameof(GenericReportModel.Description), + nameof(GenericReportModel.Cost), + nameof(GenericReportModel.Notes) + } + }; //get all extra fields from service records, repairs, upgrades, and tax records. var recordTypes = new List() { 0, 1, 3, 4 }; var extraFields = new List(); diff --git a/Models/Report/ReportParameter.cs b/Models/Report/ReportParameter.cs index 513cb994..c7c2b4a6 100644 --- a/Models/Report/ReportParameter.cs +++ b/Models/Report/ReportParameter.cs @@ -2,13 +2,7 @@ { public class ReportParameter { - public List VisibleColumns { get; set; } = new List() { - nameof(GenericReportModel.DataType), - nameof(GenericReportModel.Date), - nameof(GenericReportModel.Odometer), - nameof(GenericReportModel.Description), - nameof(GenericReportModel.Cost), - nameof(GenericReportModel.Notes) }; + public List VisibleColumns { get; set; } = new List(); public List ExtraFields { get; set; } = new List(); } }