This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-11-12 12:58:59 -07:00
parent a671dc1937
commit e59e33bc3b
2 changed files with 13 additions and 10 deletions

View File

@@ -107,7 +107,7 @@ namespace CarCareTracker.Controllers
}).ToList();
if (invertedFuelMileageUnit)
{
foreach(CostForVehicleByMonth monthMileage in monthlyMileageData)
foreach (CostForVehicleByMonth monthMileage in monthlyMileageData)
{
if (monthMileage.Cost != default)
{
@@ -115,7 +115,7 @@ namespace CarCareTracker.Controllers
}
}
}
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 @@ namespace CarCareTracker.Controllers
}
public IActionResult GetReportParameters()
{
var viewModel = new ReportParameter();
var viewModel = new ReportParameter() {
VisibleColumns = new List<string> {
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<int>() { 0, 1, 3, 4 };
var extraFields = new List<string>();

View File

@@ -2,13 +2,7 @@
{
public class ReportParameter
{
public List<string> VisibleColumns { get; set; } = new List<string>() {
nameof(GenericReportModel.DataType),
nameof(GenericReportModel.Date),
nameof(GenericReportModel.Odometer),
nameof(GenericReportModel.Description),
nameof(GenericReportModel.Cost),
nameof(GenericReportModel.Notes) };
public List<string> VisibleColumns { get; set; } = new List<string>();
public List<string> ExtraFields { get; set; } = new List<string>();
}
}