Clean up reports
This commit is contained in:
@@ -67,7 +67,7 @@ namespace MileageTraker.Web.Controllers
|
||||
return File(export, "application/ms-excel", name + ".xls");
|
||||
}
|
||||
|
||||
public ViewResult MonthlyVehicleMileage(LogQueryViewModel query)
|
||||
public ViewResult VehicleMileageReport(LogQueryViewModel query)
|
||||
{
|
||||
var items = DataService.GetMonthlyVehicleMileageItems(query);
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace MileageTraker.Web.Controllers
|
||||
return File(export, "application/ms-excel", name + ".xls");
|
||||
}
|
||||
|
||||
public ActionResult MonthlyDriverMileage(LogQueryViewModel query)
|
||||
public ActionResult DriverMileageReport(LogQueryViewModel query)
|
||||
{
|
||||
var items = DataService.GetMonthlyDriverMileageItems(query);
|
||||
items = items.OrderBy(i => i.DriverName);
|
||||
|
||||
@@ -62,5 +62,28 @@ namespace MileageTraker.Web.ViewModels.Log
|
||||
!string.IsNullOrEmpty(EmployeeName) ||
|
||||
!string.IsNullOrEmpty(VehicleId);
|
||||
}
|
||||
|
||||
public LogQueryViewModel Clone()
|
||||
{
|
||||
return new LogQueryViewModel
|
||||
{
|
||||
EmployeeName = EmployeeName,
|
||||
LogType = LogType,
|
||||
Month = Month,
|
||||
MonthRange = MonthRange,
|
||||
VehicleId = VehicleId,
|
||||
Year = Year
|
||||
};
|
||||
}
|
||||
|
||||
public LogQueryViewModel CloneSet(string vehicleId = null, string employeeName = null)
|
||||
{
|
||||
var clone = Clone();
|
||||
if (vehicleId != null)
|
||||
clone.VehicleId = vehicleId;
|
||||
if (employeeName != null)
|
||||
clone.EmployeeName = employeeName;
|
||||
return clone;
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -46,8 +46,9 @@
|
||||
@Html.DisplayTextFor(i => vehicleItem.TripCount)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(i => vehicleItem.Miles)
|
||||
</td>
|
||||
@Html.DisplayTextFor(i => vehicleItem.Miles)
|
||||
<small>@Html.ActionLink("Logs", "Index", Model.Query.CloneSet(vehicleItem.VehicleId, item.DriverName), new {@class="no-print"})</small>
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(i => vehicleItem.GasPurchased)
|
||||
</td>
|
||||
@@ -42,10 +42,10 @@
|
||||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Report <i class="fa fa-caret-down"></i></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
@Html.ActionLink("Vehicle Mileage", "MonthlyVehicleMileage", queryParams)
|
||||
@Html.ActionLink("Vehicle Mileage", "VehicleMileageReport", queryParams)
|
||||
</li>
|
||||
<li>
|
||||
@Html.ActionLink("Driver Mileage", "MonthlyDriverMileage", queryParams)
|
||||
@Html.ActionLink("Driver Mileage", "DriverMileageReport", queryParams)
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
+4
-4
@@ -1,7 +1,6 @@
|
||||
@model MileageTraker.Web.ViewModels.Vehicle.VehicleMileageViewModel
|
||||
@{
|
||||
ViewBag.Title = "Vehicle Mileage Report";
|
||||
var queryParams = new { Model.Query.Year, Model.Query.Month, Model.Query.LogType, Model.Query.MonthRange, Model.Query.VehicleId, Model.Query.EmployeeName };
|
||||
}
|
||||
|
||||
@{ Html.RenderPartial("BackToLogs"); }
|
||||
@@ -43,9 +42,10 @@
|
||||
<td>
|
||||
@Html.DisplayTextFor(i => item.Prog)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(i => item.Miles)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(i => item.Miles)
|
||||
<small>@Html.ActionLink("Logs", "Index", Model.Query.CloneSet(item.VehicleId), new {@class="no-print"})</small>
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(i => item.GasPurchased)
|
||||
</td>
|
||||
+2
-2
@@ -552,7 +552,7 @@
|
||||
<Content Include="Views\Shared\EditorTemplates\Enum_Select.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Log\MonthlyVehicleMileage.cshtml" />
|
||||
<Content Include="Views\Log\VehicleMileageReport.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Shared\DisplayTemplates\DateTime.cshtml" />
|
||||
@@ -564,7 +564,7 @@
|
||||
<Content Include="Views\Shared\EditorTemplates\LogResultsViewModel.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Log\MonthlyDriverMileage.cshtml" />
|
||||
<Content Include="Views\Log\DriverMileageReport.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Log\LogsSummary.cshtml" />
|
||||
|
||||
Reference in New Issue
Block a user