revert and enhance.

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-08-31 09:46:08 -06:00
parent 0be498d9bd
commit b72ab461e5
7 changed files with 156 additions and 87 deletions

View File

@@ -2,24 +2,10 @@
{
public class CostMakeUpForVehicle
{
public string DistanceUnit { get; set; } = "Per Mile";
public int TotalDistance { get; set; }
public decimal ServiceRecordSum { get; set; }
public decimal GasRecordSum { get; set; }
public decimal TaxRecordSum { get; set; }
public decimal CollisionRecordSum { get; set; }
public decimal UpgradeRecordSum { get; set; }
public decimal ServiceRecordPerMile { get { return TotalDistance != default ? ServiceRecordSum / TotalDistance : 0; } }
public decimal GasRecordPerMile { get { return TotalDistance != default ? GasRecordSum / TotalDistance : 0; } }
public decimal CollisionRecordPerMile { get { return TotalDistance != default ? CollisionRecordSum / TotalDistance : 0; } }
public decimal UpgradeRecordPerMile { get { return TotalDistance != default ? UpgradeRecordSum / TotalDistance : 0; } }
public decimal ServiceRecordPerMonth { get { return ServiceRecordSum / 12; } }
public decimal GasRecordPerMonth { get { return GasRecordSum / 12; } }
public decimal CollisionRecordPerMonth { get { return CollisionRecordSum / 12; } }
public decimal UpgradeRecordPerMonth { get { return UpgradeRecordSum / 12; } }
public decimal TaxRecordPerMonth { get { return TaxRecordSum / 12; } }
public decimal TotalPerMonth { get { return ServiceRecordPerMonth + CollisionRecordPerMonth + UpgradeRecordPerMonth + GasRecordPerMonth + TaxRecordPerMonth; } }
public decimal TotalPerMile { get { return ServiceRecordPerMile + CollisionRecordPerMile + UpgradeRecordPerMile + GasRecordPerMile; } }
public decimal TotalCost { get { return ServiceRecordSum + CollisionRecordSum + UpgradeRecordSum + GasRecordSum + TaxRecordSum; } }
}
}

View File

@@ -0,0 +1,26 @@
namespace CarCareTracker.Models
{
public class CostTableForVehicle
{
public string DistanceUnit { get; set; } = "Per Mile";
public int TotalDistance { get; set; }
public int NumberOfMonths { get; set; }
public decimal ServiceRecordSum { get; set; }
public decimal GasRecordSum { get; set; }
public decimal TaxRecordSum { get; set; }
public decimal CollisionRecordSum { get; set; }
public decimal UpgradeRecordSum { get; set; }
public decimal ServiceRecordPerMile { get { return TotalDistance != default ? ServiceRecordSum / TotalDistance : 0; } }
public decimal GasRecordPerMile { get { return TotalDistance != default ? GasRecordSum / TotalDistance : 0; } }
public decimal CollisionRecordPerMile { get { return TotalDistance != default ? CollisionRecordSum / TotalDistance : 0; } }
public decimal UpgradeRecordPerMile { get { return TotalDistance != default ? UpgradeRecordSum / TotalDistance : 0; } }
public decimal ServiceRecordPerMonth { get { return NumberOfMonths != default ? ServiceRecordSum / NumberOfMonths : 0; } }
public decimal GasRecordPerMonth { get { return NumberOfMonths != default ? GasRecordSum / NumberOfMonths : 0; } }
public decimal CollisionRecordPerMonth { get { return NumberOfMonths != default ? CollisionRecordSum / NumberOfMonths : 0; } }
public decimal UpgradeRecordPerMonth { get { return NumberOfMonths != default ? UpgradeRecordSum / NumberOfMonths : 0; } }
public decimal TaxRecordPerMonth { get { return NumberOfMonths != default ? TaxRecordSum / NumberOfMonths : 0; } }
public decimal TotalPerMonth { get { return ServiceRecordPerMonth + CollisionRecordPerMonth + UpgradeRecordPerMonth + GasRecordPerMonth + TaxRecordPerMonth; } }
public decimal TotalPerMile { get { return ServiceRecordPerMile + CollisionRecordPerMile + UpgradeRecordPerMile + GasRecordPerMile; } }
public decimal TotalCost { get { return ServiceRecordSum + CollisionRecordSum + UpgradeRecordSum + GasRecordSum + TaxRecordSum; } }
}
}