mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 00:46:08 -06:00
Merge pull request #858 from hargata/Hargata/857
Add flag to print individual records
This commit is contained in:
commit
efa2bbf6cc
@ -473,7 +473,8 @@ namespace CarCareTracker.Controllers
|
||||
Notes = x.Notes,
|
||||
Cost = x.Cost,
|
||||
DataType = ImportMode.ServiceRecord,
|
||||
ExtraFields = x.ExtraFields
|
||||
ExtraFields = x.ExtraFields,
|
||||
RequisitionHistory = x.RequisitionHistory
|
||||
}));
|
||||
//repair records
|
||||
reportData.AddRange(vehicleRecords.CollisionRecords.Select(x => new GenericReportModel
|
||||
@ -484,7 +485,8 @@ namespace CarCareTracker.Controllers
|
||||
Notes = x.Notes,
|
||||
Cost = x.Cost,
|
||||
DataType = ImportMode.RepairRecord,
|
||||
ExtraFields = x.ExtraFields
|
||||
ExtraFields = x.ExtraFields,
|
||||
RequisitionHistory = x.RequisitionHistory
|
||||
}));
|
||||
reportData.AddRange(vehicleRecords.UpgradeRecords.Select(x => new GenericReportModel
|
||||
{
|
||||
@ -494,7 +496,8 @@ namespace CarCareTracker.Controllers
|
||||
Notes = x.Notes,
|
||||
Cost = x.Cost,
|
||||
DataType = ImportMode.UpgradeRecord,
|
||||
ExtraFields = x.ExtraFields
|
||||
ExtraFields = x.ExtraFields,
|
||||
RequisitionHistory = x.RequisitionHistory
|
||||
}));
|
||||
reportData.AddRange(vehicleRecords.TaxRecords.Select(x => new GenericReportModel
|
||||
{
|
||||
|
||||
@ -13,5 +13,6 @@
|
||||
public decimal Cost { get; set; }
|
||||
public List<UploadedFiles> Files { get; set; } = new List<UploadedFiles>();
|
||||
public List<ExtraField> ExtraFields { get; set; } = new List<ExtraField>();
|
||||
public List<SupplyUsageHistory> RequisitionHistory { get; set; } = new List<SupplyUsageHistory>();
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,5 +9,6 @@
|
||||
public bool FilterByDateRange { get; set; } = false;
|
||||
public string StartDate { get; set; } = "";
|
||||
public string EndDate { get; set; } = "";
|
||||
public bool PrintIndividualRecords { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,14 @@
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mt-2 mb-2">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item text-start">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="printIndividualRecordsCheck">
|
||||
<label class="form-check-label" for="printIndividualRecordsCheck">@translator.Translate(userLanguage, "Print Individual Records")</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mt-2 mb-2">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item text-center" style="cursor:pointer;" onclick="showReportAdvancedParameters()">
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
var userLanguage = userConfig.UserLanguage;
|
||||
var extraFields = Model.ReportParameters.ExtraFields;
|
||||
}
|
||||
<div>
|
||||
<div style="page-break-after: always;">
|
||||
<div class="row mt-2">
|
||||
<div class="d-flex">
|
||||
<img src="@config.GetLogoUrl()" class="lubelogger-logo" />
|
||||
@ -18,13 +18,12 @@
|
||||
</span>
|
||||
@if (!string.IsNullOrWhiteSpace(Model.StartDate) && !string.IsNullOrWhiteSpace(Model.EndDate))
|
||||
{
|
||||
<br />
|
||||
<span class="lead ms-2">
|
||||
@($"{@translator.Translate(userLanguage, "From")} {Model.StartDate} {@translator.Translate(userLanguage, "To")} {Model.EndDate}")
|
||||
</span>
|
||||
<br />
|
||||
<span class="lead ms-2">
|
||||
@($"{@translator.Translate(userLanguage, "From")} {Model.StartDate} {@translator.Translate(userLanguage, "To")} {Model.EndDate}")
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
@ -93,26 +92,26 @@
|
||||
<hr />
|
||||
@if (Model.TotalDepreciation != default)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
@(Model.TotalDepreciation > 0 ? translator.Translate(userLanguage, "Depreciation") : translator.Translate(userLanguage, "Appreciation"))
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<span><i class="bi @(Model.TotalDepreciation > 0 ? "bi-graph-down-arrow" : "bi-graph-up-arrow") me-2"></i>@Math.Abs(Model.TotalDepreciation).ToString("C")</span>
|
||||
</div>
|
||||
@if (Model.DepreciationPerDay != default)
|
||||
{
|
||||
<div class="col-3">
|
||||
<span><i class="bi bi-calendar-event me-2"></i>@($"{Model.DepreciationPerDay.ToString("C")}/{translator.Translate(userLanguage, "day")}")</span>
|
||||
</div>
|
||||
}
|
||||
@if (Model.DepreciationPerMile != default)
|
||||
{
|
||||
<div class="col-3">
|
||||
<span><i class="bi bi-speedometer me-2"></i>@($"{Model.DepreciationPerMile.ToString("C")}/{Model.DistanceUnit}")</span>
|
||||
</div>
|
||||
}
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
@(Model.TotalDepreciation > 0 ? translator.Translate(userLanguage, "Depreciation") : translator.Translate(userLanguage, "Appreciation"))
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<span><i class="bi @(Model.TotalDepreciation > 0 ? "bi-graph-down-arrow" : "bi-graph-up-arrow") me-2"></i>@Math.Abs(Model.TotalDepreciation).ToString("C")</span>
|
||||
</div>
|
||||
@if (Model.DepreciationPerDay != default)
|
||||
{
|
||||
<div class="col-3">
|
||||
<span><i class="bi bi-calendar-event me-2"></i>@($"{Model.DepreciationPerDay.ToString("C")}/{translator.Translate(userLanguage, "day")}")</span>
|
||||
</div>
|
||||
}
|
||||
@if (Model.DepreciationPerMile != default)
|
||||
{
|
||||
<div class="col-3">
|
||||
<span><i class="bi bi-speedometer me-2"></i>@($"{Model.DepreciationPerMile.ToString("C")}/{Model.DistanceUnit}")</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<hr />
|
||||
}
|
||||
<div class="row">
|
||||
@ -177,3 +176,113 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (Model.ReportParameters.PrintIndividualRecords){
|
||||
@foreach (GenericReportModel genericRecord in Model.VehicleHistory)
|
||||
{
|
||||
<div class="d-flex flex-column recordSticker">
|
||||
<div class="d-flex">
|
||||
<img src="@config.GetLogoUrl()" class="lubelogger-logo" />
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<span class="display-6">@($"{Model.VehicleData.Year} {Model.VehicleData.Make} {Model.VehicleData.Model}")</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<span class="lead">@($"{StaticHelper.GetVehicleIdentifier(Model.VehicleData)}")</span>
|
||||
</li>
|
||||
@foreach (ExtraField extraField in Model.VehicleData.ExtraFields)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(extraField.Value))
|
||||
{
|
||||
<li class="list-group-item">
|
||||
<span class="lead">@($"{extraField.Name}: {extraField.Value}")</span>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<ul class="list-group">
|
||||
@if (!string.IsNullOrWhiteSpace(genericRecord.Description))
|
||||
{
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Description")}: {genericRecord.Description}")
|
||||
</li>
|
||||
}
|
||||
@switch (genericRecord.DataType)
|
||||
{
|
||||
case ImportMode.ServiceRecord:
|
||||
case ImportMode.RepairRecord:
|
||||
case ImportMode.UpgradeRecord:
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Date")}: {genericRecord.Date.ToShortDateString()}")
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Odometer")}: {genericRecord.Odometer}")
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Cost")}: {genericRecord.Cost.ToString("C")}")
|
||||
</li>
|
||||
break;
|
||||
case ImportMode.TaxRecord:
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Date")}: {genericRecord.Date.ToShortDateString()}")
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Cost")}: {genericRecord.Cost.ToString("C")}")
|
||||
</li>
|
||||
break;
|
||||
}
|
||||
@foreach (ExtraField extraField in genericRecord.ExtraFields)
|
||||
{
|
||||
<li class="list-group-item">
|
||||
@($"{extraField.Name}: {extraField.Value}")
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
@if (genericRecord.RequisitionHistory.Any())
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table table-hover">
|
||||
<thead class="sticky-top">
|
||||
<tr class="d-flex">
|
||||
<th scope="col" class="col-2">@translator.Translate(userLanguage, "Part Number")</th>
|
||||
<th scope="col" class="col-6">@translator.Translate(userLanguage, "Description")</th>
|
||||
<th scope="col" class="col-2">@translator.Translate(userLanguage, "Quantity")</th>
|
||||
<th scope="col" class="col-2">@translator.Translate(userLanguage, "Cost")</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (SupplyUsageHistory usageHistory in genericRecord.RequisitionHistory)
|
||||
{
|
||||
<tr class="d-flex">
|
||||
<td class="col-2 text-truncate">@usageHistory.PartNumber</td>
|
||||
<td class="col-6 text-truncate">@usageHistory.Description</td>
|
||||
<td class="col-2">@usageHistory.Quantity.ToString("F")</td>
|
||||
<td class="col-2">@usageHistory.Cost.ToString("C2")</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
}
|
||||
<div class="row flex-grow-1 flex-shrink-1">
|
||||
<div class="col-12">
|
||||
<div class="stickerNote ms-1 me-1 p-1">
|
||||
@(genericRecord.Notes)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<script>setMarkDownStickerNotes()</script>
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -7,6 +7,7 @@ function getAndValidateSelectedColumns() {
|
||||
var tagFilterMode = $("#tagSelector").val();
|
||||
var tagsToFilter = $("#tagSelectorInput").val();
|
||||
var filterByDateRange = $("#dateRangeSelector").is(":checked");
|
||||
var printIndividualRecords = $("#printIndividualRecordsCheck").is(":checked");
|
||||
var startDate = $("#dateRangeStartDate").val();
|
||||
var endDate = $("#dateRangeEndDate").val();
|
||||
$("#columnSelector :checked").map(function () {
|
||||
@ -42,7 +43,8 @@ function getAndValidateSelectedColumns() {
|
||||
tags: [],
|
||||
filterByDateRange: filterByDateRange,
|
||||
startDate: '',
|
||||
endDate: ''
|
||||
endDate: '',
|
||||
printIndividualRecords: printIndividualRecords
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
@ -54,7 +56,8 @@ function getAndValidateSelectedColumns() {
|
||||
tags: tagsToFilter,
|
||||
filterByDateRange: filterByDateRange,
|
||||
startDate: startDate,
|
||||
endDate: endDate
|
||||
endDate: endDate,
|
||||
printIndividualRecords: printIndividualRecords
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -80,6 +83,7 @@ function getSavedReportParameters() {
|
||||
$("#dateRangeSelector").prop('checked', selectedReportColumns.filterByDateRange);
|
||||
$("#dateRangeStartDate").val(selectedReportColumns.startDate);
|
||||
$("#dateRangeEndDate").val(selectedReportColumns.endDate);
|
||||
$("#printIndividualRecordsCheck").prop('checked', selectedReportColumns.printIndividualRecords);
|
||||
}
|
||||
}
|
||||
function generateVehicleHistoryReport() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user