Clean up reports

This commit is contained in:
2015-10-23 12:39:07 -04:00
parent 7933632cfb
commit ad13d9f5b4
6 changed files with 36 additions and 12 deletions
+2 -2
View File
@@ -67,7 +67,7 @@ namespace MileageTraker.Web.Controllers
return File(export, "application/ms-excel", name + ".xls"); return File(export, "application/ms-excel", name + ".xls");
} }
public ViewResult MonthlyVehicleMileage(LogQueryViewModel query) public ViewResult VehicleMileageReport(LogQueryViewModel query)
{ {
var items = DataService.GetMonthlyVehicleMileageItems(query); var items = DataService.GetMonthlyVehicleMileageItems(query);
@@ -89,7 +89,7 @@ namespace MileageTraker.Web.Controllers
return File(export, "application/ms-excel", name + ".xls"); return File(export, "application/ms-excel", name + ".xls");
} }
public ActionResult MonthlyDriverMileage(LogQueryViewModel query) public ActionResult DriverMileageReport(LogQueryViewModel query)
{ {
var items = DataService.GetMonthlyDriverMileageItems(query); var items = DataService.GetMonthlyDriverMileageItems(query);
items = items.OrderBy(i => i.DriverName); items = items.OrderBy(i => i.DriverName);
+23
View File
@@ -62,5 +62,28 @@ namespace MileageTraker.Web.ViewModels.Log
!string.IsNullOrEmpty(EmployeeName) || !string.IsNullOrEmpty(EmployeeName) ||
!string.IsNullOrEmpty(VehicleId); !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;
}
} }
} }
@@ -46,8 +46,9 @@
@Html.DisplayTextFor(i => vehicleItem.TripCount) @Html.DisplayTextFor(i => vehicleItem.TripCount)
</td> </td>
<td> <td>
@Html.DisplayTextFor(i => vehicleItem.Miles) @Html.DisplayTextFor(i => vehicleItem.Miles)
</td> <small>@Html.ActionLink("Logs", "Index", Model.Query.CloneSet(vehicleItem.VehicleId, item.DriverName), new {@class="no-print"})</small>
</td>
<td> <td>
@Html.DisplayTextFor(i => vehicleItem.GasPurchased) @Html.DisplayTextFor(i => vehicleItem.GasPurchased)
</td> </td>
+2 -2
View File
@@ -42,10 +42,10 @@
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Report <i class="fa fa-caret-down"></i></a> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Report <i class="fa fa-caret-down"></i></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li> <li>
@Html.ActionLink("Vehicle Mileage", "MonthlyVehicleMileage", queryParams) @Html.ActionLink("Vehicle Mileage", "VehicleMileageReport", queryParams)
</li> </li>
<li> <li>
@Html.ActionLink("Driver Mileage", "MonthlyDriverMileage", queryParams) @Html.ActionLink("Driver Mileage", "DriverMileageReport", queryParams)
</li> </li>
</ul> </ul>
</div> </div>
@@ -1,7 +1,6 @@
@model MileageTraker.Web.ViewModels.Vehicle.VehicleMileageViewModel @model MileageTraker.Web.ViewModels.Vehicle.VehicleMileageViewModel
@{ @{
ViewBag.Title = "Vehicle Mileage Report"; 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"); } @{ Html.RenderPartial("BackToLogs"); }
@@ -43,9 +42,10 @@
<td> <td>
@Html.DisplayTextFor(i => item.Prog) @Html.DisplayTextFor(i => item.Prog)
</td> </td>
<td> <td>
@Html.DisplayTextFor(i => item.Miles) @Html.DisplayTextFor(i => item.Miles)
</td> <small>@Html.ActionLink("Logs", "Index", Model.Query.CloneSet(item.VehicleId), new {@class="no-print"})</small>
</td>
<td> <td>
@Html.DisplayTextFor(i => item.GasPurchased) @Html.DisplayTextFor(i => item.GasPurchased)
</td> </td>
+2 -2
View File
@@ -552,7 +552,7 @@
<Content Include="Views\Shared\EditorTemplates\Enum_Select.cshtml" /> <Content Include="Views\Shared\EditorTemplates\Enum_Select.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Views\Log\MonthlyVehicleMileage.cshtml" /> <Content Include="Views\Log\VehicleMileageReport.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Views\Shared\DisplayTemplates\DateTime.cshtml" /> <Content Include="Views\Shared\DisplayTemplates\DateTime.cshtml" />
@@ -564,7 +564,7 @@
<Content Include="Views\Shared\EditorTemplates\LogResultsViewModel.cshtml" /> <Content Include="Views\Shared\EditorTemplates\LogResultsViewModel.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Views\Log\MonthlyDriverMileage.cshtml" /> <Content Include="Views\Log\DriverMileageReport.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Views\Log\LogsSummary.cshtml" /> <Content Include="Views\Log\LogsSummary.cshtml" />