Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d5020b607 | ||
|
|
7d8b7596ce | ||
|
|
08b5c9f25a | ||
|
|
82a4f8d57b | ||
|
|
538a79319e | ||
|
|
0555dcbc43 | ||
|
|
7b1f19ff9f | ||
|
|
9cac427eb9 | ||
|
|
1e5950028f | ||
|
|
7a7d343c3f | ||
|
|
ebf6388414 | ||
|
|
fa5426be53 | ||
|
|
4c60bb20c9 | ||
|
|
b02f3c8f8b | ||
|
|
d5f769e5a4 | ||
|
|
2afd1188eb | ||
|
|
1c6301242d | ||
|
|
06016727d9 | ||
|
|
1ee0c27ff9 | ||
|
|
7f03a630c6 | ||
|
|
2aa19f4f3b | ||
|
|
4be3c16adc | ||
|
|
f1f99a67dd | ||
|
|
a4f15ffe15 | ||
|
|
c11dad0cb3 | ||
|
|
2bf2469657 | ||
|
|
a23b02e962 | ||
|
|
905ee9bf27 | ||
|
|
e26869b30b | ||
|
|
90867792d9 | ||
|
|
1238802a75 | ||
|
|
8f7c50b88f | ||
|
|
df24434689 | ||
|
|
878748803d | ||
|
|
80bbf7f22f | ||
|
|
28b0ea565a | ||
|
|
07ccd1dea9 | ||
|
|
6a8fba535a | ||
|
|
f1b82ad0d3 | ||
|
|
0035bc09dd | ||
|
|
863c57d7fb | ||
|
|
00ccb68ce2 | ||
|
|
c2995dcd25 | ||
|
|
7b63366627 | ||
|
|
ababa6bf27 | ||
|
|
3f1f42d4f0 | ||
|
|
4d76bd6d36 | ||
|
|
ab34d1682c | ||
|
|
552b7a6356 | ||
|
|
f86acf673a | ||
|
|
c6f49bafca | ||
|
|
fdbb325611 | ||
|
|
8c557ced85 | ||
|
|
ad0f7de506 | ||
|
|
15ec9bb454 | ||
|
|
9fe7558cfe | ||
|
|
3d4b970967 |
@@ -1232,6 +1232,11 @@ namespace CarCareTracker.Controllers
|
|||||||
[Route("/api/vehicle/reminders/send")]
|
[Route("/api/vehicle/reminders/send")]
|
||||||
public IActionResult SendReminders(List<ReminderUrgency> urgencies)
|
public IActionResult SendReminders(List<ReminderUrgency> urgencies)
|
||||||
{
|
{
|
||||||
|
if (!urgencies.Any())
|
||||||
|
{
|
||||||
|
//if no urgencies parameter, we will default to all urgencies.
|
||||||
|
urgencies = new List<ReminderUrgency> { ReminderUrgency.NotUrgent, ReminderUrgency.Urgent, ReminderUrgency.VeryUrgent, ReminderUrgency.PastDue };
|
||||||
|
}
|
||||||
var vehicles = _dataAccess.GetVehicles();
|
var vehicles = _dataAccess.GetVehicles();
|
||||||
List<OperationResponse> operationResponses = new List<OperationResponse>();
|
List<OperationResponse> operationResponses = new List<OperationResponse>();
|
||||||
var defaultEmailAddress = _config.GetUserConfig(User).DefaultReminderEmail;
|
var defaultEmailAddress = _config.GetUserConfig(User).DefaultReminderEmail;
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ namespace CarCareTracker.Controllers
|
|||||||
var kioskResult = _vehicleLogic.GetPlans(vehiclesStored, true);
|
var kioskResult = _vehicleLogic.GetPlans(vehiclesStored, true);
|
||||||
return PartialView("_KioskPlan", kioskResult);
|
return PartialView("_KioskPlan", kioskResult);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case KioskMode.Reminder:
|
case KioskMode.Reminder:
|
||||||
{
|
{
|
||||||
var kioskResult = _vehicleLogic.GetReminders(vehiclesStored, false);
|
var kioskResult = _vehicleLogic.GetReminders(vehiclesStored, false);
|
||||||
|
|||||||
@@ -240,6 +240,12 @@ namespace CarCareTracker.Controllers
|
|||||||
return Json(result);
|
return Json(result);
|
||||||
}
|
}
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
public IActionResult SendRegistrationToken(LoginModel credentials)
|
||||||
|
{
|
||||||
|
var result = _loginLogic.SendRegistrationToken(credentials);
|
||||||
|
return Json(result);
|
||||||
|
}
|
||||||
|
[HttpPost]
|
||||||
public IActionResult RequestResetPassword(LoginModel credentials)
|
public IActionResult RequestResetPassword(LoginModel credentials)
|
||||||
{
|
{
|
||||||
var result = _loginLogic.RequestResetPassword(credentials);
|
var result = _loginLogic.RequestResetPassword(credentials);
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ namespace CarCareTracker.Controllers
|
|||||||
ReminderMonthInterval = result.ReminderMonthInterval,
|
ReminderMonthInterval = result.ReminderMonthInterval,
|
||||||
CustomMileageInterval = result.CustomMileageInterval,
|
CustomMileageInterval = result.CustomMileageInterval,
|
||||||
CustomMonthInterval = result.CustomMonthInterval,
|
CustomMonthInterval = result.CustomMonthInterval,
|
||||||
|
CustomMonthIntervalUnit = result.CustomMonthIntervalUnit,
|
||||||
Tags = result.Tags
|
Tags = result.Tags
|
||||||
};
|
};
|
||||||
return PartialView("_ReminderRecordModal", convertedResult);
|
return PartialView("_ReminderRecordModal", convertedResult);
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ namespace CarCareTracker.Controllers
|
|||||||
var vehicleData = _dataAccess.GetVehicleById(vehicleId);
|
var vehicleData = _dataAccess.GetVehicleById(vehicleId);
|
||||||
var userConfig = _config.GetUserConfig(User);
|
var userConfig = _config.GetUserConfig(User);
|
||||||
var totalDistanceTraveled = maxMileage - minMileage;
|
var totalDistanceTraveled = maxMileage - minMileage;
|
||||||
var totalDays = _vehicleLogic.GetOwnershipDays(vehicleData.PurchaseDate, vehicleData.SoldDate, serviceRecords, collisionRecords, gasRecords, upgradeRecords, odometerRecords, taxRecords);
|
var totalDays = _vehicleLogic.GetOwnershipDays(vehicleData.PurchaseDate, vehicleData.SoldDate, year, serviceRecords, collisionRecords, gasRecords, upgradeRecords, odometerRecords, taxRecords);
|
||||||
var viewModel = new CostTableForVehicle
|
var viewModel = new CostTableForVehicle
|
||||||
{
|
{
|
||||||
ServiceRecordSum = serviceRecords.Sum(x => x.Cost),
|
ServiceRecordSum = serviceRecords.Sum(x => x.Cost),
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ namespace CarCareTracker.Controllers
|
|||||||
IsRecurring = result.IsRecurring,
|
IsRecurring = result.IsRecurring,
|
||||||
RecurringInterval = result.RecurringInterval,
|
RecurringInterval = result.RecurringInterval,
|
||||||
CustomMonthInterval = result.CustomMonthInterval,
|
CustomMonthInterval = result.CustomMonthInterval,
|
||||||
|
CustomMonthIntervalUnit = result.CustomMonthIntervalUnit,
|
||||||
Files = result.Files,
|
Files = result.Files,
|
||||||
Tags = result.Tags,
|
Tags = result.Tags,
|
||||||
ExtraFields = StaticHelper.AddExtraFields(result.ExtraFields, _extraFieldDataAccess.GetExtraFieldsById((int)ImportMode.TaxRecord).ExtraFields)
|
ExtraFields = StaticHelper.AddExtraFields(result.ExtraFields, _extraFieldDataAccess.GetExtraFieldsById((int)ImportMode.TaxRecord).ExtraFields)
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
using CarCareTracker.External.Interfaces;
|
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.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;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace CarCareTracker.Controllers
|
namespace CarCareTracker.Controllers
|
||||||
@@ -131,7 +131,8 @@ namespace CarCareTracker.Controllers
|
|||||||
{
|
{
|
||||||
_userLogic.AddUserAccessToVehicle(GetUserID(), vehicleInput.Id);
|
_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()));
|
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()));
|
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());
|
return Json(OperationResponse.Failed());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region "Shared Methods"
|
#region "Shared Methods"
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public IActionResult GetFilesPendingUpload(List<UploadedFiles> uploadedFiles)
|
public IActionResult GetFilesPendingUpload(List<UploadedFiles> uploadedFiles)
|
||||||
@@ -215,7 +216,7 @@ namespace CarCareTracker.Controllers
|
|||||||
{
|
{
|
||||||
return Json(searchResults);
|
return Json(searchResults);
|
||||||
}
|
}
|
||||||
foreach(ImportMode visibleTab in _config.GetUserConfig(User).VisibleTabs)
|
foreach (ImportMode visibleTab in _config.GetUserConfig(User).VisibleTabs)
|
||||||
{
|
{
|
||||||
switch (visibleTab)
|
switch (visibleTab)
|
||||||
{
|
{
|
||||||
@@ -843,14 +844,15 @@ namespace CarCareTracker.Controllers
|
|||||||
}
|
}
|
||||||
if (extraFieldIsEdited)
|
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);
|
var insertIndex = existingRecord.ExtraFields.FindIndex(x => x.Name == extraField.Name);
|
||||||
existingRecord.ExtraFields.RemoveAll(x => x.Name == extraField.Name);
|
existingRecord.ExtraFields.RemoveAll(x => x.Name == extraField.Name);
|
||||||
existingRecord.ExtraFields.Insert(insertIndex, extraField);
|
existingRecord.ExtraFields.Insert(insertIndex, extraField);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
existingRecord.ExtraFields.Add(extraField);
|
existingRecord.ExtraFields.Add(extraField);
|
||||||
}
|
}
|
||||||
@@ -956,6 +958,167 @@ namespace CarCareTracker.Controllers
|
|||||||
return Json(result);
|
return Json(result);
|
||||||
}
|
}
|
||||||
[HttpPost]
|
[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,
|
||||||
|
ExtraFields = record.ExtraFields
|
||||||
|
});
|
||||||
|
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,
|
||||||
|
ExtraFields = record.ExtraFields
|
||||||
|
});
|
||||||
|
recordsAdded++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ImportMode.SupplyRecord:
|
||||||
|
{
|
||||||
|
foreach (int recordId in recordIds)
|
||||||
|
{
|
||||||
|
var record = _supplyRecordDataAccess.GetSupplyRecordById(recordId);
|
||||||
|
stickerViewModel.SupplyRecords.Add(record);
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
var record = _odometerRecordDataAccess.GetOdometerRecordById(recordId);
|
||||||
|
stickerViewModel.GenericRecords.Add(new GenericRecord
|
||||||
|
{
|
||||||
|
Date = record.Date,
|
||||||
|
Mileage = record.Mileage,
|
||||||
|
Notes = record.Notes,
|
||||||
|
ExtraFields = record.ExtraFields
|
||||||
|
});
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
var record = _planRecordDataAccess.GetPlanRecordById(recordId);
|
||||||
|
stickerViewModel.GenericRecords.Add(new GenericRecord
|
||||||
|
{
|
||||||
|
Description = record.Description,
|
||||||
|
Cost = record.Cost,
|
||||||
|
Notes = record.Notes,
|
||||||
|
Date = record.DateModified,
|
||||||
|
ExtraFields = record.ExtraFields,
|
||||||
|
RequisitionHistory = record.RequisitionHistory
|
||||||
|
});
|
||||||
|
recordsAdded++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (recordsAdded > 0)
|
||||||
|
{
|
||||||
|
return PartialView("_Stickers", stickerViewModel);
|
||||||
|
}
|
||||||
|
return Json(result);
|
||||||
|
}
|
||||||
|
[HttpPost]
|
||||||
public IActionResult SaveUserColumnPreferences(UserColumnPreference columnPreference)
|
public IActionResult SaveUserColumnPreferences(UserColumnPreference columnPreference)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
8
Enum/ReminderIntervalUnit.cs
Normal file
8
Enum/ReminderIntervalUnit.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace CarCareTracker.Models
|
||||||
|
{
|
||||||
|
public enum ReminderIntervalUnit
|
||||||
|
{
|
||||||
|
Months = 1,
|
||||||
|
Days = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,6 +26,7 @@ namespace CarCareTracker.Helper
|
|||||||
string GetAllowedFileUploadExtensions();
|
string GetAllowedFileUploadExtensions();
|
||||||
bool DeleteUserConfig(int userId);
|
bool DeleteUserConfig(int userId);
|
||||||
bool GetInvariantApi();
|
bool GetInvariantApi();
|
||||||
|
bool GetServerOpenRegistration();
|
||||||
}
|
}
|
||||||
public class ConfigHelper : IConfigHelper
|
public class ConfigHelper : IConfigHelper
|
||||||
{
|
{
|
||||||
@@ -61,6 +62,10 @@ namespace CarCareTracker.Helper
|
|||||||
var motd = CheckString("LUBELOGGER_MOTD");
|
var motd = CheckString("LUBELOGGER_MOTD");
|
||||||
return motd;
|
return motd;
|
||||||
}
|
}
|
||||||
|
public bool GetServerOpenRegistration()
|
||||||
|
{
|
||||||
|
return CheckBool(CheckString("LUBELOGGER_OPEN_REGISTRATION"));
|
||||||
|
}
|
||||||
public OpenIDConfig GetOpenIDConfig()
|
public OpenIDConfig GetOpenIDConfig()
|
||||||
{
|
{
|
||||||
OpenIDConfig openIdConfig = _config.GetSection("OpenIDConfig").Get<OpenIDConfig>() ?? new OpenIDConfig();
|
OpenIDConfig openIdConfig = _config.GetSection("OpenIDConfig").Get<OpenIDConfig>() ?? new OpenIDConfig();
|
||||||
|
|||||||
@@ -15,16 +15,21 @@ namespace CarCareTracker.Helper
|
|||||||
public class MailHelper : IMailHelper
|
public class MailHelper : IMailHelper
|
||||||
{
|
{
|
||||||
private readonly MailConfig mailConfig;
|
private readonly MailConfig mailConfig;
|
||||||
|
private readonly string serverLanguage;
|
||||||
private readonly IFileHelper _fileHelper;
|
private readonly IFileHelper _fileHelper;
|
||||||
|
private readonly ITranslationHelper _translator;
|
||||||
private readonly ILogger<MailHelper> _logger;
|
private readonly ILogger<MailHelper> _logger;
|
||||||
public MailHelper(
|
public MailHelper(
|
||||||
IConfigHelper config,
|
IConfigHelper config,
|
||||||
IFileHelper fileHelper,
|
IFileHelper fileHelper,
|
||||||
|
ITranslationHelper translationHelper,
|
||||||
ILogger<MailHelper> logger
|
ILogger<MailHelper> logger
|
||||||
) {
|
) {
|
||||||
//load mailConfig from Configuration
|
//load mailConfig from Configuration
|
||||||
mailConfig = config.GetMailConfig();
|
mailConfig = config.GetMailConfig();
|
||||||
|
serverLanguage = config.GetServerLanguage();
|
||||||
_fileHelper = fileHelper;
|
_fileHelper = fileHelper;
|
||||||
|
_translator = translationHelper;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
public OperationResponse NotifyUserForRegistration(string emailAddress, string token)
|
public OperationResponse NotifyUserForRegistration(string emailAddress, string token)
|
||||||
@@ -36,8 +41,8 @@ namespace CarCareTracker.Helper
|
|||||||
if (string.IsNullOrWhiteSpace(emailAddress) || string.IsNullOrWhiteSpace(token)) {
|
if (string.IsNullOrWhiteSpace(emailAddress) || string.IsNullOrWhiteSpace(token)) {
|
||||||
return OperationResponse.Failed("Email Address or Token is invalid");
|
return OperationResponse.Failed("Email Address or Token is invalid");
|
||||||
}
|
}
|
||||||
string emailSubject = "Your Registration Token for LubeLogger";
|
string emailSubject = _translator.Translate(serverLanguage, "Your Registration Token for LubeLogger");
|
||||||
string emailBody = $"A token has been generated on your behalf, please complete your registration for LubeLogger using the token: {token}";
|
string emailBody = $"{_translator.Translate(serverLanguage, "A token has been generated on your behalf, please complete your registration for LubeLogger using the token")}: {token}";
|
||||||
var result = SendEmail(new List<string> { emailAddress }, emailSubject, emailBody);
|
var result = SendEmail(new List<string> { emailAddress }, emailSubject, emailBody);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
@@ -57,8 +62,8 @@ namespace CarCareTracker.Helper
|
|||||||
{
|
{
|
||||||
return OperationResponse.Failed("Email Address or Token is invalid");
|
return OperationResponse.Failed("Email Address or Token is invalid");
|
||||||
}
|
}
|
||||||
string emailSubject = "Your Password Reset Token for LubeLogger";
|
string emailSubject = _translator.Translate(serverLanguage, "Your Password Reset Token for LubeLogger");
|
||||||
string emailBody = $"A token has been generated on your behalf, please reset your password for LubeLogger using the token: {token}";
|
string emailBody = $"{_translator.Translate(serverLanguage, "A token has been generated on your behalf, please reset your password for LubeLogger using the token")}: {token}";
|
||||||
var result = SendEmail(new List<string> { emailAddress }, emailSubject, emailBody);
|
var result = SendEmail(new List<string> { emailAddress }, emailSubject, emailBody);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
@@ -79,8 +84,8 @@ namespace CarCareTracker.Helper
|
|||||||
{
|
{
|
||||||
return OperationResponse.Failed("Email Address or Token is invalid");
|
return OperationResponse.Failed("Email Address or Token is invalid");
|
||||||
}
|
}
|
||||||
string emailSubject = "Your User Account Update Token for LubeLogger";
|
string emailSubject = _translator.Translate(serverLanguage, "Your User Account Update Token for LubeLogger");
|
||||||
string emailBody = $"A token has been generated on your behalf, please update your account for LubeLogger using the token: {token}";
|
string emailBody = $"{_translator.Translate(serverLanguage, "A token has been generated on your behalf, please update your account for LubeLogger using the token")}: {token}";
|
||||||
var result = SendEmail(new List<string> { emailAddress}, emailSubject, emailBody);
|
var result = SendEmail(new List<string> { emailAddress}, emailSubject, emailBody);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
@@ -107,17 +112,18 @@ namespace CarCareTracker.Helper
|
|||||||
}
|
}
|
||||||
//get email template, this file has to exist since it's a static file.
|
//get email template, this file has to exist since it's a static file.
|
||||||
var emailTemplatePath = _fileHelper.GetFullFilePath(StaticHelper.ReminderEmailTemplate);
|
var emailTemplatePath = _fileHelper.GetFullFilePath(StaticHelper.ReminderEmailTemplate);
|
||||||
string emailSubject = $"Vehicle Reminders From LubeLogger - {DateTime.Now.ToShortDateString()}";
|
string emailSubject = $"{_translator.Translate(serverLanguage, "Vehicle Reminders From LubeLogger")} - {DateTime.Now.ToShortDateString()}";
|
||||||
//construct html table.
|
//construct html table.
|
||||||
string emailBody = File.ReadAllText(emailTemplatePath);
|
string emailBody = File.ReadAllText(emailTemplatePath);
|
||||||
emailBody = emailBody.Replace("{VehicleInformation}", $"{vehicle.Year} {vehicle.Make} {vehicle.Model} #{StaticHelper.GetVehicleIdentifier(vehicle)}");
|
emailBody = emailBody.Replace("{VehicleInformation}", $"{vehicle.Year} {vehicle.Make} {vehicle.Model} #{StaticHelper.GetVehicleIdentifier(vehicle)}");
|
||||||
|
string tableHeader = $"<th>{_translator.Translate(serverLanguage, "Urgency")}</th><th>{_translator.Translate(serverLanguage, "Description")}</th><th>{_translator.Translate(serverLanguage, "Due")}</th>";
|
||||||
string tableBody = "";
|
string tableBody = "";
|
||||||
foreach(ReminderRecordViewModel reminder in reminders)
|
foreach(ReminderRecordViewModel reminder in reminders)
|
||||||
{
|
{
|
||||||
var dueOn = reminder.Metric == ReminderMetric.Both ? $"{reminder.Date.ToShortDateString()} or {reminder.Mileage}" : reminder.Metric == ReminderMetric.Date ? $"{reminder.Date.ToShortDateString()}" : $"{reminder.Mileage}";
|
var dueOn = reminder.Metric == ReminderMetric.Both ? $"{reminder.Date.ToShortDateString()} or {reminder.Mileage}" : reminder.Metric == ReminderMetric.Date ? $"{reminder.Date.ToShortDateString()}" : $"{reminder.Mileage}";
|
||||||
tableBody += $"<tr class='{reminder.Urgency}'><td>{StaticHelper.GetTitleCaseReminderUrgency(reminder.Urgency)}</td><td>{reminder.Description}</td><td>{dueOn}</td></tr>";
|
tableBody += $"<tr class='{reminder.Urgency}'><td>{_translator.Translate(serverLanguage, StaticHelper.GetTitleCaseReminderUrgency(reminder.Urgency))}</td><td>{reminder.Description}</td><td>{dueOn}</td></tr>";
|
||||||
}
|
}
|
||||||
emailBody = emailBody.Replace("{TableBody}", tableBody);
|
emailBody = emailBody.Replace("{TableHeader}", tableHeader).Replace("{TableBody}", tableBody);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var result = SendEmail(emailAddresses, emailSubject, emailBody);
|
var result = SendEmail(emailAddresses, emailSubject, emailBody);
|
||||||
|
|||||||
@@ -25,7 +25,14 @@ namespace CarCareTracker.Helper
|
|||||||
existingReminder.Date = newDate.AddMonths((int)existingReminder.ReminderMonthInterval);
|
existingReminder.Date = newDate.AddMonths((int)existingReminder.ReminderMonthInterval);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
existingReminder.Date = newDate.Date.AddMonths(existingReminder.CustomMonthInterval);
|
if (existingReminder.CustomMonthIntervalUnit == ReminderIntervalUnit.Months)
|
||||||
|
{
|
||||||
|
existingReminder.Date = newDate.Date.AddMonths(existingReminder.CustomMonthInterval);
|
||||||
|
}
|
||||||
|
else if (existingReminder.CustomMonthIntervalUnit == ReminderIntervalUnit.Days)
|
||||||
|
{
|
||||||
|
existingReminder.Date = newDate.Date.AddDays(existingReminder.CustomMonthInterval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existingReminder.ReminderMileageInterval != ReminderMileageInterval.Other)
|
if (existingReminder.ReminderMileageInterval != ReminderMileageInterval.Other)
|
||||||
@@ -55,7 +62,14 @@ namespace CarCareTracker.Helper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
existingReminder.Date = newDate.AddMonths(existingReminder.CustomMonthInterval);
|
if (existingReminder.CustomMonthIntervalUnit == ReminderIntervalUnit.Months)
|
||||||
|
{
|
||||||
|
existingReminder.Date = newDate.AddMonths(existingReminder.CustomMonthInterval);
|
||||||
|
}
|
||||||
|
else if (existingReminder.CustomMonthIntervalUnit == ReminderIntervalUnit.Days)
|
||||||
|
{
|
||||||
|
existingReminder.Date = newDate.AddDays(existingReminder.CustomMonthInterval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return existingReminder;
|
return existingReminder;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace CarCareTracker.Helper
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class StaticHelper
|
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 DbName = "data/cartracker.db";
|
||||||
public const string UserConfigPath = "data/config/userConfig.json";
|
public const string UserConfigPath = "data/config/userConfig.json";
|
||||||
public const string LegacyUserConfigPath = "config/userConfig.json";
|
public const string LegacyUserConfigPath = "config/userConfig.json";
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace CarCareTracker.Logic
|
|||||||
OperationResponse RequestResetPassword(LoginModel credentials);
|
OperationResponse RequestResetPassword(LoginModel credentials);
|
||||||
OperationResponse ResetPasswordByUser(LoginModel credentials);
|
OperationResponse ResetPasswordByUser(LoginModel credentials);
|
||||||
OperationResponse ResetUserPassword(LoginModel credentials);
|
OperationResponse ResetUserPassword(LoginModel credentials);
|
||||||
|
OperationResponse SendRegistrationToken(LoginModel credentials);
|
||||||
UserData ValidateUserCredentials(LoginModel credentials);
|
UserData ValidateUserCredentials(LoginModel credentials);
|
||||||
UserData ValidateOpenIDUser(LoginModel credentials);
|
UserData ValidateOpenIDUser(LoginModel credentials);
|
||||||
bool CheckIfUserIsValid(int userId);
|
bool CheckIfUserIsValid(int userId);
|
||||||
@@ -190,6 +191,16 @@ namespace CarCareTracker.Logic
|
|||||||
return OperationResponse.Failed();
|
return OperationResponse.Failed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public OperationResponse SendRegistrationToken(LoginModel credentials)
|
||||||
|
{
|
||||||
|
if (_configHelper.GetServerOpenRegistration())
|
||||||
|
{
|
||||||
|
return GenerateUserToken(credentials.EmailAddress, true);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return OperationResponse.Failed("Open Registration Disabled");
|
||||||
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generates a token and notifies user via email so they can reset their password.
|
/// Generates a token and notifies user via email so they can reset their password.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -310,7 +321,18 @@ namespace CarCareTracker.Logic
|
|||||||
var existingToken = _tokenData.GetTokenRecordByEmailAddress(emailAddress);
|
var existingToken = _tokenData.GetTokenRecordByEmailAddress(emailAddress);
|
||||||
if (existingToken.Id != default)
|
if (existingToken.Id != default)
|
||||||
{
|
{
|
||||||
return OperationResponse.Failed("There is an existing token tied to this email address");
|
if (autoNotify) //re-send email
|
||||||
|
{
|
||||||
|
var notificationResult = _mailHelper.NotifyUserForRegistration(emailAddress, existingToken.Body);
|
||||||
|
if (notificationResult.Success)
|
||||||
|
{
|
||||||
|
return OperationResponse.Failed($"There is an existing token tied to {emailAddress}, a new email has been sent out");
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return notificationResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return OperationResponse.Failed($"There is an existing token tied to {emailAddress}");
|
||||||
}
|
}
|
||||||
var token = new Token()
|
var token = new Token()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace CarCareTracker.Logic
|
|||||||
int GetMaxMileage(VehicleRecords vehicleRecords);
|
int GetMaxMileage(VehicleRecords vehicleRecords);
|
||||||
int GetMinMileage(int vehicleId);
|
int GetMinMileage(int vehicleId);
|
||||||
int GetMinMileage(VehicleRecords vehicleRecords);
|
int GetMinMileage(VehicleRecords vehicleRecords);
|
||||||
int GetOwnershipDays(string purchaseDate, string soldDate, List<ServiceRecord> serviceRecords, List<CollisionRecord> repairRecords, List<GasRecord> gasRecords, List<UpgradeRecord> upgradeRecords, List<OdometerRecord> odometerRecords, List<TaxRecord> taxRecords);
|
int GetOwnershipDays(string purchaseDate, string soldDate, int year, List<ServiceRecord> serviceRecords, List<CollisionRecord> repairRecords, List<GasRecord> gasRecords, List<UpgradeRecord> upgradeRecords, List<OdometerRecord> odometerRecords, List<TaxRecord> taxRecords);
|
||||||
bool GetVehicleHasUrgentOrPastDueReminders(int vehicleId, int currentMileage);
|
bool GetVehicleHasUrgentOrPastDueReminders(int vehicleId, int currentMileage);
|
||||||
List<VehicleInfo> GetVehicleInfo(List<Vehicle> vehicles);
|
List<VehicleInfo> GetVehicleInfo(List<Vehicle> vehicles);
|
||||||
List<ReminderRecordViewModel> GetReminders(List<Vehicle> vehicles, bool isCalendar);
|
List<ReminderRecordViewModel> GetReminders(List<Vehicle> vehicles, bool isCalendar);
|
||||||
@@ -199,22 +199,44 @@ namespace CarCareTracker.Logic
|
|||||||
}
|
}
|
||||||
return numbersArray.Any() ? numbersArray.Min() : 0;
|
return numbersArray.Any() ? numbersArray.Min() : 0;
|
||||||
}
|
}
|
||||||
public int GetOwnershipDays(string purchaseDate, string soldDate, List<ServiceRecord> serviceRecords, List<CollisionRecord> repairRecords, List<GasRecord> gasRecords, List<UpgradeRecord> upgradeRecords, List<OdometerRecord> odometerRecords, List<TaxRecord> taxRecords)
|
public int GetOwnershipDays(string purchaseDate, string soldDate, int year, List<ServiceRecord> serviceRecords, List<CollisionRecord> repairRecords, List<GasRecord> gasRecords, List<UpgradeRecord> upgradeRecords, List<OdometerRecord> odometerRecords, List<TaxRecord> taxRecords)
|
||||||
{
|
{
|
||||||
var startDate = DateTime.Now;
|
var startDate = DateTime.Now;
|
||||||
var endDate = DateTime.Now;
|
var endDate = DateTime.Now;
|
||||||
if (!string.IsNullOrWhiteSpace(soldDate))
|
bool usePurchaseDate = false;
|
||||||
|
bool useSoldDate = false;
|
||||||
|
if (!string.IsNullOrWhiteSpace(soldDate) && DateTime.TryParse(soldDate, out DateTime vehicleSoldDate))
|
||||||
{
|
{
|
||||||
endDate = DateTime.Parse(soldDate);
|
if (year == default || year >= vehicleSoldDate.Year) //All Time is selected or the selected year is greater or equal to the year the vehicle is sold
|
||||||
|
{
|
||||||
|
endDate = vehicleSoldDate; //cap end date to vehicle sold date.
|
||||||
|
useSoldDate = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrWhiteSpace(purchaseDate))
|
if (!string.IsNullOrWhiteSpace(purchaseDate) && DateTime.TryParse(purchaseDate, out DateTime vehiclePurchaseDate))
|
||||||
{
|
{
|
||||||
//if purchase date is provided, then we just have to subtract the begin date to end date and return number of months
|
if (year == default || year <= vehiclePurchaseDate.Year) //All Time is selected or the selected year is less or equal to the year the vehicle is purchased
|
||||||
startDate = DateTime.Parse(purchaseDate);
|
{
|
||||||
|
startDate = vehiclePurchaseDate; //cap start date to vehicle purchase date
|
||||||
|
usePurchaseDate = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (year != default)
|
||||||
|
{
|
||||||
|
var calendarYearStart = new DateTime(year, 1, 1);
|
||||||
|
var calendarYearEnd = new DateTime(year + 1, 1, 1);
|
||||||
|
if (!useSoldDate)
|
||||||
|
{
|
||||||
|
endDate = endDate > calendarYearEnd ? calendarYearEnd : endDate;
|
||||||
|
}
|
||||||
|
if (!usePurchaseDate)
|
||||||
|
{
|
||||||
|
startDate = startDate > calendarYearStart ? calendarYearStart : startDate;
|
||||||
|
}
|
||||||
var timeElapsed = (int)Math.Floor((endDate - startDate).TotalDays);
|
var timeElapsed = (int)Math.Floor((endDate - startDate).TotalDays);
|
||||||
return timeElapsed;
|
return timeElapsed;
|
||||||
}
|
}
|
||||||
var dateArray = new List<DateTime>();
|
var dateArray = new List<DateTime>() { startDate };
|
||||||
dateArray.AddRange(serviceRecords.Select(x => x.Date));
|
dateArray.AddRange(serviceRecords.Select(x => x.Date));
|
||||||
dateArray.AddRange(repairRecords.Select(x => x.Date));
|
dateArray.AddRange(repairRecords.Select(x => x.Date));
|
||||||
dateArray.AddRange(gasRecords.Select(x => x.Date));
|
dateArray.AddRange(gasRecords.Select(x => x.Date));
|
||||||
@@ -340,7 +362,8 @@ namespace CarCareTracker.Logic
|
|||||||
bool RecurringTaxIsOutdated(TaxRecord taxRecord)
|
bool RecurringTaxIsOutdated(TaxRecord taxRecord)
|
||||||
{
|
{
|
||||||
var monthInterval = taxRecord.RecurringInterval != ReminderMonthInterval.Other ? (int)taxRecord.RecurringInterval : taxRecord.CustomMonthInterval;
|
var monthInterval = taxRecord.RecurringInterval != ReminderMonthInterval.Other ? (int)taxRecord.RecurringInterval : taxRecord.CustomMonthInterval;
|
||||||
return DateTime.Now > taxRecord.Date.AddMonths(monthInterval);
|
bool addDays = taxRecord.RecurringInterval == ReminderMonthInterval.Other && taxRecord.CustomMonthIntervalUnit == ReminderIntervalUnit.Days;
|
||||||
|
return addDays ? DateTime.Now > taxRecord.Date.AddDays(monthInterval) : DateTime.Now > taxRecord.Date.AddMonths(monthInterval);
|
||||||
}
|
}
|
||||||
var result = _taxRecordDataAccess.GetTaxRecordsByVehicleId(vehicleId);
|
var result = _taxRecordDataAccess.GetTaxRecordsByVehicleId(vehicleId);
|
||||||
var outdatedRecurringFees = result.Where(x => x.IsRecurring && RecurringTaxIsOutdated(x));
|
var outdatedRecurringFees = result.Where(x => x.IsRecurring && RecurringTaxIsOutdated(x));
|
||||||
@@ -351,6 +374,7 @@ namespace CarCareTracker.Logic
|
|||||||
{
|
{
|
||||||
var monthInterval = recurringFee.RecurringInterval != ReminderMonthInterval.Other ? (int)recurringFee.RecurringInterval : recurringFee.CustomMonthInterval;
|
var monthInterval = recurringFee.RecurringInterval != ReminderMonthInterval.Other ? (int)recurringFee.RecurringInterval : recurringFee.CustomMonthInterval;
|
||||||
bool isOutdated = true;
|
bool isOutdated = true;
|
||||||
|
bool addDays = recurringFee.RecurringInterval == ReminderMonthInterval.Other && recurringFee.CustomMonthIntervalUnit == ReminderIntervalUnit.Days;
|
||||||
//update the original outdated tax record
|
//update the original outdated tax record
|
||||||
recurringFee.IsRecurring = false;
|
recurringFee.IsRecurring = false;
|
||||||
_taxRecordDataAccess.SaveTaxRecordToVehicle(recurringFee);
|
_taxRecordDataAccess.SaveTaxRecordToVehicle(recurringFee);
|
||||||
@@ -361,9 +385,9 @@ namespace CarCareTracker.Logic
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var nextDate = originalDate.AddMonths(monthInterval * monthMultiplier);
|
var nextDate = addDays ? originalDate.AddDays(monthInterval * monthMultiplier) : originalDate.AddMonths(monthInterval * monthMultiplier);
|
||||||
monthMultiplier++;
|
monthMultiplier++;
|
||||||
var nextnextDate = originalDate.AddMonths(monthInterval * monthMultiplier);
|
var nextnextDate = addDays ? originalDate.AddDays(monthInterval * monthMultiplier) : originalDate.AddMonths(monthInterval * monthMultiplier);
|
||||||
recurringFee.Date = nextDate;
|
recurringFee.Date = nextDate;
|
||||||
recurringFee.Id = default; //new record
|
recurringFee.Id = default; //new record
|
||||||
recurringFee.IsRecurring = DateTime.Now <= nextnextDate;
|
recurringFee.IsRecurring = DateTime.Now <= nextnextDate;
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ namespace CarCareTracker.Middleware
|
|||||||
if (value.ToString().ToLower() == "api")
|
if (value.ToString().ToLower() == "api")
|
||||||
{
|
{
|
||||||
Response.StatusCode = 401;
|
Response.StatusCode = 401;
|
||||||
|
Response.Headers.Append("WWW-Authenticate", "Basic");
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
public ReminderUrgencyConfig CustomThresholds { get; set; } = new ReminderUrgencyConfig();
|
public ReminderUrgencyConfig CustomThresholds { get; set; } = new ReminderUrgencyConfig();
|
||||||
public int CustomMileageInterval { get; set; } = 0;
|
public int CustomMileageInterval { get; set; } = 0;
|
||||||
public int CustomMonthInterval { get; set; } = 0;
|
public int CustomMonthInterval { get; set; } = 0;
|
||||||
|
public ReminderIntervalUnit CustomMonthIntervalUnit { get; set; } = ReminderIntervalUnit.Months;
|
||||||
public ReminderMileageInterval ReminderMileageInterval { get; set; } = ReminderMileageInterval.FiveThousandMiles;
|
public ReminderMileageInterval ReminderMileageInterval { get; set; } = ReminderMileageInterval.FiveThousandMiles;
|
||||||
public ReminderMonthInterval ReminderMonthInterval { get; set; } = ReminderMonthInterval.OneYear;
|
public ReminderMonthInterval ReminderMonthInterval { get; set; } = ReminderMonthInterval.OneYear;
|
||||||
public ReminderMetric Metric { get; set; } = ReminderMetric.Date;
|
public ReminderMetric Metric { get; set; } = ReminderMetric.Date;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
public ReminderUrgencyConfig CustomThresholds { get; set; } = new ReminderUrgencyConfig();
|
public ReminderUrgencyConfig CustomThresholds { get; set; } = new ReminderUrgencyConfig();
|
||||||
public int CustomMileageInterval { get; set; } = 0;
|
public int CustomMileageInterval { get; set; } = 0;
|
||||||
public int CustomMonthInterval { get; set; } = 0;
|
public int CustomMonthInterval { get; set; } = 0;
|
||||||
|
public ReminderIntervalUnit CustomMonthIntervalUnit { get; set; } = ReminderIntervalUnit.Months;
|
||||||
public ReminderMileageInterval ReminderMileageInterval { get; set; } = ReminderMileageInterval.FiveThousandMiles;
|
public ReminderMileageInterval ReminderMileageInterval { get; set; } = ReminderMileageInterval.FiveThousandMiles;
|
||||||
public ReminderMonthInterval ReminderMonthInterval { get; set; } = ReminderMonthInterval.OneYear;
|
public ReminderMonthInterval ReminderMonthInterval { get; set; } = ReminderMonthInterval.OneYear;
|
||||||
public ReminderMetric Metric { get; set; } = ReminderMetric.Date;
|
public ReminderMetric Metric { get; set; } = ReminderMetric.Date;
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
ReminderMonthInterval = ReminderMonthInterval,
|
ReminderMonthInterval = ReminderMonthInterval,
|
||||||
CustomMileageInterval = CustomMileageInterval,
|
CustomMileageInterval = CustomMileageInterval,
|
||||||
CustomMonthInterval = CustomMonthInterval,
|
CustomMonthInterval = CustomMonthInterval,
|
||||||
|
CustomMonthIntervalUnit = CustomMonthIntervalUnit,
|
||||||
Notes = Notes,
|
Notes = Notes,
|
||||||
Tags = Tags
|
Tags = Tags
|
||||||
};
|
};
|
||||||
|
|||||||
11
Models/Shared/StickerViewModel.cs
Normal file
11
Models/Shared/StickerViewModel.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
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>();
|
||||||
|
public List<SupplyRecord> SupplyRecords { get; set; } = new List<SupplyRecord>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
public bool IsRecurring { get; set; } = false;
|
public bool IsRecurring { get; set; } = false;
|
||||||
public ReminderMonthInterval RecurringInterval { get; set; } = ReminderMonthInterval.OneYear;
|
public ReminderMonthInterval RecurringInterval { get; set; } = ReminderMonthInterval.OneYear;
|
||||||
public int CustomMonthInterval { get; set; } = 0;
|
public int CustomMonthInterval { get; set; } = 0;
|
||||||
|
public ReminderIntervalUnit CustomMonthIntervalUnit { get; set; } = ReminderIntervalUnit.Months;
|
||||||
public List<UploadedFiles> Files { get; set; } = new List<UploadedFiles>();
|
public List<UploadedFiles> Files { get; set; } = new List<UploadedFiles>();
|
||||||
public List<string> Tags { get; set; } = new List<string>();
|
public List<string> Tags { get; set; } = new List<string>();
|
||||||
public List<ExtraField> ExtraFields { get; set; } = new List<ExtraField>();
|
public List<ExtraField> ExtraFields { get; set; } = new List<ExtraField>();
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
public bool IsRecurring { get; set; } = false;
|
public bool IsRecurring { get; set; } = false;
|
||||||
public ReminderMonthInterval RecurringInterval { get; set; } = ReminderMonthInterval.ThreeMonths;
|
public ReminderMonthInterval RecurringInterval { get; set; } = ReminderMonthInterval.ThreeMonths;
|
||||||
public int CustomMonthInterval { get; set; } = 0;
|
public int CustomMonthInterval { get; set; } = 0;
|
||||||
|
public ReminderIntervalUnit CustomMonthIntervalUnit { get; set; } = ReminderIntervalUnit.Months;
|
||||||
public List<UploadedFiles> Files { get; set; } = new List<UploadedFiles>();
|
public List<UploadedFiles> Files { get; set; } = new List<UploadedFiles>();
|
||||||
public List<string> Tags { get; set; } = new List<string>();
|
public List<string> Tags { get; set; } = new List<string>();
|
||||||
public List<ExtraField> ExtraFields { get; set; } = new List<ExtraField>();
|
public List<ExtraField> ExtraFields { get; set; } = new List<ExtraField>();
|
||||||
@@ -25,6 +26,7 @@
|
|||||||
IsRecurring = IsRecurring,
|
IsRecurring = IsRecurring,
|
||||||
RecurringInterval = RecurringInterval,
|
RecurringInterval = RecurringInterval,
|
||||||
CustomMonthInterval = CustomMonthInterval,
|
CustomMonthInterval = CustomMonthInterval,
|
||||||
|
CustomMonthIntervalUnit = CustomMonthIntervalUnit,
|
||||||
Files = Files,
|
Files = Files,
|
||||||
Tags = Tags,
|
Tags = Tags,
|
||||||
ExtraFields = ExtraFields
|
ExtraFields = ExtraFields
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ builder.Services.AddSingleton<IGasHelper, GasHelper>();
|
|||||||
builder.Services.AddSingleton<IReminderHelper, ReminderHelper>();
|
builder.Services.AddSingleton<IReminderHelper, ReminderHelper>();
|
||||||
builder.Services.AddSingleton<IReportHelper, ReportHelper>();
|
builder.Services.AddSingleton<IReportHelper, ReportHelper>();
|
||||||
builder.Services.AddSingleton<IConfigHelper, ConfigHelper>();
|
builder.Services.AddSingleton<IConfigHelper, ConfigHelper>();
|
||||||
builder.Services.AddSingleton<IMailHelper, MailHelper>();
|
|
||||||
builder.Services.AddSingleton<ITranslationHelper, TranslationHelper>();
|
builder.Services.AddSingleton<ITranslationHelper, TranslationHelper>();
|
||||||
|
builder.Services.AddSingleton<IMailHelper, MailHelper>();
|
||||||
|
|
||||||
//configure logic
|
//configure logic
|
||||||
builder.Services.AddSingleton<ILoginLogic, LoginLogic>();
|
builder.Services.AddSingleton<ILoginLogic, LoginLogic>();
|
||||||
@@ -116,7 +116,7 @@ app.UseStaticFiles(new StaticFileOptions
|
|||||||
{
|
{
|
||||||
if (ctx.Context.Request.Path.StartsWithSegments("/images"))
|
if (ctx.Context.Request.Path.StartsWithSegments("/images"))
|
||||||
{
|
{
|
||||||
ctx.Context.Response.Headers.Add("Cache-Control", "no-store");
|
ctx.Context.Response.Headers.Append("Cache-Control", "no-store");
|
||||||
if (!ctx.Context.User.Identity.IsAuthenticated)
|
if (!ctx.Context.User.Identity.IsAuthenticated)
|
||||||
{
|
{
|
||||||
ctx.Context.Response.Redirect("/Login");
|
ctx.Context.Response.Redirect("/Login");
|
||||||
@@ -133,7 +133,7 @@ app.UseStaticFiles(new StaticFileOptions
|
|||||||
{
|
{
|
||||||
if (ctx.Context.Request.Path.StartsWithSegments("/documents"))
|
if (ctx.Context.Request.Path.StartsWithSegments("/documents"))
|
||||||
{
|
{
|
||||||
ctx.Context.Response.Headers.Add("Cache-Control", "no-store");
|
ctx.Context.Response.Headers.Append("Cache-Control", "no-store");
|
||||||
if (!ctx.Context.User.Identity.IsAuthenticated)
|
if (!ctx.Context.User.Identity.IsAuthenticated)
|
||||||
{
|
{
|
||||||
ctx.Context.Response.Redirect("/Login");
|
ctx.Context.Response.Redirect("/Login");
|
||||||
@@ -156,7 +156,7 @@ app.UseStaticFiles(new StaticFileOptions
|
|||||||
{
|
{
|
||||||
if (ctx.Context.Request.Path.StartsWithSegments("/temp"))
|
if (ctx.Context.Request.Path.StartsWithSegments("/temp"))
|
||||||
{
|
{
|
||||||
ctx.Context.Response.Headers.Add("Cache-Control", "no-store");
|
ctx.Context.Response.Headers.Append("Cache-Control", "no-store");
|
||||||
if (!ctx.Context.User.Identity.IsAuthenticated)
|
if (!ctx.Context.User.Identity.IsAuthenticated)
|
||||||
{
|
{
|
||||||
ctx.Context.Response.Redirect("/Login");
|
ctx.Context.Response.Redirect("/Login");
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<div class="col-1">
|
<div class="col-1">
|
||||||
<span class="badge bg-success">GET</span>
|
<span class="badge bg-success">GET</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5 copyable">
|
<div class="col-5 copyable testable">
|
||||||
<code>/api/vehicles</code>
|
<code>/api/vehicles</code>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<div class="col-1">
|
<div class="col-1">
|
||||||
<span class="badge bg-success">GET</span>
|
<span class="badge bg-success">GET</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5 copyable">
|
<div class="col-5 copyable testable">
|
||||||
<code>/api/vehicle/info</code>
|
<code>/api/vehicle/info</code>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
@@ -578,6 +578,20 @@
|
|||||||
vehicleId - Id of Vehicle
|
vehicleId - Id of Vehicle
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row api-method">
|
||||||
|
<div class="col-1">
|
||||||
|
<span class="badge bg-success">GET</span>
|
||||||
|
</div>
|
||||||
|
<div class="col-5 copyable testable">
|
||||||
|
<code>/api/calendar</code>
|
||||||
|
</div>
|
||||||
|
<div class="col-3">
|
||||||
|
Returns reminder calendar in ICS format
|
||||||
|
</div>
|
||||||
|
<div class="col-3">
|
||||||
|
No Params
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row api-method">
|
<div class="row api-method">
|
||||||
<div class="col-1">
|
<div class="col-1">
|
||||||
<span class="badge bg-primary">POST</span>
|
<span class="badge bg-primary">POST</span>
|
||||||
@@ -600,7 +614,7 @@
|
|||||||
<div class="col-1">
|
<div class="col-1">
|
||||||
<span class="badge bg-success">GET</span>
|
<span class="badge bg-success">GET</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5 copyable">
|
<div class="col-5 copyable testable">
|
||||||
<code>/api/vehicle/reminders/send</code>
|
<code>/api/vehicle/reminders/send</code>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
@@ -608,14 +622,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
(must be root user)<br />
|
(must be root user)<br />
|
||||||
urgencies[]=[NotUrgent,Urgent,VeryUrgent,PastDue]
|
urgencies[]=[NotUrgent,Urgent,VeryUrgent,PastDue](optional)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row api-method">
|
<div class="row api-method">
|
||||||
<div class="col-1">
|
<div class="col-1">
|
||||||
<span class="badge bg-success">GET</span>
|
<span class="badge bg-success">GET</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5 copyable">
|
<div class="col-5 copyable testable">
|
||||||
<code>/api/makebackup</code>
|
<code>/api/makebackup</code>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
@@ -629,7 +643,7 @@
|
|||||||
<div class="col-1">
|
<div class="col-1">
|
||||||
<span class="badge bg-success">GET</span>
|
<span class="badge bg-success">GET</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5 copyable">
|
<div class="col-5 copyable testable">
|
||||||
<code>/api/cleanup</code>
|
<code>/api/cleanup</code>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
@@ -637,13 +651,20 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
(must be root user)<br />
|
(must be root user)<br />
|
||||||
deepClean(bool) - Perform deep clean
|
deepClean(bool) - Perform deep clean(optional)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<script>
|
<script>
|
||||||
$('.copyable').on('click', function (e) {
|
$('.copyable').on('click', function (e) {
|
||||||
copyToClipboard(e.currentTarget);
|
if (e.ctrlKey || e.metaKey){
|
||||||
|
let targetElement = $(e.currentTarget);
|
||||||
|
if (targetElement.hasClass("testable")){
|
||||||
|
window.location = targetElement.text().trim();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
copyToClipboard(e.currentTarget);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
function showExtraFieldsInfo(){
|
function showExtraFieldsInfo(){
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
|
|||||||
@@ -146,6 +146,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="stickerPrintContainer hideOnPrint">
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
loadGarage();
|
loadGarage();
|
||||||
bindWindowResize();
|
bindWindowResize();
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
@inject ITranslationHelper translator
|
@inject ITranslationHelper translator
|
||||||
@{
|
@{
|
||||||
var userLanguage = config.GetServerLanguage();
|
var userLanguage = config.GetServerLanguage();
|
||||||
|
var openRegistrationEnabled = config.GetServerOpenRegistration();
|
||||||
}
|
}
|
||||||
@model string
|
@model string
|
||||||
@{
|
@{
|
||||||
@@ -17,7 +18,19 @@
|
|||||||
<img src="@config.GetLogoUrl()" class="lubelogger-logo" />
|
<img src="@config.GetLogoUrl()" class="lubelogger-logo" />
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="inputToken">@translator.Translate(userLanguage, "Token")</label>
|
<label for="inputToken">@translator.Translate(userLanguage, "Token")</label>
|
||||||
<input type="text" id="inputToken" class="form-control">
|
@if (openRegistrationEnabled)
|
||||||
|
{
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" id="inputToken" class="form-control">
|
||||||
|
<div class="input-group-text">
|
||||||
|
<button type="button" class="btn btn-sm text-secondary password-visible-button" onclick="sendOpenIdRegistrationToken()"><i class="bi bi-send"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<input type="text" id="inputToken" class="form-control">
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="inputUserName">@translator.Translate(userLanguage, "Username")</label>
|
<label for="inputUserName">@translator.Translate(userLanguage, "Username")</label>
|
||||||
@@ -46,4 +59,14 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function sendOpenIdRegistrationToken(){
|
||||||
|
var userEmail = decodeHTMLEntities('@Model');
|
||||||
|
$.post('/Login/SendRegistrationToken', { emailAddress: userEmail }, function (data) {
|
||||||
|
if (data.success) {
|
||||||
|
successToast(data.message);
|
||||||
|
} else {
|
||||||
|
errorToast(data.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
@inject ITranslationHelper translator
|
@inject ITranslationHelper translator
|
||||||
@{
|
@{
|
||||||
var userLanguage = config.GetServerLanguage();
|
var userLanguage = config.GetServerLanguage();
|
||||||
|
var openRegistrationEnabled = config.GetServerOpenRegistration();
|
||||||
}
|
}
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Register";
|
ViewData["Title"] = "Register";
|
||||||
@@ -16,10 +17,19 @@
|
|||||||
<img src="@config.GetLogoUrl()" class="lubelogger-logo" />
|
<img src="@config.GetLogoUrl()" class="lubelogger-logo" />
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="inputToken">@translator.Translate(userLanguage, "Token")</label>
|
<label for="inputToken">@translator.Translate(userLanguage, "Token")</label>
|
||||||
<input type="text" id="inputToken" class="form-control">
|
@if (openRegistrationEnabled) {
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" id="inputToken" class="form-control">
|
||||||
|
<div class="input-group-text">
|
||||||
|
<button type="button" class="btn btn-sm text-secondary password-visible-button" onclick="sendRegistrationToken()"><i class="bi bi-send"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
} else {
|
||||||
|
<input type="text" id="inputToken" class="form-control">
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="inputUserName">@translator.Translate(userLanguage, "Email Address")</label>
|
<label for="inputEmail">@translator.Translate(userLanguage, "Email Address")</label>
|
||||||
<input type="text" id="inputEmail" class="form-control">
|
<input type="text" id="inputEmail" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -158,6 +158,8 @@
|
|||||||
<div class="modal-content" id="inputSuppliesModalContent"></div>
|
<div class="modal-content" id="inputSuppliesModalContent"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="stickerPrintContainer hideOnPrint">
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
function GetVehicleId() {
|
function GetVehicleId() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
9
Views/Vehicle/_AttachmentColumn.cshtml
Normal file
9
Views/Vehicle/_AttachmentColumn.cshtml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
@model List<UploadedFiles>
|
||||||
|
@if (Model.Any()){
|
||||||
|
<span class="position-relative">
|
||||||
|
<i class="bi bi-paperclip"></i>
|
||||||
|
<span class="position-absolute attachment-badge-xs start-100 translate-middle badge rounded-pill bg-secondary">
|
||||||
|
@Model.Count()
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
}
|
||||||
@@ -78,6 +78,12 @@
|
|||||||
<label class="form-check-label stretched-link" for="chkCol_Cost">@translator.Translate(userLanguage, "Cost")</label>
|
<label class="form-check-label stretched-link" for="chkCol_Cost">@translator.Translate(userLanguage, "Cost")</label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="dropdown-item">
|
||||||
|
<div class="list-group-item">
|
||||||
|
<input class="form-check-input col-visible-toggle" data-column-toggle='attachments' onChange="showTableColumns(this, 'RepairRecord')" type="checkbox" id="chkCol_Attachment">
|
||||||
|
<label class="form-check-label stretched-link" for="chkCol_Attachment">@translator.Translate(userLanguage, "Attachments")</label>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
<li class="dropdown-item">
|
<li class="dropdown-item">
|
||||||
<div class="list-group-item">
|
<div class="list-group-item">
|
||||||
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'RepairRecord')" type="checkbox" id="chkCol_Notes" checked>
|
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'RepairRecord')" type="checkbox" id="chkCol_Notes" checked>
|
||||||
@@ -118,6 +124,7 @@
|
|||||||
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@translator.Translate(userLanguage, "Odometer")</th>
|
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@translator.Translate(userLanguage, "Odometer")</th>
|
||||||
<th scope="col" class="col-3 col-xl-4 flex-grow-1 flex-shrink-1 text-truncate" data-column="description">@translator.Translate(userLanguage, "Description")</th>
|
<th scope="col" class="col-3 col-xl-4 flex-grow-1 flex-shrink-1 text-truncate" data-column="description">@translator.Translate(userLanguage, "Description")</th>
|
||||||
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" onclick="toggleSort('accident-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Cost")</th>
|
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" onclick="toggleSort('accident-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Cost")</th>
|
||||||
|
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@translator.Translate(userLanguage, "Attachments")</th>
|
||||||
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -133,6 +140,7 @@
|
|||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@(collisionRecord.Mileage == default ? "---" : collisionRecord.Mileage.ToString())</td>
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@(collisionRecord.Mileage == default ? "---" : collisionRecord.Mileage.ToString())</td>
|
||||||
<td class="col-3 col-xl-4 flex-grow-1 flex-shrink-1 text-truncate" data-column="description">@collisionRecord.Description</td>
|
<td class="col-3 col-xl-4 flex-grow-1 flex-shrink-1 text-truncate" data-column="description">@collisionRecord.Description</td>
|
||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" data-record-type="cost">@(StaticHelper.HideZeroCost(collisionRecord.Cost, hideZero))</td>
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" data-record-type="cost">@(StaticHelper.HideZeroCost(collisionRecord.Cost, hideZero))</td>
|
||||||
|
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@await Html.PartialAsync("_AttachmentColumn", collisionRecord.Files)</td>
|
||||||
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@StaticHelper.TruncateStrings(collisionRecord.Notes)</td>
|
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@StaticHelper.TruncateStrings(collisionRecord.Notes)</td>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -185,6 +193,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="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><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><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><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><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>
|
<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>
|
||||||
|
|||||||
@@ -49,10 +49,10 @@
|
|||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate d-none" report-data="costperdistance">@($"{StaticHelper.HideZeroCost(0M.ToString("C2"), hideZero, $"/{Model.DistanceUnit}")}")</td>
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate d-none" report-data="costperdistance">@($"{StaticHelper.HideZeroCost(0M.ToString("C2"), hideZero, $"/{Model.DistanceUnit}")}")</td>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</tr>
|
}
|
||||||
}
|
</tr>
|
||||||
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr class="d-flex fw-bold">
|
<tr class="d-flex fw-bold">
|
||||||
@@ -65,9 +65,11 @@
|
|||||||
var yearDataToDisplay = Model.CostData.Where(x => x.Year == year);
|
var yearDataToDisplay = Model.CostData.Where(x => x.Year == year);
|
||||||
if (yearDataToDisplay != null && yearDataToDisplay != default)
|
if (yearDataToDisplay != null && yearDataToDisplay != default)
|
||||||
{
|
{
|
||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" report-data="cost">@(StaticHelper.HideZeroCost(yearDataToDisplay.Sum(x => x.Cost).ToString("C2"), hideZero))</td>
|
var distanceTraveled = yearDataToDisplay.Sum(x => x.DistanceTraveled);
|
||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate d-none" report-data="distance">@(yearDataToDisplay.Sum(x => x.DistanceTraveled) != default ? $"{yearDataToDisplay.Sum(x => x.DistanceTraveled).ToString("N0")} {Model.DistanceUnit}" : "---")</td>
|
var costAccrued = yearDataToDisplay.Sum(x => x.Cost);
|
||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate d-none" report-data="costperdistance">@(StaticHelper.HideZeroCost(yearDataToDisplay.Sum(x => x.CostPerDistanceTraveled).ToString("C2"), hideZero, $"/{Model.DistanceUnit}"))</td>
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" report-data="cost">@(StaticHelper.HideZeroCost(costAccrued.ToString("C2"), hideZero))</td>
|
||||||
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate d-none" report-data="distance">@(distanceTraveled != default ? $"{distanceTraveled.ToString("N0")} {Model.DistanceUnit}" : "---")</td>
|
||||||
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate d-none" report-data="costperdistance">@(StaticHelper.HideZeroCost(distanceTraveled != default && costAccrued != default ? (costAccrued / distanceTraveled).ToString("C2") : 0M.ToString("C2"), hideZero, $"/{Model.DistanceUnit}"))</td>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,8 +21,8 @@
|
|||||||
<thead class="sticky-top">
|
<thead class="sticky-top">
|
||||||
<tr class="d-flex">
|
<tr class="d-flex">
|
||||||
<th scope="col" class="col-3 flex-grow-1">@translator.Translate(userLanguage, "Type")</th>
|
<th scope="col" class="col-3 flex-grow-1">@translator.Translate(userLanguage, "Type")</th>
|
||||||
<th scope="col" class="col-3 flex-grow-1">@translator.Translate(userLanguage, "Cost Per Day")</th>
|
<th scope="col" style="cursor:pointer;" onclick="toggleCostTableHint()" class="col-3 flex-grow-1">@translator.Translate(userLanguage, "Cost Per Day")<span class="cost-table-hint d-none">@($"({Model.NumberOfDays.ToString("N0")})")</span></th>
|
||||||
<th scope="col" class="col-3 flex-grow-1">@translator.Translate(userLanguage, Model.DistanceUnit)</th>
|
<th scope="col" style="cursor:pointer;" onclick="toggleCostTableHint()" class="col-3 flex-grow-1">@translator.Translate(userLanguage, Model.DistanceUnit)<span class="cost-table-hint d-none">@($"({Model.TotalDistance.ToString("N0")})")</span></th>
|
||||||
<th scope="col" class="col-3 flex-grow-1">@translator.Translate(userLanguage, "Total")</th>
|
<th scope="col" class="col-3 flex-grow-1">@translator.Translate(userLanguage, "Total")</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|||||||
@@ -146,6 +146,12 @@
|
|||||||
<label class="form-check-label stretched-link" for="chkCol_UnitCost">@translator.Translate(userLanguage, "Unit Cost")</label>
|
<label class="form-check-label stretched-link" for="chkCol_UnitCost">@translator.Translate(userLanguage, "Unit Cost")</label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="dropdown-item">
|
||||||
|
<div class="list-group-item">
|
||||||
|
<input class="form-check-input col-visible-toggle" data-column-toggle='attachments' onChange="showTableColumns(this, 'GasRecord')" type="checkbox" id="chkCol_Attachment">
|
||||||
|
<label class="form-check-label stretched-link" for="chkCol_Attachment">@translator.Translate(userLanguage, "Attachments")</label>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
<li class="dropdown-item">
|
<li class="dropdown-item">
|
||||||
<div class="list-group-item">
|
<div class="list-group-item">
|
||||||
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'GasRecord')" type="checkbox" id="chkCol_Notes">
|
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'GasRecord')" type="checkbox" id="chkCol_Notes">
|
||||||
@@ -188,6 +194,7 @@
|
|||||||
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="fueleconomy" data-gas="fueleconomy" data-unit="@fuelEconomyUnit" onclick="toggleSort('gas-tab-pane', this)" oncontextmenu="toggleUnits(this)" style="cursor:pointer;">@($"{@translator.Translate(userLanguage, "Fuel Economy")}({fuelEconomyUnit})")</th>
|
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="fueleconomy" data-gas="fueleconomy" data-unit="@fuelEconomyUnit" onclick="toggleSort('gas-tab-pane', this)" oncontextmenu="toggleUnits(this)" style="cursor:pointer;">@($"{@translator.Translate(userLanguage, "Fuel Economy")}({fuelEconomyUnit})")</th>
|
||||||
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" onclick="toggleSort('gas-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Cost")</th>
|
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" onclick="toggleSort('gas-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Cost")</th>
|
||||||
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="unitcost" onclick="toggleSort('gas-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Unit Cost")</th>
|
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="unitcost" onclick="toggleSort('gas-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Unit Cost")</th>
|
||||||
|
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@translator.Translate(userLanguage, "Attachments")</th>
|
||||||
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -206,6 +213,7 @@
|
|||||||
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="fueleconomy" data-gas-type="fueleconomy" data-aggregated='@(gasRecord.IncludeInAverage.ToString().ToLower())'>@(gasRecord.MilesPerGallon == 0 ? "---" : gasRecord.MilesPerGallon.ToString("F"))</td>
|
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="fueleconomy" data-gas-type="fueleconomy" data-aggregated='@(gasRecord.IncludeInAverage.ToString().ToLower())'>@(gasRecord.MilesPerGallon == 0 ? "---" : gasRecord.MilesPerGallon.ToString("F"))</td>
|
||||||
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" data-record-type="cost">@((hideZero && gasRecord.Cost == default) ? "---" : gasRecord.Cost.ToString(gasCostFormat))</td>
|
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" data-record-type="cost">@((hideZero && gasRecord.Cost == default) ? "---" : gasRecord.Cost.ToString(gasCostFormat))</td>
|
||||||
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="unitcost" data-gas-type="unitcost">@((hideZero && gasRecord.CostPerGallon == default) ? "---" : gasRecord.CostPerGallon.ToString(gasCostFormat))</td>
|
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="unitcost" data-gas-type="unitcost">@((hideZero && gasRecord.CostPerGallon == default) ? "---" : gasRecord.CostPerGallon.ToString(gasCostFormat))</td>
|
||||||
|
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@await Html.PartialAsync("_AttachmentColumn", gasRecord.Files)</td>
|
||||||
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="notes">@StaticHelper.TruncateStrings(gasRecord.Notes)</td>
|
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="notes">@StaticHelper.TruncateStrings(gasRecord.Notes)</td>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -254,6 +262,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="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><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><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><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><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>
|
<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><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="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><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>
|
<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>
|
</ul>
|
||||||
@@ -78,6 +78,12 @@
|
|||||||
<label class="form-check-label stretched-link" for="chkCol_Distance">@translator.Translate(userLanguage, "Distance")</label>
|
<label class="form-check-label stretched-link" for="chkCol_Distance">@translator.Translate(userLanguage, "Distance")</label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="dropdown-item">
|
||||||
|
<div class="list-group-item">
|
||||||
|
<input class="form-check-input col-visible-toggle" data-column-toggle='attachments' onChange="showTableColumns(this, 'OdometerRecord')" type="checkbox" id="chkCol_Attachment">
|
||||||
|
<label class="form-check-label stretched-link" for="chkCol_Attachment">@translator.Translate(userLanguage, "Attachments")</label>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
<li class="dropdown-item">
|
<li class="dropdown-item">
|
||||||
<div class="list-group-item">
|
<div class="list-group-item">
|
||||||
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'OdometerRecord')" type="checkbox" id="chkCol_Notes" checked>
|
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'OdometerRecord')" type="checkbox" id="chkCol_Notes" checked>
|
||||||
@@ -118,6 +124,7 @@
|
|||||||
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="initialodometer">@translator.Translate(userLanguage, "Initial Odometer")</th>
|
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="initialodometer">@translator.Translate(userLanguage, "Initial Odometer")</th>
|
||||||
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@translator.Translate(userLanguage, "Odometer")</th>
|
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@translator.Translate(userLanguage, "Odometer")</th>
|
||||||
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="distance" onclick="toggleSort('odometer-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Distance")</th>
|
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="distance" onclick="toggleSort('odometer-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Distance")</th>
|
||||||
|
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@translator.Translate(userLanguage, "Attachments")</th>
|
||||||
<th scope="col" class="col-2 col-xl-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
<th scope="col" class="col-2 col-xl-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -131,8 +138,9 @@
|
|||||||
<tr class="d-flex user-select-none" style="cursor:pointer;" onmouseup="stopEvent()" ontouchstart="detectRowLongTouch(this)" ontouchend="detectRowTouchEndPremature(this)" data-rowId="@odometerRecord.Id" oncontextmenu="showTableContextMenu(this)" onmousemove="rangeMouseMove(this)" onclick="handleTableRowClick(this, showEditOdometerRecordModal,@odometerRecord.Id)" data-tags='@string.Join(" ", odometerRecord.Tags)'>
|
<tr class="d-flex user-select-none" style="cursor:pointer;" onmouseup="stopEvent()" ontouchstart="detectRowLongTouch(this)" ontouchend="detectRowTouchEndPremature(this)" data-rowId="@odometerRecord.Id" oncontextmenu="showTableContextMenu(this)" onmousemove="rangeMouseMove(this)" onclick="handleTableRowClick(this, showEditOdometerRecordModal,@odometerRecord.Id)" data-tags='@string.Join(" ", odometerRecord.Tags)'>
|
||||||
<td class="col-2 col-xl-1 flex-grow-1 text-truncate" data-column="date">@odometerRecord.Date.ToShortDateString()</td>
|
<td class="col-2 col-xl-1 flex-grow-1 text-truncate" data-column="date">@odometerRecord.Date.ToShortDateString()</td>
|
||||||
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="initialodometer">@odometerRecord.InitialMileage</td>
|
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="initialodometer">@odometerRecord.InitialMileage</td>
|
||||||
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@odometerRecord.Mileage</td>
|
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer" data-record-type="cost">@odometerRecord.Mileage</td>
|
||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="distance" data-record-type="distance">@(odometerRecord.DistanceTraveled == default ? "---" : odometerRecord.DistanceTraveled)</td>
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="distance" data-record-type="distance">@(odometerRecord.DistanceTraveled == default ? "---" : odometerRecord.DistanceTraveled)</td>
|
||||||
|
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@await Html.PartialAsync("_AttachmentColumn", odometerRecord.Files)</td>
|
||||||
<td class="col-2 col-xl-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@StaticHelper.TruncateStrings(odometerRecord.Notes, 75)</td>
|
<td class="col-2 col-xl-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@StaticHelper.TruncateStrings(odometerRecord.Notes, 75)</td>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -181,6 +189,9 @@
|
|||||||
<li><hr class="context-menu-multiple dropdown-divider"></li>
|
<li><hr class="context-menu-multiple dropdown-divider"></li>
|
||||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecords(selectedRow, 'OdometerRecord')"><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="duplicateRecords(selectedRow, 'OdometerRecord')"><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, 'OdometerRecord')"><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="duplicateRecordsToOtherVehicles(selectedRow, 'OdometerRecord')"><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, 'OdometerRecord')"><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, 'OdometerRecord')"><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><a class="dropdown-item text-danger" href="#" onclick="deleteRecords(selectedRow, 'OdometerRecord')"><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><hr class="context-menu-odometer-adjustment dropdown-divider"></li>
|
||||||
<li><a class="context-menu-odometer-adjustment dropdown-item" href="#" onclick="adjustRecordsOdometer(selectedRow, 'OdometerRecord')"><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>
|
<li><a class="context-menu-odometer-adjustment dropdown-item" href="#" onclick="adjustRecordsOdometer(selectedRow, 'OdometerRecord')"><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>
|
||||||
|
|||||||
@@ -127,5 +127,8 @@
|
|||||||
<li><hr class="context-menu-move move-header dropdown-divider"></li>
|
<li><hr class="context-menu-move move-header dropdown-divider"></li>
|
||||||
<li><a class="dropdown-item context-menu-move move-header context-menu-duplicate" href="#"><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 context-menu-move move-header context-menu-duplicate" href="#"><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 context-menu-move move-header context-menu-duplicate-vehicle" href="#"><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 context-menu-move move-header context-menu-duplicate-vehicle" href="#"><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="context-menu-move move-header dropdown-divider"></li>
|
||||||
|
<li><a class="dropdown-item context-menu-move move-header context-menu-print-tab-sticker" href="#"><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="context-menu-move move-header dropdown-divider"></li>
|
||||||
<li><a class="dropdown-item context-menu-move move-header text-danger context-menu-delete" href="#"><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><a class="dropdown-item context-menu-move move-header text-danger context-menu-delete" href="#"><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>
|
</ul>
|
||||||
@@ -82,9 +82,9 @@
|
|||||||
<!option value="OneHundredThousandMiles" @(Model.ReminderMileageInterval == ReminderMileageInterval.OneHundredThousandMiles ? "selected" : "")>100000 mi. / Km</!option>
|
<!option value="OneHundredThousandMiles" @(Model.ReminderMileageInterval == ReminderMileageInterval.OneHundredThousandMiles ? "selected" : "")>100000 mi. / Km</!option>
|
||||||
<!option value="OneHundredFiftyThousandMiles" @(Model.ReminderMileageInterval == ReminderMileageInterval.OneHundredFiftyThousandMiles ? "selected" : "")>150000 mi. / Km</!option>
|
<!option value="OneHundredFiftyThousandMiles" @(Model.ReminderMileageInterval == ReminderMileageInterval.OneHundredFiftyThousandMiles ? "selected" : "")>150000 mi. / Km</!option>
|
||||||
</select>
|
</select>
|
||||||
<label for="reminderRecurringMonth">@translator.Translate(userLanguage, "Month")</label>
|
<label for="reminderRecurringMonth">@translator.Translate(userLanguage, "Time")</label>
|
||||||
<select class="form-select" onchange="checkCustomMonthInterval()" id="reminderRecurringMonth" @(Model.IsRecurring && (Model.Metric == ReminderMetric.Date || Model.Metric == ReminderMetric.Both) ? "" : "disabled")>
|
<select class="form-select" onchange="checkCustomMonthInterval()" id="reminderRecurringMonth" @(Model.IsRecurring && (Model.Metric == ReminderMetric.Date || Model.Metric == ReminderMetric.Both) ? "" : "disabled")>
|
||||||
<!option value="Other" @(Model.ReminderMonthInterval == ReminderMonthInterval.Other ? "selected" : "")>@(Model.ReminderMonthInterval == ReminderMonthInterval.Other && Model.CustomMonthInterval > 0 ? $"{translator.Translate(userLanguage, "Other")}: {Model.CustomMonthInterval}" : $"{translator.Translate(userLanguage, "Other")}") </!option>
|
<!option value="Other" @(Model.ReminderMonthInterval == ReminderMonthInterval.Other ? "selected" : "")>@(Model.ReminderMonthInterval == ReminderMonthInterval.Other && Model.CustomMonthInterval > 0 ? $"{translator.Translate(userLanguage, "Other")}: {Model.CustomMonthInterval} {Model.CustomMonthIntervalUnit}" : $"{translator.Translate(userLanguage, "Other")}") </!option>
|
||||||
<!option value="OneMonth" @(Model.ReminderMonthInterval == ReminderMonthInterval.OneMonth ? "selected" : "")>@translator.Translate(userLanguage, "1 Month")</!option>
|
<!option value="OneMonth" @(Model.ReminderMonthInterval == ReminderMonthInterval.OneMonth ? "selected" : "")>@translator.Translate(userLanguage, "1 Month")</!option>
|
||||||
<!option value="ThreeMonths" @(Model.ReminderMonthInterval == ReminderMonthInterval.ThreeMonths || isNew ? "selected" : "")>@translator.Translate(userLanguage,"3 Months")</!option>
|
<!option value="ThreeMonths" @(Model.ReminderMonthInterval == ReminderMonthInterval.ThreeMonths || isNew ? "selected" : "")>@translator.Translate(userLanguage,"3 Months")</!option>
|
||||||
<!option value="SixMonths" @(Model.ReminderMonthInterval == ReminderMonthInterval.SixMonths ? "selected" : "")>@translator.Translate(userLanguage,"6 Months")</!option>
|
<!option value="SixMonths" @(Model.ReminderMonthInterval == ReminderMonthInterval.SixMonths ? "selected" : "")>@translator.Translate(userLanguage,"6 Months")</!option>
|
||||||
@@ -136,6 +136,7 @@
|
|||||||
<script>
|
<script>
|
||||||
var customMileageInterval = @Model.CustomMileageInterval;
|
var customMileageInterval = @Model.CustomMileageInterval;
|
||||||
var customMonthInterval = @Model.CustomMonthInterval;
|
var customMonthInterval = @Model.CustomMonthInterval;
|
||||||
|
var customMonthIntervalUnit = decodeHTMLEntities('@Model.CustomMonthIntervalUnit');
|
||||||
function getReminderRecordModelData() {
|
function getReminderRecordModelData() {
|
||||||
return { id: @Model.Id, mileageInterval: decodeHTMLEntities('@Model.ReminderMileageInterval.ToString()'), monthInterval: decodeHTMLEntities('@Model.ReminderMonthInterval.ToString()')}
|
return { id: @Model.Id, mileageInterval: decodeHTMLEntities('@Model.ReminderMileageInterval.ToString()'), monthInterval: decodeHTMLEntities('@Model.ReminderMonthInterval.ToString()')}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
<span class="badge text-bg-success">@translator.Translate(userLanguage, "Not Urgent")</span>
|
<span class="badge text-bg-success">@translator.Translate(userLanguage, "Not Urgent")</span>
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
<td class="col-2 text-truncate flex-grow-1 flex-shrink-1" data-column="metric">
|
<td class="col-2 text-truncate flex-grow-1 flex-shrink-1" data-column="metric" data-record-type="cost">
|
||||||
@if (reminderRecord.Metric == ReminderMetric.Date)
|
@if (reminderRecord.Metric == ReminderMetric.Date)
|
||||||
{
|
{
|
||||||
@reminderRecord.Date.ToShortDateString()
|
@reminderRecord.Date.ToShortDateString()
|
||||||
@@ -200,6 +200,9 @@
|
|||||||
<li><hr class="context-menu-multiple dropdown-divider"></li>
|
<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="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><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>
|
<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>
|
</ul>
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<div id="vehicleHistoryReport" class="showOnPrint"></div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
getSelectedMetrics();
|
getSelectedMetrics();
|
||||||
|
|||||||
@@ -78,6 +78,12 @@
|
|||||||
<label class="form-check-label stretched-link" for="chkCol_Cost">@translator.Translate(userLanguage, "Cost")</label>
|
<label class="form-check-label stretched-link" for="chkCol_Cost">@translator.Translate(userLanguage, "Cost")</label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="dropdown-item">
|
||||||
|
<div class="list-group-item">
|
||||||
|
<input class="form-check-input col-visible-toggle" data-column-toggle='attachments' onChange="showTableColumns(this, 'ServiceRecord')" type="checkbox" id="chkCol_Attachment">
|
||||||
|
<label class="form-check-label stretched-link" for="chkCol_Attachment">@translator.Translate(userLanguage, "Attachments")</label>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
<li class="dropdown-item">
|
<li class="dropdown-item">
|
||||||
<div class="list-group-item">
|
<div class="list-group-item">
|
||||||
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'ServiceRecord')" type="checkbox" id="chkCol_Notes" checked>
|
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'ServiceRecord')" type="checkbox" id="chkCol_Notes" checked>
|
||||||
@@ -118,6 +124,7 @@
|
|||||||
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@translator.Translate(userLanguage, "Odometer")</th>
|
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@translator.Translate(userLanguage, "Odometer")</th>
|
||||||
<th scope="col" class="col-3 col-xl-4 flex-grow-1 flex-shrink-1 text-truncate" data-column="description">@translator.Translate(userLanguage, "Description")</th>
|
<th scope="col" class="col-3 col-xl-4 flex-grow-1 flex-shrink-1 text-truncate" data-column="description">@translator.Translate(userLanguage, "Description")</th>
|
||||||
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" onclick="toggleSort('servicerecord-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Cost")</th>
|
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" onclick="toggleSort('servicerecord-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Cost")</th>
|
||||||
|
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@translator.Translate(userLanguage, "Attachments")</th>
|
||||||
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -133,6 +140,7 @@
|
|||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@(serviceRecord.Mileage == default ? "---" : serviceRecord.Mileage.ToString())</td>
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@(serviceRecord.Mileage == default ? "---" : serviceRecord.Mileage.ToString())</td>
|
||||||
<td class="col-3 col-xl-4 flex-grow-1 flex-shrink-1 text-truncate" data-column="description">@serviceRecord.Description</td>
|
<td class="col-3 col-xl-4 flex-grow-1 flex-shrink-1 text-truncate" data-column="description">@serviceRecord.Description</td>
|
||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" data-record-type="cost">@(StaticHelper.HideZeroCost(serviceRecord.Cost, hideZero))</td>
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" data-record-type="cost">@(StaticHelper.HideZeroCost(serviceRecord.Cost, hideZero))</td>
|
||||||
|
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@await Html.PartialAsync("_AttachmentColumn", serviceRecord.Files)</td>
|
||||||
<td class="col-3 text-truncate flex-grow-1 flex-shrink-1" data-column="notes">@StaticHelper.TruncateStrings(serviceRecord.Notes)</td>
|
<td class="col-3 text-truncate flex-grow-1 flex-shrink-1" data-column="notes">@StaticHelper.TruncateStrings(serviceRecord.Notes)</td>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -183,6 +191,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="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><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><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><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><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>
|
<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>
|
||||||
|
|||||||
277
Views/Vehicle/_Stickers.cshtml
Normal file
277
Views/Vehicle/_Stickers.cshtml
Normal file
@@ -0,0 +1,277 @@
|
|||||||
|
@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:
|
||||||
|
case ImportMode.PlanRecord:
|
||||||
|
<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;
|
||||||
|
case ImportMode.OdometerRecord:
|
||||||
|
<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>
|
||||||
|
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>
|
||||||
|
} else if (Model.SupplyRecords.Any()){
|
||||||
|
@foreach (SupplyRecord supplyRecord in Model.SupplyRecords)
|
||||||
|
{
|
||||||
|
<div class="d-flex flex-column recordSticker">
|
||||||
|
<div class="d-flex">
|
||||||
|
<img src="@config.GetLogoUrl()" class="lubelogger-logo" />
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
|
<div class="row">
|
||||||
|
@if(Model.VehicleData.Id != default){
|
||||||
|
<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">
|
||||||
|
<li class="list-group-item">
|
||||||
|
@($"{translator.Translate(userLanguage, "Description")}: {supplyRecord.Description}")
|
||||||
|
</li>
|
||||||
|
@if(!string.IsNullOrWhiteSpace(supplyRecord.PartNumber)){
|
||||||
|
<li class="list-group-item">
|
||||||
|
@($"{translator.Translate(userLanguage, "Part Number")}: {supplyRecord.PartNumber}")
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
<li class="list-group-item">
|
||||||
|
@($"{translator.Translate(userLanguage, "Supplier/Vendor")}: {supplyRecord.PartSupplier}")
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
@($"{translator.Translate(userLanguage, "Cost")}: {supplyRecord.Cost.ToString("C")}")
|
||||||
|
</li>
|
||||||
|
@foreach (ExtraField extraField in supplyRecord.ExtraFields)
|
||||||
|
{
|
||||||
|
<li class="list-group-item">
|
||||||
|
@($"{extraField.Name}: {extraField.Value}")
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
} else {
|
||||||
|
<div class="col-6">
|
||||||
|
<ul class="list-group">
|
||||||
|
<li class="list-group-item">
|
||||||
|
@($"{translator.Translate(userLanguage, "Description")}: {supplyRecord.Description}")
|
||||||
|
</li>
|
||||||
|
@if (!string.IsNullOrWhiteSpace(supplyRecord.PartNumber))
|
||||||
|
{
|
||||||
|
<li class="list-group-item">
|
||||||
|
@($"{translator.Translate(userLanguage, "Part Number")}: {supplyRecord.PartNumber}")
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
<li class="list-group-item">
|
||||||
|
@($"{translator.Translate(userLanguage, "Supplier/Vendor")}: {supplyRecord.PartSupplier}")
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
@($"{translator.Translate(userLanguage, "Cost")}: {supplyRecord.Cost.ToString("C")}")
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<ul class="list-group">
|
||||||
|
@foreach (ExtraField extraField in supplyRecord.ExtraFields)
|
||||||
|
{
|
||||||
|
<li class="list-group-item">
|
||||||
|
@($"{extraField.Name}: {extraField.Value}")
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</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">
|
||||||
|
@(supplyRecord.Notes)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
<script>setMarkDownStickerNotes()</script>
|
||||||
|
}
|
||||||
@@ -90,6 +90,12 @@
|
|||||||
<label class="form-check-label stretched-link" for="chkCol_Cost">@translator.Translate(userLanguage, "Cost")</label>
|
<label class="form-check-label stretched-link" for="chkCol_Cost">@translator.Translate(userLanguage, "Cost")</label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="dropdown-item">
|
||||||
|
<div class="list-group-item">
|
||||||
|
<input class="form-check-input col-visible-toggle" data-column-toggle='attachments' onChange="showTableColumns(this, 'SupplyRecord')" type="checkbox" id="chkCol_Attachment">
|
||||||
|
<label class="form-check-label stretched-link" for="chkCol_Attachment">@translator.Translate(userLanguage, "Attachments")</label>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
<li class="dropdown-item">
|
<li class="dropdown-item">
|
||||||
<div class="list-group-item">
|
<div class="list-group-item">
|
||||||
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'SupplyRecord')" type="checkbox" id="chkCol_Notes" checked>
|
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'SupplyRecord')" type="checkbox" id="chkCol_Notes" checked>
|
||||||
@@ -132,6 +138,7 @@
|
|||||||
<th scope="col" class="col-2 flex-grow-1 col-xl-3 text-truncate" data-column="description">@translator.Translate(userLanguage, "Description")</th>
|
<th scope="col" class="col-2 flex-grow-1 col-xl-3 text-truncate" data-column="description">@translator.Translate(userLanguage, "Description")</th>
|
||||||
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="quantity" onclick="toggleSort('supply-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Quantity")</th>
|
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="quantity" onclick="toggleSort('supply-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Quantity")</th>
|
||||||
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" onclick="toggleSort('supply-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Cost")</th>
|
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" onclick="toggleSort('supply-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Cost")</th>
|
||||||
|
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@translator.Translate(userLanguage, "Attachments")</th>
|
||||||
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -149,6 +156,7 @@
|
|||||||
<td class="col-2 flex-grow-1 col-xl-3 text-truncate" data-column="description">@supplyRecord.Description</td>
|
<td class="col-2 flex-grow-1 col-xl-3 text-truncate" data-column="description">@supplyRecord.Description</td>
|
||||||
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="quantity">@supplyRecord.Quantity</td>
|
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="quantity">@supplyRecord.Quantity</td>
|
||||||
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" data-record-type="cost">@(StaticHelper.HideZeroCost(supplyRecord.Cost, hideZero))</td>
|
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" data-record-type="cost">@(StaticHelper.HideZeroCost(supplyRecord.Cost, hideZero))</td>
|
||||||
|
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@await Html.PartialAsync("_AttachmentColumn", supplyRecord.Files)</td>
|
||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@StaticHelper.TruncateStrings(supplyRecord.Notes)</td>
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@StaticHelper.TruncateStrings(supplyRecord.Notes)</td>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -194,6 +202,9 @@
|
|||||||
<li><hr class="context-menu-multiple dropdown-divider"></li>
|
<li><hr class="context-menu-multiple dropdown-divider"></li>
|
||||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecords(selectedRow, 'SupplyRecord')"><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="duplicateRecords(selectedRow, 'SupplyRecord')"><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, 'SupplyRecord')"><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="duplicateRecordsToOtherVehicles(selectedRow, 'SupplyRecord')"><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, 'SupplyRecord')"><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, 'SupplyRecord')"><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><a class="dropdown-item text-danger" href="#" onclick="deleteRecords(selectedRow, 'SupplyRecord')"><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>
|
</ul>
|
||||||
@if (userColumnPreferences.Any())
|
@if (userColumnPreferences.Any())
|
||||||
|
|||||||
@@ -57,9 +57,9 @@
|
|||||||
<input class="form-check-input" type="checkbox" onChange="enableTaxRecurring()" role="switch" id="taxIsRecurring" checked="@Model.IsRecurring">
|
<input class="form-check-input" type="checkbox" onChange="enableTaxRecurring()" role="switch" id="taxIsRecurring" checked="@Model.IsRecurring">
|
||||||
<label class="form-check-label" for="taxIsRecurring">@translator.Translate(userLanguage,"Is Recurring")</label>
|
<label class="form-check-label" for="taxIsRecurring">@translator.Translate(userLanguage,"Is Recurring")</label>
|
||||||
</div>
|
</div>
|
||||||
<label for="taxRecurringMonth">@translator.Translate(userLanguage,"Month")</label>
|
<label for="taxRecurringMonth">@translator.Translate(userLanguage,"Time")</label>
|
||||||
<select class="form-select" onchange="checkCustomMonthIntervalForTax()" id="taxRecurringMonth" @(Model.IsRecurring ? "" : "disabled")>
|
<select class="form-select" onchange="checkCustomMonthIntervalForTax()" id="taxRecurringMonth" @(Model.IsRecurring ? "" : "disabled")>
|
||||||
<!option value="Other" @(Model.RecurringInterval == ReminderMonthInterval.Other ? "selected" : "")>@(Model.RecurringInterval == ReminderMonthInterval.Other && Model.CustomMonthInterval > 0 ? $"{translator.Translate(userLanguage, "Other")}: {Model.CustomMonthInterval}" : $"{translator.Translate(userLanguage, "Other")}") </!option>
|
<!option value="Other" @(Model.RecurringInterval == ReminderMonthInterval.Other ? "selected" : "")>@(Model.RecurringInterval == ReminderMonthInterval.Other && Model.CustomMonthInterval > 0 ? $"{translator.Translate(userLanguage, "Other")}: {Model.CustomMonthInterval} {Model.CustomMonthIntervalUnit}" : $"{translator.Translate(userLanguage, "Other")}") </!option>
|
||||||
<!option value="OneMonth" @(Model.RecurringInterval == ReminderMonthInterval.OneMonth ? "selected" : "")>@translator.Translate(userLanguage,"1 Month")</!option>
|
<!option value="OneMonth" @(Model.RecurringInterval == ReminderMonthInterval.OneMonth ? "selected" : "")>@translator.Translate(userLanguage,"1 Month")</!option>
|
||||||
<!option value="ThreeMonths" @(Model.RecurringInterval == ReminderMonthInterval.ThreeMonths || isNew ? "selected" : "")>@translator.Translate(userLanguage, "3 Months")</!option>
|
<!option value="ThreeMonths" @(Model.RecurringInterval == ReminderMonthInterval.ThreeMonths || isNew ? "selected" : "")>@translator.Translate(userLanguage, "3 Months")</!option>
|
||||||
<!option value="SixMonths" @(Model.RecurringInterval == ReminderMonthInterval.SixMonths ? "selected" : "")>@translator.Translate(userLanguage, "6 Months")</!option>
|
<!option value="SixMonths" @(Model.RecurringInterval == ReminderMonthInterval.SixMonths ? "selected" : "")>@translator.Translate(userLanguage, "6 Months")</!option>
|
||||||
@@ -116,6 +116,7 @@
|
|||||||
<script>
|
<script>
|
||||||
var uploadedFiles = [];
|
var uploadedFiles = [];
|
||||||
var customMonthInterval = @Model.CustomMonthInterval;
|
var customMonthInterval = @Model.CustomMonthInterval;
|
||||||
|
var customMonthIntervalUnit = decodeHTMLEntities('@Model.CustomMonthIntervalUnit');
|
||||||
var recurringReminderRecordId = [];
|
var recurringReminderRecordId = [];
|
||||||
getUploadedFilesFromModel();
|
getUploadedFilesFromModel();
|
||||||
function getUploadedFilesFromModel() {
|
function getUploadedFilesFromModel() {
|
||||||
|
|||||||
@@ -72,6 +72,12 @@
|
|||||||
<label class="form-check-label stretched-link" for="chkCol_Cost">@translator.Translate(userLanguage, "Cost")</label>
|
<label class="form-check-label stretched-link" for="chkCol_Cost">@translator.Translate(userLanguage, "Cost")</label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="dropdown-item">
|
||||||
|
<div class="list-group-item">
|
||||||
|
<input class="form-check-input col-visible-toggle" data-column-toggle='attachments' onChange="showTableColumns(this, 'TaxRecord')" type="checkbox" id="chkCol_Attachment">
|
||||||
|
<label class="form-check-label stretched-link" for="chkCol_Attachment">@translator.Translate(userLanguage, "Attachments")</label>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
<li class="dropdown-item">
|
<li class="dropdown-item">
|
||||||
<div class="list-group-item">
|
<div class="list-group-item">
|
||||||
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'TaxRecord')" type="checkbox" id="chkCol_Notes" checked>
|
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'TaxRecord')" type="checkbox" id="chkCol_Notes" checked>
|
||||||
@@ -111,6 +117,7 @@
|
|||||||
<th scope="col" class="col-3 flex-grow-1 col-xl-1 text-truncate" data-column="date">@translator.Translate(userLanguage, "Date")</th>
|
<th scope="col" class="col-3 flex-grow-1 col-xl-1 text-truncate" data-column="date">@translator.Translate(userLanguage, "Date")</th>
|
||||||
<th scope="col" class="col-4 flex-grow-1 col-xl-6 text-truncate" data-column="description">@translator.Translate(userLanguage, "Description")</th>
|
<th scope="col" class="col-4 flex-grow-1 col-xl-6 text-truncate" data-column="description">@translator.Translate(userLanguage, "Description")</th>
|
||||||
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" onclick="toggleSort('tax-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Cost")</th>
|
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" onclick="toggleSort('tax-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Cost")</th>
|
||||||
|
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@translator.Translate(userLanguage, "Attachments")</th>
|
||||||
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -125,6 +132,7 @@
|
|||||||
<td class="col-3 flex-grow-1 col-xl-1 text-truncate" data-column="date">@taxRecord.Date.ToShortDateString()</td>
|
<td class="col-3 flex-grow-1 col-xl-1 text-truncate" data-column="date">@taxRecord.Date.ToShortDateString()</td>
|
||||||
<td class="col-4 flex-grow-1 col-xl-6 text-truncate" data-column="description">@taxRecord.Description</td>
|
<td class="col-4 flex-grow-1 col-xl-6 text-truncate" data-column="description">@taxRecord.Description</td>
|
||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" data-record-type="cost">@(StaticHelper.HideZeroCost(taxRecord.Cost, hideZero))</td>
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" data-record-type="cost">@(StaticHelper.HideZeroCost(taxRecord.Cost, hideZero))</td>
|
||||||
|
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@await Html.PartialAsync("_AttachmentColumn", taxRecord.Files)</td>
|
||||||
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@StaticHelper.TruncateStrings(taxRecord.Notes)</td>
|
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@StaticHelper.TruncateStrings(taxRecord.Notes)</td>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -170,6 +178,9 @@
|
|||||||
<li><hr class="context-menu-multiple dropdown-divider"></li>
|
<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="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><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>
|
<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>
|
</ul>
|
||||||
@if (userColumnPreferences.Any())
|
@if (userColumnPreferences.Any())
|
||||||
|
|||||||
@@ -78,6 +78,12 @@
|
|||||||
<label class="form-check-label stretched-link" for="chkCol_Cost">@translator.Translate(userLanguage, "Cost")</label>
|
<label class="form-check-label stretched-link" for="chkCol_Cost">@translator.Translate(userLanguage, "Cost")</label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="dropdown-item">
|
||||||
|
<div class="list-group-item">
|
||||||
|
<input class="form-check-input col-visible-toggle" data-column-toggle='attachments' onChange="showTableColumns(this, 'UpgradeRecord')" type="checkbox" id="chkCol_Attachment">
|
||||||
|
<label class="form-check-label stretched-link" for="chkCol_Attachment">@translator.Translate(userLanguage, "Attachments")</label>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
<li class="dropdown-item">
|
<li class="dropdown-item">
|
||||||
<div class="list-group-item">
|
<div class="list-group-item">
|
||||||
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'UpgradeRecord')" type="checkbox" id="chkCol_Notes" checked>
|
<input class="form-check-input col-visible-toggle" data-column-toggle='notes' onChange="showTableColumns(this, 'UpgradeRecord')" type="checkbox" id="chkCol_Notes" checked>
|
||||||
@@ -118,6 +124,7 @@
|
|||||||
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@translator.Translate(userLanguage, "Odometer")</th>
|
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@translator.Translate(userLanguage, "Odometer")</th>
|
||||||
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 col-xl-4 text-truncate" data-column="description">@translator.Translate(userLanguage, "Description")</th>
|
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 col-xl-4 text-truncate" data-column="description">@translator.Translate(userLanguage, "Description")</th>
|
||||||
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" onclick="toggleSort('upgrade-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Cost")</th>
|
<th scope="col" class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" onclick="toggleSort('upgrade-tab-pane', this)" style="cursor:pointer;">@translator.Translate(userLanguage, "Cost")</th>
|
||||||
|
<th scope="col" class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@translator.Translate(userLanguage, "Attachments")</th>
|
||||||
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
<th scope="col" class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@translator.Translate(userLanguage, "Notes")</th>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -133,6 +140,7 @@
|
|||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@(upgradeRecord.Mileage == default ? "---" : upgradeRecord.Mileage.ToString())</td>
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@(upgradeRecord.Mileage == default ? "---" : upgradeRecord.Mileage.ToString())</td>
|
||||||
<td class="col-3 flex-grow-1 flex-shrink-1 col-xl-4 text-truncate" data-column="description">@upgradeRecord.Description</td>
|
<td class="col-3 flex-grow-1 flex-shrink-1 col-xl-4 text-truncate" data-column="description">@upgradeRecord.Description</td>
|
||||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" data-record-type="cost">@(StaticHelper.HideZeroCost(upgradeRecord.Cost, hideZero))</td>
|
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="cost" data-record-type="cost">@(StaticHelper.HideZeroCost(upgradeRecord.Cost, hideZero))</td>
|
||||||
|
<td class="col-1 flex-grow-1 flex-shrink-1 text-truncate" style='display:none;' data-column="attachments">@await Html.PartialAsync("_AttachmentColumn", upgradeRecord.Files)</td>
|
||||||
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@StaticHelper.TruncateStrings(upgradeRecord.Notes)</td>
|
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@StaticHelper.TruncateStrings(upgradeRecord.Notes)</td>
|
||||||
@foreach (string extraFieldColumn in extraFields)
|
@foreach (string extraFieldColumn in extraFields)
|
||||||
{
|
{
|
||||||
@@ -184,6 +192,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="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><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><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><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><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>
|
<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 userLanguage = userConfig.UserLanguage;
|
||||||
var extraFields = Model.ReportParameters.ExtraFields;
|
var extraFields = Model.ReportParameters.ExtraFields;
|
||||||
}
|
}
|
||||||
<div class="vehicleDetailTabContainer">
|
<div>
|
||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<img src="@config.GetLogoUrl()" class="lubelogger-logo" />
|
<img src="@config.GetLogoUrl()" class="lubelogger-logo" />
|
||||||
|
|||||||
@@ -8,13 +8,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# volumes used to keep data persistent
|
# volumes used to keep data persistent
|
||||||
volumes:
|
volumes:
|
||||||
- config:/App/config
|
|
||||||
- data:/App/data
|
- data:/App/data
|
||||||
- translations:/App/wwwroot/translations
|
|
||||||
- documents:/App/wwwroot/documents
|
|
||||||
- images:/App/wwwroot/images
|
|
||||||
- temp:/App/wwwroot/temp
|
|
||||||
- log:/App/log
|
|
||||||
- keys:/root/.aspnet/DataProtection-Keys
|
- keys:/root/.aspnet/DataProtection-Keys
|
||||||
# expose port and/or use serving via traefik
|
# expose port and/or use serving via traefik
|
||||||
ports:
|
ports:
|
||||||
@@ -35,12 +29,6 @@ services:
|
|||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
config:
|
|
||||||
data:
|
data:
|
||||||
translations:
|
|
||||||
documents:
|
|
||||||
images:
|
|
||||||
temp:
|
|
||||||
log:
|
|
||||||
keys:
|
keys:
|
||||||
postgres:
|
postgres:
|
||||||
|
|||||||
@@ -8,13 +8,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# volumes used to keep data persistent
|
# volumes used to keep data persistent
|
||||||
volumes:
|
volumes:
|
||||||
- config:/App/config
|
|
||||||
- data:/App/data
|
- data:/App/data
|
||||||
- translations:/App/wwwroot/translations
|
|
||||||
- documents:/App/wwwroot/documents
|
|
||||||
- images:/App/wwwroot/images
|
|
||||||
- temp:/App/wwwroot/temp
|
|
||||||
- log:/App/log
|
|
||||||
- keys:/root/.aspnet/DataProtection-Keys
|
- keys:/root/.aspnet/DataProtection-Keys
|
||||||
# expose port and/or use serving via traefik
|
# expose port and/or use serving via traefik
|
||||||
ports:
|
ports:
|
||||||
@@ -40,13 +34,7 @@ services:
|
|||||||
traefik.http.services.whoami.loadbalancer.server.port: 5000
|
traefik.http.services.whoami.loadbalancer.server.port: 5000
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
config:
|
|
||||||
data:
|
data:
|
||||||
translations:
|
|
||||||
documents:
|
|
||||||
images:
|
|
||||||
temp:
|
|
||||||
log:
|
|
||||||
keys:
|
keys:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -8,13 +8,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# volumes used to keep data persistent
|
# volumes used to keep data persistent
|
||||||
volumes:
|
volumes:
|
||||||
- config:/App/config
|
|
||||||
- data:/App/data
|
- data:/App/data
|
||||||
- translations:/App/wwwroot/translations
|
|
||||||
- documents:/App/wwwroot/documents
|
|
||||||
- images:/App/wwwroot/images
|
|
||||||
- temp:/App/wwwroot/temp
|
|
||||||
- log:/App/log
|
|
||||||
- keys:/root/.aspnet/DataProtection-Keys
|
- keys:/root/.aspnet/DataProtection-Keys
|
||||||
# expose port and/or use serving via traefik
|
# expose port and/or use serving via traefik
|
||||||
ports:
|
ports:
|
||||||
@@ -23,11 +17,5 @@ services:
|
|||||||
- .env
|
- .env
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
config:
|
|
||||||
data:
|
data:
|
||||||
translations:
|
|
||||||
documents:
|
|
||||||
images:
|
|
||||||
temp:
|
|
||||||
log:
|
|
||||||
keys:
|
keys:
|
||||||
|
|||||||
@@ -81,6 +81,34 @@ html {
|
|||||||
color: #000 !important;
|
color: #000 !important;
|
||||||
overflow: visible;
|
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 {
|
body {
|
||||||
background-color: #fff !important;
|
background-color: #fff !important;
|
||||||
@@ -478,6 +506,12 @@ html[data-bs-theme="light"] .api-method:hover {
|
|||||||
object-fit: scale-down;
|
object-fit: scale-down;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
.lubelogger-logo-sticker {
|
||||||
|
height: 6rem;
|
||||||
|
width: auto;
|
||||||
|
object-fit: scale-down;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
::-ms-reveal {
|
::-ms-reveal {
|
||||||
display: none;
|
display: none;
|
||||||
@@ -486,4 +520,12 @@ html[data-bs-theme="light"] .api-method:hover {
|
|||||||
.lubelogger-report-banner {
|
.lubelogger-report-banner {
|
||||||
border-top: thin solid black;
|
border-top: thin solid black;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attachment-badge-xs {
|
||||||
|
padding-left: 0.25em;
|
||||||
|
padding-right: 0.25em;
|
||||||
|
font-size: 0.6em;
|
||||||
|
font-weight: 500;
|
||||||
|
top: 15%
|
||||||
}
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -33,15 +33,7 @@ td, th {
|
|||||||
<h2>{VehicleInformation}</h2>
|
<h2>{VehicleInformation}</h2>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
{TableHeader}
|
||||||
Urgency
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
Description
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
Due
|
|
||||||
</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
{TableBody}
|
{TableBody}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ function hidePinnedNotes(vehicleId) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterGarage(sender, isSort) {
|
function filterGarage(sender) {
|
||||||
var rowData = $(".garage-item");
|
var rowData = $(".garage-item");
|
||||||
if (sender == undefined) {
|
if (sender == undefined) {
|
||||||
rowData.removeClass('override-hide');
|
rowData.removeClass('override-hide');
|
||||||
@@ -191,14 +191,9 @@ function filterGarage(sender, isSort) {
|
|||||||
}
|
}
|
||||||
var tagName = sender.textContent;
|
var tagName = sender.textContent;
|
||||||
if ($(sender).hasClass("bg-primary")) {
|
if ($(sender).hasClass("bg-primary")) {
|
||||||
if (!isSort) {
|
rowData.removeClass('override-hide');
|
||||||
rowData.removeClass('override-hide');
|
$(sender).removeClass('bg-primary');
|
||||||
$(sender).removeClass('bg-primary');
|
$(sender).addClass('bg-secondary');
|
||||||
$(sender).addClass('bg-secondary');
|
|
||||||
} else {
|
|
||||||
rowData.addClass('override-hide');
|
|
||||||
$(`[data-tags~='${tagName}']`).removeClass('override-hide');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
//hide table rows.
|
//hide table rows.
|
||||||
rowData.addClass('override-hide');
|
rowData.addClass('override-hide');
|
||||||
@@ -264,14 +259,13 @@ function sortGarage(sender, isMobile) {
|
|||||||
//restore table
|
//restore table
|
||||||
sender.removeClass('sort-desc');
|
sender.removeClass('sort-desc');
|
||||||
sender.html(isMobile ? `<span class="ms-2 display-3">${garageIcon}${sortColumn}</span>` : `${garageIcon}${sortColumn}`);
|
sender.html(isMobile ? `<span class="ms-2 display-3">${garageIcon}${sortColumn}</span>` : `${garageIcon}${sortColumn}`);
|
||||||
$('.vehiclesContainer').html(storedTableRowState);
|
resetSortGarage();
|
||||||
filterGarage($(".tagfilter.bg-primary").get(0), true);
|
|
||||||
} else {
|
} else {
|
||||||
//first time sorting.
|
//first time sorting.
|
||||||
//check if table was sorted before by a different column(only relevant to fuel tab)
|
//check if table was sorted before by a different column(only relevant to fuel tab)
|
||||||
if (storedTableRowState != null && ($(".sort-asc").length > 0 || $(".sort-desc").length > 0)) {
|
if ($("[default-sort]").length > 0 && ($(".sort-asc").length > 0 || $(".sort-desc").length > 0)) {
|
||||||
//restore table state.
|
//restore table state.
|
||||||
$('.vehiclesContainer').html(storedTableRowState);
|
resetSortGarage();
|
||||||
//reset other sorted columns
|
//reset other sorted columns
|
||||||
if ($(".sort-asc").length > 0) {
|
if ($(".sort-asc").length > 0) {
|
||||||
$(".sort-asc").html($(".sort-asc").html().replace(sortAscIcon, ""));
|
$(".sort-asc").html($(".sort-asc").html().replace(sortAscIcon, ""));
|
||||||
@@ -284,12 +278,28 @@ function sortGarage(sender, isMobile) {
|
|||||||
}
|
}
|
||||||
sender.addClass('sort-asc');
|
sender.addClass('sort-asc');
|
||||||
sender.html(isMobile ? `<span class="ms-2 display-3">${garageIcon}${sortColumn}${sortAscIcon}</span>` : `${garageIcon}${sortColumn}${sortAscIcon}`);
|
sender.html(isMobile ? `<span class="ms-2 display-3">${garageIcon}${sortColumn}${sortAscIcon}</span>` : `${garageIcon}${sortColumn}${sortAscIcon}`);
|
||||||
storedTableRowState = null;
|
//append sortRowId to the vehicle container
|
||||||
storedTableRowState = $('.vehiclesContainer').html();
|
if ($("[default-sort]").length == 0) {
|
||||||
|
$(`.garage-item`).map((index, elem) => {
|
||||||
|
$(elem).attr("default-sort", index);
|
||||||
|
});
|
||||||
|
}
|
||||||
sortVehicles(false);
|
sortVehicles(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function resetSortGarage() {
|
||||||
|
var rowData = $(`.garage-item`);
|
||||||
|
var sortedRow = rowData.toArray().sort((a, b) => {
|
||||||
|
var currentVal = $(a).attr('default-sort');
|
||||||
|
var nextVal = $(b).attr('default-sort');
|
||||||
|
return currentVal - nextVal;
|
||||||
|
});
|
||||||
|
$(".garage-item-add").map((index, elem) => {
|
||||||
|
sortedRow.push(elem);
|
||||||
|
})
|
||||||
|
$(`.vehiclesContainer`).html(sortedRow);
|
||||||
|
}
|
||||||
|
|
||||||
let dragged = null;
|
let dragged = null;
|
||||||
let draggedId = 0;
|
let draggedId = 0;
|
||||||
|
|||||||
@@ -67,4 +67,31 @@ function remoteLogin() {
|
|||||||
window.location.href = data;
|
window.location.href = data;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
function sendRegistrationToken() {
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Please Provide an Email Address',
|
||||||
|
html: `
|
||||||
|
<input type="text" id="inputTokenEmail" class="swal2-input" placeholder="Email Address" onkeydown="handleSwalEnter(event)">
|
||||||
|
`,
|
||||||
|
confirmButtonText: 'Send',
|
||||||
|
focusConfirm: false,
|
||||||
|
preConfirm: () => {
|
||||||
|
const tokenEmail = $("#inputTokenEmail").val();
|
||||||
|
if (!tokenEmail || tokenEmail.trim() == '') {
|
||||||
|
Swal.showValidationMessage(`Please enter a valid email address`);
|
||||||
|
}
|
||||||
|
return { tokenEmail }
|
||||||
|
},
|
||||||
|
}).then(function (result) {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
$.post('/Login/SendRegistrationToken', { emailAddress: result.value.tokenEmail }, function (data) {
|
||||||
|
if (data.success) {
|
||||||
|
successToast(data.message);
|
||||||
|
} else {
|
||||||
|
errorToast(data.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@ function getAndValidateOdometerRecordValues() {
|
|||||||
|
|
||||||
function recalculateDistance() {
|
function recalculateDistance() {
|
||||||
//force distance recalculation
|
//force distance recalculation
|
||||||
//reserved for when data is incoherent with negative distances due to non-chronologica order of odometer records.
|
//reserved for when data is incoherent with negative distances due to non-chronological order of odometer records.
|
||||||
var vehicleId = GetVehicleId().vehicleId
|
var vehicleId = GetVehicleId().vehicleId
|
||||||
$.post(`/Vehicle/ForceRecalculateDistanceByVehicleId?vehicleId=${vehicleId}`, function (data) {
|
$.post(`/Vehicle/ForceRecalculateDistanceByVehicleId?vehicleId=${vehicleId}`, function (data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
@@ -362,15 +362,16 @@ function getRecordedOdometer() {
|
|||||||
return parseFloat(`${recordedOdometer}.${recordedSubOdometer}`);
|
return parseFloat(`${recordedOdometer}.${recordedSubOdometer}`);
|
||||||
}
|
}
|
||||||
function saveRecordedOdometer() {
|
function saveRecordedOdometer() {
|
||||||
//update current odometer value
|
|
||||||
$("#odometerRecordMileage").val(parseInt(getRecordedOdometer()).toString());
|
|
||||||
//save coordinates into a CSV file and upload
|
//save coordinates into a CSV file and upload
|
||||||
if (tripCoordinates.length > 0) {
|
if (tripCoordinates.length > 1) {
|
||||||
|
//update current odometer value
|
||||||
|
$("#odometerRecordMileage").val(parseInt(getRecordedOdometer()).toString());
|
||||||
|
//generate attachment
|
||||||
$.post('/Files/UploadCoordinates', { coordinates: tripCoordinates }, function (response) {
|
$.post('/Files/UploadCoordinates', { coordinates: tripCoordinates }, function (response) {
|
||||||
uploadedFiles.push(response);
|
uploadedFiles.push(response);
|
||||||
$.post('/Vehicle/GetFilesPendingUpload', { uploadedFiles: uploadedFiles }, function (viewData) {
|
$.post('/Vehicle/GetFilesPendingUpload', { uploadedFiles: uploadedFiles }, function (viewData) {
|
||||||
$("#filesPendingUpload").html(viewData);
|
$("#filesPendingUpload").html(viewData);
|
||||||
tripCoordinates = [];
|
tripCoordinates = ["Latitude,Longitude"];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -362,6 +362,9 @@ function configurePlanTableContextMenu(planRecordId, currentSwimLane) {
|
|||||||
deletePlanRecord(planRecordId, true);
|
deletePlanRecord(planRecordId, true);
|
||||||
});
|
});
|
||||||
let planRecordIdArray = [planRecordId];
|
let planRecordIdArray = [planRecordId];
|
||||||
|
$(".context-menu-print-tab-sticker").on('click', () => {
|
||||||
|
printTabStickers(planRecordIdArray, 'PlanRecord');
|
||||||
|
});
|
||||||
$(".context-menu-duplicate").on('click', () => {
|
$(".context-menu-duplicate").on('click', () => {
|
||||||
duplicateRecords(planRecordIdArray, 'PlanRecord');
|
duplicateRecords(planRecordIdArray, 'PlanRecord');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,23 +21,29 @@ function checkCustomMonthInterval() {
|
|||||||
if (selectedValue == "Other") {
|
if (selectedValue == "Other") {
|
||||||
$("#workAroundInput").show();
|
$("#workAroundInput").show();
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Specify Custom Month Interval',
|
title: 'Specify Custom Time Interval',
|
||||||
html: `
|
html: `
|
||||||
<input type="text" inputmode="numeric" id="inputCustomMileage" class="swal2-input" placeholder="Months" onkeydown="handleSwalEnter(event)">
|
<input type="text" inputmode="numeric" id="inputCustomMonth" class="swal2-input" placeholder="Time" onkeydown="handleSwalEnter(event)">
|
||||||
|
<select class="swal2-select" id="inputCustomMonthUnit">
|
||||||
|
<option value="Months">Months</option>
|
||||||
|
<option value="Days">Days</option>
|
||||||
|
</select>
|
||||||
`,
|
`,
|
||||||
confirmButtonText: 'Set',
|
confirmButtonText: 'Set',
|
||||||
focusConfirm: false,
|
focusConfirm: false,
|
||||||
preConfirm: () => {
|
preConfirm: () => {
|
||||||
const customMonth = $("#inputCustomMileage").val();
|
const customMonth = $("#inputCustomMonth").val();
|
||||||
if (!customMonth || isNaN(parseInt(customMonth)) || parseInt(customMonth) <= 0) {
|
if (!customMonth || isNaN(parseInt(customMonth)) || parseInt(customMonth) <= 0) {
|
||||||
Swal.showValidationMessage(`Please enter a valid number`);
|
Swal.showValidationMessage(`Please enter a valid number`);
|
||||||
}
|
}
|
||||||
return { customMonth }
|
const customMonthUnit = $("#inputCustomMonthUnit").val();
|
||||||
|
return { customMonth, customMonthUnit }
|
||||||
},
|
},
|
||||||
}).then(function (result) {
|
}).then(function (result) {
|
||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
customMonthInterval = result.value.customMonth;
|
customMonthInterval = result.value.customMonth;
|
||||||
$("#reminderRecurringMonth > option[value='Other']").text(`Other: ${result.value.customMonth}`);
|
customMonthIntervalUnit = result.value.customMonthUnit;
|
||||||
|
$("#reminderRecurringMonth > option[value='Other']").text(`Other: ${result.value.customMonth} ${result.value.customMonthUnit}`);
|
||||||
} else {
|
} else {
|
||||||
$("#reminderRecurringMonth").val(getReminderRecordModelData().monthInterval);
|
$("#reminderRecurringMonth").val(getReminderRecordModelData().monthInterval);
|
||||||
}
|
}
|
||||||
@@ -276,6 +282,7 @@ function getAndValidateReminderRecordValues() {
|
|||||||
reminderMonthInterval: reminderRecurringMonth,
|
reminderMonthInterval: reminderRecurringMonth,
|
||||||
customMileageInterval: customMileageInterval,
|
customMileageInterval: customMileageInterval,
|
||||||
customMonthInterval: customMonthInterval,
|
customMonthInterval: customMonthInterval,
|
||||||
|
customMonthIntervalUnit: customMonthIntervalUnit,
|
||||||
tags: reminderTags
|
tags: reminderTags
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,10 +114,7 @@ function generateVehicleHistoryReport() {
|
|||||||
reportParameter: result.value.selectedColumnsData
|
reportParameter: result.value.selectedColumnsData
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$("#vehicleHistoryReport").html(data);
|
printContainer(data);
|
||||||
setTimeout(function () {
|
|
||||||
window.print();
|
|
||||||
}, 500);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -278,6 +275,13 @@ function toggleBarChartTableData() {
|
|||||||
$('[report-data="cost"]').removeClass('d-none');
|
$('[report-data="cost"]').removeClass('d-none');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function toggleCostTableHint() {
|
||||||
|
if ($(".cost-table-hint").hasClass("d-none")) {
|
||||||
|
$(".cost-table-hint").removeClass("d-none");
|
||||||
|
} else {
|
||||||
|
$(".cost-table-hint").addClass("d-none");
|
||||||
|
}
|
||||||
|
}
|
||||||
function updateReminderPie() {
|
function updateReminderPie() {
|
||||||
var vehicleId = GetVehicleId().vehicleId;
|
var vehicleId = GetVehicleId().vehicleId;
|
||||||
var daysToAdd = $("#reminderOption").val();
|
var daysToAdd = $("#reminderOption").val();
|
||||||
|
|||||||
@@ -362,7 +362,23 @@ function initTagSelector(input, noDataList) {
|
|||||||
input.tagsinput();
|
input.tagsinput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function getAndValidateSelectedVehicle() {
|
||||||
|
var selectedVehiclesArray = [];
|
||||||
|
$("#vehicleSelector :checked").map(function () {
|
||||||
|
selectedVehiclesArray.push(this.value);
|
||||||
|
});
|
||||||
|
if (selectedVehiclesArray.length == 0) {
|
||||||
|
return {
|
||||||
|
hasError: true,
|
||||||
|
ids: []
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
hasError: false,
|
||||||
|
ids: selectedVehiclesArray
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
function showMobileNav() {
|
function showMobileNav() {
|
||||||
$(".lubelogger-mobile-nav").addClass("lubelogger-mobile-nav-show");
|
$(".lubelogger-mobile-nav").addClass("lubelogger-mobile-nav-show");
|
||||||
}
|
}
|
||||||
@@ -396,7 +412,6 @@ function setDebounce(callBack) {
|
|||||||
callBack();
|
callBack();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
var storedTableRowState = null;
|
|
||||||
function toggleSort(tabName, sender) {
|
function toggleSort(tabName, sender) {
|
||||||
var sortColumn = sender.textContent;
|
var sortColumn = sender.textContent;
|
||||||
var sortAscIcon = '<i class="bi bi-sort-numeric-down ms-2"></i>';
|
var sortAscIcon = '<i class="bi bi-sort-numeric-down ms-2"></i>';
|
||||||
@@ -412,14 +427,13 @@ function toggleSort(tabName, sender) {
|
|||||||
//restore table
|
//restore table
|
||||||
sender.removeClass('sort-desc');
|
sender.removeClass('sort-desc');
|
||||||
sender.html(`${sortColumn}`);
|
sender.html(`${sortColumn}`);
|
||||||
$(`#${tabName} table tbody`).html(storedTableRowState);
|
resetSortTable(tabName);
|
||||||
filterTable(tabName, $(".tagfilter.bg-primary").get(0), true);
|
|
||||||
} else {
|
} else {
|
||||||
//first time sorting.
|
//first time sorting.
|
||||||
//check if table was sorted before by a different column(only relevant to fuel tab)
|
//check if table was sorted before by a different column(only relevant to fuel tab)
|
||||||
if (storedTableRowState != null && ($(".sort-asc").length > 0 || $(".sort-desc").length > 0)) {
|
if ($("[default-sort]").length > 0 && ($(".sort-asc").length > 0 || $(".sort-desc").length > 0)) {
|
||||||
//restore table state.
|
//restore table state.
|
||||||
$(`#${tabName} table tbody`).html(storedTableRowState);
|
resetSortTable(tabName);
|
||||||
//reset other sorted columns
|
//reset other sorted columns
|
||||||
if ($(".sort-asc").length > 0) {
|
if ($(".sort-asc").length > 0) {
|
||||||
$(".sort-asc").html($(".sort-asc").html().replace(sortAscIcon, ""));
|
$(".sort-asc").html($(".sort-asc").html().replace(sortAscIcon, ""));
|
||||||
@@ -432,8 +446,12 @@ function toggleSort(tabName, sender) {
|
|||||||
}
|
}
|
||||||
sender.addClass('sort-asc');
|
sender.addClass('sort-asc');
|
||||||
sender.html(`${sortColumn}${sortAscIcon}`);
|
sender.html(`${sortColumn}${sortAscIcon}`);
|
||||||
storedTableRowState = null;
|
//append sortRowId to the table rows if nothing has been appended yet.
|
||||||
storedTableRowState = $(`#${tabName} table tbody`).html();
|
if ($("[default-sort]").length == 0) {
|
||||||
|
$(`#${tabName} table tbody tr`).map((index, elem) => {
|
||||||
|
$(elem).attr("default-sort", index);
|
||||||
|
});
|
||||||
|
}
|
||||||
sortTable(tabName, sortColumn, false);
|
sortTable(tabName, sortColumn, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -453,9 +471,17 @@ function sortTable(tabName, columnName, desc) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(`#${tabName} table tbody`).html(sortedRow);
|
$(`#${tabName} table tbody`).html(sortedRow);
|
||||||
filterTable(tabName, $(".tagfilter.bg-primary").get(0), true);
|
|
||||||
}
|
}
|
||||||
function filterTable(tabName, sender, isSort) {
|
function resetSortTable(tabName) {
|
||||||
|
var rowData = $(`#${tabName} table tbody tr`);
|
||||||
|
var sortedRow = rowData.toArray().sort((a, b) => {
|
||||||
|
var currentVal = $(a).attr('default-sort');
|
||||||
|
var nextVal = $(b).attr('default-sort');
|
||||||
|
return currentVal - nextVal;
|
||||||
|
});
|
||||||
|
$(`#${tabName} table tbody`).html(sortedRow);
|
||||||
|
}
|
||||||
|
function filterTable(tabName, sender) {
|
||||||
var rowData = $(`#${tabName} table tbody tr`);
|
var rowData = $(`#${tabName} table tbody tr`);
|
||||||
if (sender == undefined) {
|
if (sender == undefined) {
|
||||||
rowData.removeClass('override-hide');
|
rowData.removeClass('override-hide');
|
||||||
@@ -464,16 +490,10 @@ function filterTable(tabName, sender, isSort) {
|
|||||||
var tagName = sender.textContent;
|
var tagName = sender.textContent;
|
||||||
//check for other applied filters
|
//check for other applied filters
|
||||||
if ($(sender).hasClass("bg-primary")) {
|
if ($(sender).hasClass("bg-primary")) {
|
||||||
if (!isSort) {
|
rowData.removeClass('override-hide');
|
||||||
rowData.removeClass('override-hide');
|
$(sender).removeClass('bg-primary');
|
||||||
$(sender).removeClass('bg-primary');
|
$(sender).addClass('bg-secondary');
|
||||||
$(sender).addClass('bg-secondary');
|
updateAggregateLabels();
|
||||||
updateAggregateLabels();
|
|
||||||
} else {
|
|
||||||
rowData.addClass('override-hide');
|
|
||||||
$(`[data-tags~='${tagName}']`).removeClass('override-hide');
|
|
||||||
updateAggregateLabels();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
//hide table rows.
|
//hide table rows.
|
||||||
rowData.addClass('override-hide');
|
rowData.addClass('override-hide');
|
||||||
@@ -608,6 +628,16 @@ function toggleMarkDownOverlay(textAreaName) {
|
|||||||
textArea.parent().children(`label[for=${textAreaName}]`).append(overlayDiv);
|
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) {
|
function showLinks(e) {
|
||||||
var textAreaName = $(e.parentElement).attr("for");
|
var textAreaName = $(e.parentElement).attr("for");
|
||||||
toggleMarkDownOverlay(textAreaName);
|
toggleMarkDownOverlay(textAreaName);
|
||||||
@@ -617,6 +647,33 @@ function printTab() {
|
|||||||
window.print();
|
window.print();
|
||||||
}, 500);
|
}, 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) {
|
function exportVehicleData(mode) {
|
||||||
var vehicleId = GetVehicleId().vehicleId;
|
var vehicleId = GetVehicleId().vehicleId;
|
||||||
$.get('/Vehicle/ExportFromVehicleToCsv', { vehicleId: vehicleId, mode: mode }, function (data) {
|
$.get('/Vehicle/ExportFromVehicleToCsv', { vehicleId: vehicleId, mode: mode }, function (data) {
|
||||||
@@ -1245,8 +1302,11 @@ function replenishSupplies() {
|
|||||||
currentCost = 0;
|
currentCost = 0;
|
||||||
}
|
}
|
||||||
var currentQuantity = globalParseFloat($('#supplyRecordQuantity').val());
|
var currentQuantity = globalParseFloat($('#supplyRecordQuantity').val());
|
||||||
|
if (isNaN(currentQuantity)) {
|
||||||
|
currentQuantity = 0;
|
||||||
|
}
|
||||||
var newQuantity = currentQuantity + replenishedQuantity;
|
var newQuantity = currentQuantity + replenishedQuantity;
|
||||||
if (replenishedCost.trim() == '') {
|
if (replenishedCost.trim() == '' && currentCost > 0 && currentQuantity > 0) {
|
||||||
|
|
||||||
var unitCost = currentCost / currentQuantity;
|
var unitCost = currentCost / currentQuantity;
|
||||||
var newCost = newQuantity * unitCost;
|
var newCost = newQuantity * unitCost;
|
||||||
@@ -1389,7 +1449,7 @@ function handleModalPaste(e, recordType) {
|
|||||||
}
|
}
|
||||||
function handleEnter(e) {
|
function handleEnter(e) {
|
||||||
if ((event.ctrlKey || event.metaKey) && event.which == 13) {
|
if ((event.ctrlKey || event.metaKey) && event.which == 13) {
|
||||||
var saveButton = $(e).parent().find(".modal-footer .btn-primary");
|
var saveButton = $(e).parent().find(".modal-footer .btn-primary:not('.d-none')");
|
||||||
if (saveButton.length > 0) {
|
if (saveButton.length > 0) {
|
||||||
saveButton.first().trigger('click');
|
saveButton.first().trigger('click');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,23 +102,29 @@ function checkCustomMonthIntervalForTax() {
|
|||||||
if (selectedValue == "Other") {
|
if (selectedValue == "Other") {
|
||||||
$("#workAroundInput").show();
|
$("#workAroundInput").show();
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Specify Custom Month Interval',
|
title: 'Specify Custom Time Interval',
|
||||||
html: `
|
html: `
|
||||||
<input type="text" inputmode="numeric" id="inputCustomMileage" class="swal2-input" placeholder="Months" onkeydown="handleSwalEnter(event)">
|
<input type="text" inputmode="numeric" id="inputCustomMonth" class="swal2-input" placeholder="Months" onkeydown="handleSwalEnter(event)">
|
||||||
|
<select class="swal2-select" id="inputCustomMonthUnit">
|
||||||
|
<option value="Months">Months</option>
|
||||||
|
<option value="Days">Days</option>
|
||||||
|
</select>
|
||||||
`,
|
`,
|
||||||
confirmButtonText: 'Set',
|
confirmButtonText: 'Set',
|
||||||
focusConfirm: false,
|
focusConfirm: false,
|
||||||
preConfirm: () => {
|
preConfirm: () => {
|
||||||
const customMonth = $("#inputCustomMileage").val();
|
const customMonth = $("#inputCustomMonth").val();
|
||||||
if (!customMonth || isNaN(parseInt(customMonth)) || parseInt(customMonth) <= 0) {
|
if (!customMonth || isNaN(parseInt(customMonth)) || parseInt(customMonth) <= 0) {
|
||||||
Swal.showValidationMessage(`Please enter a valid number`);
|
Swal.showValidationMessage(`Please enter a valid number`);
|
||||||
}
|
}
|
||||||
return { customMonth }
|
const customMonthUnit = $("#inputCustomMonthUnit").val();
|
||||||
|
return { customMonth, customMonthUnit }
|
||||||
},
|
},
|
||||||
}).then(function (result) {
|
}).then(function (result) {
|
||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
customMonthInterval = result.value.customMonth;
|
customMonthInterval = result.value.customMonth;
|
||||||
$("#taxRecurringMonth > option[value='Other']").text(`Other: ${result.value.customMonth}`);
|
customMonthIntervalUnit = result.value.customMonthUnit;
|
||||||
|
$("#taxRecurringMonth > option[value='Other']").text(`Other: ${result.value.customMonth} ${result.value.customMonthUnit}`);
|
||||||
} else {
|
} else {
|
||||||
$("#taxRecurringMonth").val(getTaxRecordModelData().monthInterval);
|
$("#taxRecurringMonth").val(getTaxRecordModelData().monthInterval);
|
||||||
}
|
}
|
||||||
@@ -172,6 +178,7 @@ function getAndValidateTaxRecordValues() {
|
|||||||
isRecurring: taxIsRecurring,
|
isRecurring: taxIsRecurring,
|
||||||
recurringInterval: taxRecurringMonth,
|
recurringInterval: taxRecurringMonth,
|
||||||
customMonthInterval: customMonthInterval,
|
customMonthInterval: customMonthInterval,
|
||||||
|
customMonthIntervalUnit: customMonthIntervalUnit,
|
||||||
tags: taxTags,
|
tags: taxTags,
|
||||||
files: uploadedFiles,
|
files: uploadedFiles,
|
||||||
addReminderRecord: addReminderRecord,
|
addReminderRecord: addReminderRecord,
|
||||||
|
|||||||
@@ -576,23 +576,6 @@ function showMultipleRemindersSelector() {
|
|||||||
$("#recurringReminderInput").show();
|
$("#recurringReminderInput").show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function getAndValidateSelectedVehicle() {
|
|
||||||
var selectedVehiclesArray = [];
|
|
||||||
$("#vehicleSelector :checked").map(function () {
|
|
||||||
selectedVehiclesArray.push(this.value);
|
|
||||||
});
|
|
||||||
if (selectedVehiclesArray.length == 0) {
|
|
||||||
return {
|
|
||||||
hasError: true,
|
|
||||||
ids: []
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
hasError: false,
|
|
||||||
ids: selectedVehiclesArray
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function getAndValidateSelectedRecurringReminder() {
|
function getAndValidateSelectedRecurringReminder() {
|
||||||
if ($("#multipleRemindersCheck").is(":checked")) {
|
if ($("#multipleRemindersCheck").is(":checked")) {
|
||||||
//validate multiple reminders
|
//validate multiple reminders
|
||||||
|
|||||||
Reference in New Issue
Block a user