Fix count labels for odometer and reminder records when filtered by tags.

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2025-01-22 09:39:07 -07:00
parent f1f99a67dd
commit 4be3c16adc
4 changed files with 9 additions and 8 deletions

View File

@@ -139,7 +139,7 @@ function getAndValidateOdometerRecordValues() {
function recalculateDistance() {
//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
$.post(`/Vehicle/ForceRecalculateDistanceByVehicleId?vehicleId=${vehicleId}`, function (data) {
if (data) {
@@ -362,15 +362,16 @@ function getRecordedOdometer() {
return parseFloat(`${recordedOdometer}.${recordedSubOdometer}`);
}
function saveRecordedOdometer() {
//update current odometer value
$("#odometerRecordMileage").val(parseInt(getRecordedOdometer()).toString());
//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) {
uploadedFiles.push(response);
$.post('/Vehicle/GetFilesPendingUpload', { uploadedFiles: uploadedFiles }, function (viewData) {
$("#filesPendingUpload").html(viewData);
tripCoordinates = [];
tripCoordinates = ["Latitude,Longitude"];
});
});
}

View File

@@ -1449,7 +1449,7 @@ function handleModalPaste(e, recordType) {
}
function handleEnter(e) {
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) {
saveButton.first().trigger('click');
}