diff --git a/Controllers/Vehicle/NoteController.cs b/Controllers/Vehicle/NoteController.cs index b591295..9e1e5ae 100644 --- a/Controllers/Vehicle/NoteController.cs +++ b/Controllers/Vehicle/NoteController.cs @@ -12,7 +12,7 @@ public partial class VehicleController public IActionResult GetNotesByVehicleId(int vehicleId) { var result = _noteDataAccess.GetNotesByVehicleId(vehicleId); - result = result.OrderByDescending(x => x.Pinned).ToList(); + result = result.OrderByDescending(x => x.Pinned).ThenBy(x => x.Description).ToList(); return PartialView("_Notes", result); } [TypeFilter(typeof(CollaboratorFilter))] diff --git a/Views/Vehicle/_CollisionRecords.cshtml b/Views/Vehicle/_CollisionRecords.cshtml index 8e2d1eb..756e74d 100644 --- a/Views/Vehicle/_CollisionRecords.cshtml +++ b/Views/Vehicle/_CollisionRecords.cshtml @@ -125,7 +125,7 @@ @collisionRecord.Date.ToShortDateString() @(collisionRecord.Mileage == default ? "---" : collisionRecord.Mileage.ToString()) @collisionRecord.Description - @((hideZero && collisionRecord.Cost == default) ? "---" : collisionRecord.Cost.ToString("C")) + @(StaticHelper.HideZeroCost(collisionRecord.Cost, hideZero)) @StaticHelper.TruncateStrings(collisionRecord.Notes) @foreach (string extraFieldColumn in extraFields) { diff --git a/Views/Vehicle/_CostDistanceTableReport.cshtml b/Views/Vehicle/_CostDistanceTableReport.cshtml index ee6460b..22a8e0c 100644 --- a/Views/Vehicle/_CostDistanceTableReport.cshtml +++ b/Views/Vehicle/_CostDistanceTableReport.cshtml @@ -6,7 +6,7 @@ var userConfig = config.GetUserConfig(User); var userLanguage = userConfig.UserLanguage; var hideZero = userConfig.HideZero; - var years = Model.CostData.Select(x => x.Year).Distinct(); + var years = Model.CostData.Select(x => x.Year).OrderByDescending(x => x).Distinct(); var months = Model.CostData.OrderBy(x => x.MonthId).Select(x => x.MonthName).Distinct(); } @if (Model.CostData.Any()) diff --git a/Views/Vehicle/_ServiceRecords.cshtml b/Views/Vehicle/_ServiceRecords.cshtml index 17879d5..484c9fd 100644 --- a/Views/Vehicle/_ServiceRecords.cshtml +++ b/Views/Vehicle/_ServiceRecords.cshtml @@ -125,7 +125,7 @@ @serviceRecord.Date.ToShortDateString() @(serviceRecord.Mileage == default ? "---" : serviceRecord.Mileage.ToString()) @serviceRecord.Description - @((hideZero && serviceRecord.Cost == default) ? "---" : serviceRecord.Cost.ToString("C")) + @(StaticHelper.HideZeroCost(serviceRecord.Cost, hideZero)) @StaticHelper.TruncateStrings(serviceRecord.Notes) @foreach (string extraFieldColumn in extraFields) { diff --git a/Views/Vehicle/_SupplyRecords.cshtml b/Views/Vehicle/_SupplyRecords.cshtml index 5248e14..3ffe75f 100644 --- a/Views/Vehicle/_SupplyRecords.cshtml +++ b/Views/Vehicle/_SupplyRecords.cshtml @@ -141,7 +141,7 @@ @supplyRecord.PartSupplier @supplyRecord.Description @supplyRecord.Quantity - @((hideZero && supplyRecord.Cost == default) ? "---" : supplyRecord.Cost.ToString("C")) + @(StaticHelper.HideZeroCost(supplyRecord.Cost, hideZero)) @StaticHelper.TruncateStrings(supplyRecord.Notes) @foreach (string extraFieldColumn in extraFields) { diff --git a/Views/Vehicle/_TaxRecords.cshtml b/Views/Vehicle/_TaxRecords.cshtml index dbe8ab4..1137fab 100644 --- a/Views/Vehicle/_TaxRecords.cshtml +++ b/Views/Vehicle/_TaxRecords.cshtml @@ -117,7 +117,7 @@ @taxRecord.Date.ToShortDateString() @taxRecord.Description - @((hideZero && taxRecord.Cost == default) ? "---" : taxRecord.Cost.ToString("C")) + @(StaticHelper.HideZeroCost(taxRecord.Cost, hideZero)) @StaticHelper.TruncateStrings(taxRecord.Notes) @foreach (string extraFieldColumn in extraFields) { diff --git a/Views/Vehicle/_UpgradeRecords.cshtml b/Views/Vehicle/_UpgradeRecords.cshtml index 0617807..2624345 100644 --- a/Views/Vehicle/_UpgradeRecords.cshtml +++ b/Views/Vehicle/_UpgradeRecords.cshtml @@ -125,7 +125,7 @@ @upgradeRecord.Date.ToShortDateString() @(upgradeRecord.Mileage == default ? "---" : upgradeRecord.Mileage.ToString()) @upgradeRecord.Description - @((hideZero && upgradeRecord.Cost == default) ? "---" : upgradeRecord.Cost.ToString("C")) + @(StaticHelper.HideZeroCost(upgradeRecord.Cost, hideZero)) @StaticHelper.TruncateStrings(upgradeRecord.Notes) @foreach (string extraFieldColumn in extraFields) { diff --git a/Views/Vehicle/_VehicleHistory.cshtml b/Views/Vehicle/_VehicleHistory.cshtml index 5ac6b2b..8206214 100644 --- a/Views/Vehicle/_VehicleHistory.cshtml +++ b/Views/Vehicle/_VehicleHistory.cshtml @@ -145,7 +145,7 @@ @reportData.Date.ToShortDateString() @(reportData.Odometer == default ? "---" : reportData.Odometer.ToString("N0")) @reportData.Description - @((hideZero && reportData.Cost == default) ? "---" : reportData.Cost.ToString("C")) + @(StaticHelper.HideZeroCost(reportData.Cost, hideZero)) @StaticHelper.TruncateStrings(reportData.Notes, 100) @foreach(string extraField in extraFields) {