Merge pull request #803 from hargata/Hargata/801
Hargata/801 - Printable Stickers
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
using CarCareTracker.External.Interfaces;
|
||||
using CarCareTracker.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using CarCareTracker.Helper;
|
||||
using System.Globalization;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using System.Security.Claims;
|
||||
using CarCareTracker.Logic;
|
||||
using CarCareTracker.Filter;
|
||||
using CarCareTracker.Helper;
|
||||
using CarCareTracker.Logic;
|
||||
using CarCareTracker.Models;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Globalization;
|
||||
using System.Security.Claims;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace CarCareTracker.Controllers
|
||||
@@ -131,7 +131,8 @@ namespace CarCareTracker.Controllers
|
||||
{
|
||||
_userLogic.AddUserAccessToVehicle(GetUserID(), vehicleInput.Id);
|
||||
StaticHelper.NotifyAsync(_config.GetWebHookUrl(), WebHookPayload.Generic($"Created Vehicle {vehicleInput.Year} {vehicleInput.Make} {vehicleInput.Model}({StaticHelper.GetVehicleIdentifier(vehicleInput)})", "vehicle.add", User.Identity.Name, vehicleInput.Id.ToString()));
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
StaticHelper.NotifyAsync(_config.GetWebHookUrl(), WebHookPayload.Generic($"Updated Vehicle {vehicleInput.Year} {vehicleInput.Make} {vehicleInput.Model}({StaticHelper.GetVehicleIdentifier(vehicleInput)})", "vehicle.update", User.Identity.Name, vehicleInput.Id.ToString()));
|
||||
}
|
||||
@@ -198,7 +199,7 @@ namespace CarCareTracker.Controllers
|
||||
return Json(OperationResponse.Failed());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region "Shared Methods"
|
||||
[HttpPost]
|
||||
public IActionResult GetFilesPendingUpload(List<UploadedFiles> uploadedFiles)
|
||||
@@ -215,7 +216,7 @@ namespace CarCareTracker.Controllers
|
||||
{
|
||||
return Json(searchResults);
|
||||
}
|
||||
foreach(ImportMode visibleTab in _config.GetUserConfig(User).VisibleTabs)
|
||||
foreach (ImportMode visibleTab in _config.GetUserConfig(User).VisibleTabs)
|
||||
{
|
||||
switch (visibleTab)
|
||||
{
|
||||
@@ -843,14 +844,15 @@ namespace CarCareTracker.Controllers
|
||||
}
|
||||
if (extraFieldIsEdited)
|
||||
{
|
||||
foreach(ExtraField extraField in genericRecordEditModel.EditRecord.ExtraFields)
|
||||
foreach (ExtraField extraField in genericRecordEditModel.EditRecord.ExtraFields)
|
||||
{
|
||||
if (existingRecord.ExtraFields.Any(x=>x.Name == extraField.Name))
|
||||
if (existingRecord.ExtraFields.Any(x => x.Name == extraField.Name))
|
||||
{
|
||||
var insertIndex = existingRecord.ExtraFields.FindIndex(x => x.Name == extraField.Name);
|
||||
existingRecord.ExtraFields.RemoveAll(x => x.Name == extraField.Name);
|
||||
existingRecord.ExtraFields.Insert(insertIndex, extraField);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
existingRecord.ExtraFields.Add(extraField);
|
||||
}
|
||||
@@ -956,6 +958,149 @@ namespace CarCareTracker.Controllers
|
||||
return Json(result);
|
||||
}
|
||||
[HttpPost]
|
||||
public IActionResult PrintRecordStickers(int vehicleId, List<int> recordIds, ImportMode importMode)
|
||||
{
|
||||
bool result = false;
|
||||
if (!recordIds.Any())
|
||||
{
|
||||
return Json(result);
|
||||
}
|
||||
var stickerViewModel = new StickerViewModel() { RecordType = importMode };
|
||||
if (vehicleId != default)
|
||||
{
|
||||
var vehicleData = _dataAccess.GetVehicleById(vehicleId);
|
||||
if (vehicleData != null && vehicleData.Id != default)
|
||||
{
|
||||
stickerViewModel.VehicleData = vehicleData;
|
||||
}
|
||||
}
|
||||
|
||||
int recordsAdded = 0;
|
||||
switch (importMode)
|
||||
{
|
||||
case ImportMode.ServiceRecord:
|
||||
{
|
||||
foreach (int recordId in recordIds)
|
||||
{
|
||||
stickerViewModel.GenericRecords.Add(_serviceRecordDataAccess.GetServiceRecordById(recordId));
|
||||
recordsAdded++;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case ImportMode.RepairRecord:
|
||||
{
|
||||
foreach (int recordId in recordIds)
|
||||
{
|
||||
stickerViewModel.GenericRecords.Add(_collisionRecordDataAccess.GetCollisionRecordById(recordId));
|
||||
recordsAdded++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ImportMode.UpgradeRecord:
|
||||
{
|
||||
foreach (int recordId in recordIds)
|
||||
{
|
||||
stickerViewModel.GenericRecords.Add(_upgradeRecordDataAccess.GetUpgradeRecordById(recordId));
|
||||
recordsAdded++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ImportMode.GasRecord:
|
||||
{
|
||||
foreach (int recordId in recordIds)
|
||||
{
|
||||
var record = _gasRecordDataAccess.GetGasRecordById(recordId);
|
||||
stickerViewModel.GenericRecords.Add(new GenericRecord
|
||||
{
|
||||
Cost = record.Cost,
|
||||
Date = record.Date,
|
||||
Notes = record.Notes,
|
||||
Mileage = record.Mileage
|
||||
});
|
||||
recordsAdded++;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case ImportMode.TaxRecord:
|
||||
{
|
||||
foreach (int recordId in recordIds)
|
||||
{
|
||||
var record = _taxRecordDataAccess.GetTaxRecordById(recordId);
|
||||
stickerViewModel.GenericRecords.Add(new GenericRecord
|
||||
{
|
||||
Description = record.Description,
|
||||
Cost = record.Cost,
|
||||
Notes = record.Notes,
|
||||
Date = record.Date
|
||||
});
|
||||
recordsAdded++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ImportMode.SupplyRecord:
|
||||
{
|
||||
foreach (int recordId in recordIds)
|
||||
{
|
||||
//stickerViewModel.VehicleRecords.SupplyRecords.Add(_supplyRecordDataAccess.GetSupplyRecordById(recordId));
|
||||
recordsAdded++;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case ImportMode.NoteRecord:
|
||||
{
|
||||
foreach (int recordId in recordIds)
|
||||
{
|
||||
var record = _noteDataAccess.GetNoteById(recordId);
|
||||
stickerViewModel.GenericRecords.Add(new GenericRecord
|
||||
{
|
||||
Description = record.Description,
|
||||
Notes = record.NoteText
|
||||
});
|
||||
recordsAdded++;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case ImportMode.OdometerRecord:
|
||||
{
|
||||
foreach (int recordId in recordIds)
|
||||
{
|
||||
//stickerViewModel.VehicleRecords.OdometerRecords.Add(_odometerRecordDataAccess.GetOdometerRecordById(recordId));
|
||||
recordsAdded++;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case ImportMode.ReminderRecord:
|
||||
{
|
||||
foreach (int recordId in recordIds)
|
||||
{
|
||||
stickerViewModel.ReminderRecords.Add(_reminderRecordDataAccess.GetReminderRecordById(recordId));
|
||||
recordsAdded++;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case ImportMode.PlanRecord:
|
||||
{
|
||||
foreach (int recordId in recordIds)
|
||||
{
|
||||
//stickerViewModel.VehicleRecords.PlanRecords.Add(_planRecordDataAccess.GetPlanRecordById(recordId));
|
||||
recordsAdded++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (recordsAdded > 0)
|
||||
{
|
||||
return PartialView("_Stickers", stickerViewModel);
|
||||
}
|
||||
return Json(result);
|
||||
}
|
||||
[HttpPost]
|
||||
public IActionResult SaveUserColumnPreferences(UserColumnPreference columnPreference)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CarCareTracker.Helper
|
||||
/// </summary>
|
||||
public static class StaticHelper
|
||||
{
|
||||
public const string VersionNumber = "1.4.3";
|
||||
public const string VersionNumber = "1.4.4";
|
||||
public const string DbName = "data/cartracker.db";
|
||||
public const string UserConfigPath = "data/config/userConfig.json";
|
||||
public const string LegacyUserConfigPath = "config/userConfig.json";
|
||||
|
||||
10
Models/Shared/StickerViewModel.cs
Normal file
10
Models/Shared/StickerViewModel.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace CarCareTracker.Models
|
||||
{
|
||||
public class StickerViewModel
|
||||
{
|
||||
public ImportMode RecordType { get; set; }
|
||||
public Vehicle VehicleData { get; set; } = new Vehicle();
|
||||
public List<ReminderRecord> ReminderRecords { get; set; } = new List<ReminderRecord>();
|
||||
public List<GenericRecord> GenericRecords { get; set; } = new List<GenericRecord>();
|
||||
}
|
||||
}
|
||||
@@ -158,6 +158,8 @@
|
||||
<div class="modal-content" id="inputSuppliesModalContent"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stickerPrintContainer hideOnPrint">
|
||||
</div>
|
||||
<script>
|
||||
function GetVehicleId() {
|
||||
return {
|
||||
|
||||
@@ -185,6 +185,8 @@
|
||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecordsToOtherVehicles(selectedRow, 'RepairRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Duplicate To Vehicle")</span><i class="bi bi-copy"></i></div></a></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="insertOdometer(selectedRow, 'RepairRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Create Odometer")</span><i class="bi bi-speedometer"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="printTabStickers(selectedRow, 'RepairRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Print")</span><i class="bi bi-printer"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item text-danger" href="#" onclick="deleteRecords(selectedRow, 'RepairRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Delete")</span><i class="bi bi-trash"></i></div></a></li>
|
||||
<li><hr class="context-menu-active-multiple dropdown-divider"></li>
|
||||
<li><a class="context-menu-active-multiple dropdown-item" href="#" onclick="getRecordsDeltaStats(selectedRow)"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Statistics")</span><i class="bi bi-graph-up"></i></div></a></li>
|
||||
|
||||
@@ -254,6 +254,8 @@
|
||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecordsToOtherVehicles(selectedRow, 'GasRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Duplicate To Vehicle")</span><i class="bi bi-copy"></i></div></a></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="insertOdometer(selectedRow, 'GasRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Create Odometer")</span><i class="bi bi-speedometer"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="printTabStickers(selectedRow, 'GasRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Print")</span><i class="bi bi-printer"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item text-danger" href="#" onclick="deleteRecords(selectedRow, 'GasRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Delete")</span><i class="bi bi-trash"></i></div></a></li>
|
||||
<li><hr class="context-menu-odometer-adjustment dropdown-divider"></li>
|
||||
<li><a class="context-menu-odometer-adjustment dropdown-item" href="#" onclick="adjustRecordsOdometer(selectedRow, 'GasRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Adjust Odometer")</span><i class="bi bi-speedometer"></i></div></a></li>
|
||||
|
||||
@@ -109,5 +109,8 @@
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecords(selectedRow, 'NoteRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Duplicate")</span><i class="bi bi-copy"></i></div></a></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecordsToOtherVehicles(selectedRow, 'NoteRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Duplicate To Vehicle")</span><i class="bi bi-copy"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="printTabStickers(selectedRow, 'NoteRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Print")</span><i class="bi bi-printer"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item text-danger" href="#" onclick="deleteRecords(selectedRow, 'NoteRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Delete")</span><i class="bi bi-trash"></i></div></a></li>
|
||||
</ul>
|
||||
@@ -200,6 +200,9 @@
|
||||
<li><hr class="context-menu-multiple dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecords(selectedRow, 'ReminderRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Duplicate")</span><i class="bi bi-copy"></i></div></a></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecordsToOtherVehicles(selectedRow, 'ReminderRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Duplicate To Vehicle")</span><i class="bi bi-copy"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="printTabStickers(selectedRow, 'ReminderRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Print")</span><i class="bi bi-printer"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item text-danger" href="#" onclick="deleteRecords(selectedRow, 'ReminderRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Delete")</span><i class="bi bi-trash"></i></div></a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -168,7 +168,6 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div id="vehicleHistoryReport" class="showOnPrint"></div>
|
||||
|
||||
<script>
|
||||
getSelectedMetrics();
|
||||
|
||||
@@ -183,6 +183,8 @@
|
||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecordsToOtherVehicles(selectedRow, 'ServiceRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Duplicate To Vehicle")</span><i class="bi bi-copy"></i></div></a></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="insertOdometer(selectedRow, 'ServiceRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Create Odometer")</span><i class="bi bi-speedometer"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="printTabStickers(selectedRow, 'ServiceRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Print")</span><i class="bi bi-printer"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item text-danger" href="#" onclick="deleteRecords(selectedRow, 'ServiceRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Delete")</span><i class="bi bi-trash"></i></div></a></li>
|
||||
<li><hr class="context-menu-active-multiple dropdown-divider"></li>
|
||||
<li><a class="context-menu-active-multiple dropdown-item" href="#" onclick="getRecordsDeltaStats(selectedRow)"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Statistics")</span><i class="bi bi-graph-up"></i></div></a></li>
|
||||
|
||||
139
Views/Vehicle/_Stickers.cshtml
Normal file
139
Views/Vehicle/_Stickers.cshtml
Normal file
@@ -0,0 +1,139 @@
|
||||
@using CarCareTracker.Helper
|
||||
@inject IConfigHelper config
|
||||
@inject ITranslationHelper translator
|
||||
@model StickerViewModel
|
||||
@{
|
||||
var userConfig = config.GetUserConfig(User);
|
||||
var hideZero = userConfig.HideZero;
|
||||
var userLanguage = userConfig.UserLanguage;
|
||||
}
|
||||
@if( Model.ReminderRecords.Any()){
|
||||
@foreach(ReminderRecord reminder in Model.ReminderRecords){
|
||||
<div class="reminderSticker">
|
||||
<div class="row justify-content-center mt-2">
|
||||
<img src="@config.GetLogoUrl()" class="lubelogger-logo-sticker" />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<p class="display-1">@($"{Model.VehicleData.Year} {Model.VehicleData.Make} {Model.VehicleData.Model}")</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<p class="display-2">@($"{StaticHelper.GetVehicleIdentifier(Model.VehicleData)}")</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<p class="display-2 text-uppercase fw-bold">@($"{reminder.Description}")</p>
|
||||
</div>
|
||||
</div>
|
||||
@if (reminder.Metric == ReminderMetric.Odometer || reminder.Metric == ReminderMetric.Both)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<p class="display-2">@($"{translator.Translate(userLanguage, "Odometer")}")</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<p class="display-2 fw-bold">@($"{reminder.Mileage}")</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (reminder.Metric == ReminderMetric.Date || reminder.Metric == ReminderMetric.Both)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<p class="display-2">@($"{translator.Translate(userLanguage, "Date")}")</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<p class="display-2 fw-bold">@($"{reminder.Date.ToShortDateString()}")</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (reminder.Metric == ReminderMetric.Both)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<p class="display-2 text-uppercase">@($"{translator.Translate(userLanguage, "Whichever comes first")}")</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
} else if (Model.GenericRecords.Any()){
|
||||
@foreach(GenericRecord genericRecord in Model.GenericRecords){
|
||||
<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(Model.RecordType){
|
||||
case ImportMode.ServiceRecord:
|
||||
case ImportMode.RepairRecord:
|
||||
case ImportMode.UpgradeRecord:
|
||||
case ImportMode.GasRecord:
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Date")}: {genericRecord.Date.ToShortDateString()}")
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Odometer")}: {genericRecord.Mileage}")
|
||||
</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;
|
||||
}
|
||||
</ul>
|
||||
</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>
|
||||
}
|
||||
@@ -170,6 +170,9 @@
|
||||
<li><hr class="context-menu-multiple dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecords(selectedRow, 'TaxRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Duplicate")</span><i class="bi bi-copy"></i></div></a></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecordsToOtherVehicles(selectedRow, 'TaxRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Duplicate To Vehicle")</span><i class="bi bi-copy"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="printTabStickers(selectedRow, 'TaxRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Print")</span><i class="bi bi-printer"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item text-danger" href="#" onclick="deleteRecords(selectedRow, 'TaxRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Delete")</span><i class="bi bi-trash"></i></div></a></li>
|
||||
</ul>
|
||||
@if (userColumnPreferences.Any())
|
||||
|
||||
@@ -184,6 +184,8 @@
|
||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecordsToOtherVehicles(selectedRow, 'UpgradeRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Duplicate To Vehicle")</span><i class="bi bi-copy"></i></div></a></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="insertOdometer(selectedRow, 'UpgradeRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Create Odometer")</span><i class="bi bi-speedometer"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="printTabStickers(selectedRow, 'UpgradeRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Print")</span><i class="bi bi-printer"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item text-danger" href="#" onclick="deleteRecords(selectedRow, 'UpgradeRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Delete")</span><i class="bi bi-trash"></i></div></a></li>
|
||||
<li><hr class="context-menu-active-multiple dropdown-divider"></li>
|
||||
<li><a class="context-menu-active-multiple dropdown-item" href="#" onclick="getRecordsDeltaStats(selectedRow)"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Statistics")</span><i class="bi bi-graph-up"></i></div></a></li>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
var userLanguage = userConfig.UserLanguage;
|
||||
var extraFields = Model.ReportParameters.ExtraFields;
|
||||
}
|
||||
<div class="vehicleDetailTabContainer">
|
||||
<div>
|
||||
<div class="row mt-2">
|
||||
<div class="d-flex">
|
||||
<img src="@config.GetLogoUrl()" class="lubelogger-logo" />
|
||||
|
||||
@@ -81,6 +81,34 @@ html {
|
||||
color: #000 !important;
|
||||
overflow: visible;
|
||||
}
|
||||
.stickerPrintContainer {
|
||||
background-color: #fff !important;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
color: #000 !important;
|
||||
overflow: visible;
|
||||
z-index: 1030;
|
||||
}
|
||||
.reminderSticker {
|
||||
width: 98%;
|
||||
aspect-ratio: 1/1;
|
||||
border-style: dashed;
|
||||
border-width: 2px;
|
||||
page-break-after: always;
|
||||
}
|
||||
.recordSticker {
|
||||
height: 100%;
|
||||
page-break-after: always;
|
||||
}
|
||||
.stickerNote {
|
||||
height:100%;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #fff !important;
|
||||
@@ -478,6 +506,12 @@ html[data-bs-theme="light"] .api-method:hover {
|
||||
object-fit: scale-down;
|
||||
pointer-events: none;
|
||||
}
|
||||
.lubelogger-logo-sticker {
|
||||
height: 6rem;
|
||||
width: auto;
|
||||
object-fit: scale-down;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
::-ms-reveal {
|
||||
display: none;
|
||||
|
||||
@@ -114,10 +114,7 @@ function generateVehicleHistoryReport() {
|
||||
reportParameter: result.value.selectedColumnsData
|
||||
}, function (data) {
|
||||
if (data) {
|
||||
$("#vehicleHistoryReport").html(data);
|
||||
setTimeout(function () {
|
||||
window.print();
|
||||
}, 500);
|
||||
printContainer(data);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -608,6 +608,16 @@ function toggleMarkDownOverlay(textAreaName) {
|
||||
textArea.parent().children(`label[for=${textAreaName}]`).append(overlayDiv);
|
||||
}
|
||||
}
|
||||
function setMarkDownStickerNotes() {
|
||||
var stickerContainers = $(".stickerNote");
|
||||
if (stickerContainers.length > 0) {
|
||||
stickerContainers.map((index, elem) => {
|
||||
let originalStickerNote = $(elem).html().trim();
|
||||
let markDownStickerNote = markdown(originalStickerNote);
|
||||
$(elem).html(markDownStickerNote);
|
||||
});
|
||||
}
|
||||
}
|
||||
function showLinks(e) {
|
||||
var textAreaName = $(e.parentElement).attr("for");
|
||||
toggleMarkDownOverlay(textAreaName);
|
||||
@@ -617,6 +627,33 @@ function printTab() {
|
||||
window.print();
|
||||
}, 500);
|
||||
}
|
||||
function printContainer(htmlData) {
|
||||
$(".vehicleDetailTabContainer").addClass("hideOnPrint");
|
||||
$(".stickerPrintContainer").addClass("showOnPrint");
|
||||
$(".stickerPrintContainer").removeClass("hideOnPrint");
|
||||
$(".stickerPrintContainer").html(htmlData);
|
||||
setTimeout(function () {
|
||||
window.print();
|
||||
setTimeout(function () {
|
||||
$(".stickerPrintContainer").removeClass("showOnPrint");
|
||||
$(".stickerPrintContainer").addClass("hideOnPrint");
|
||||
$(".vehicleDetailTabContainer").removeClass("hideOnPrint");
|
||||
$(".stickerPrintContainer").html("");
|
||||
}, 1000);
|
||||
}, 500);
|
||||
}
|
||||
function printTabStickers(ids, source) {
|
||||
var vehicleId = GetVehicleId().vehicleId;
|
||||
$.post('/Vehicle/PrintRecordStickers', {
|
||||
vehicleId: vehicleId,
|
||||
recordIds: ids,
|
||||
importMode: source
|
||||
}, function (data) {
|
||||
if (data) {
|
||||
printContainer(data);
|
||||
}
|
||||
})
|
||||
}
|
||||
function exportVehicleData(mode) {
|
||||
var vehicleId = GetVehicleId().vehicleId;
|
||||
$.get('/Vehicle/ExportFromVehicleToCsv', { vehicleId: vehicleId, mode: mode }, function (data) {
|
||||
|
||||
Reference in New Issue
Block a user