Add sticker printing for supplies.

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2025-01-19 10:36:32 -07:00
parent 6a8fba535a
commit 07ccd1dea9
7 changed files with 125 additions and 21 deletions

View File

@@ -362,7 +362,23 @@ function initTagSelector(input, noDataList) {
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() {
$(".lubelogger-mobile-nav").addClass("lubelogger-mobile-nav-show");
}
@@ -1282,8 +1298,11 @@ function replenishSupplies() {
currentCost = 0;
}
var currentQuantity = globalParseFloat($('#supplyRecordQuantity').val());
if (isNaN(currentQuantity)) {
currentQuantity = 0;
}
var newQuantity = currentQuantity + replenishedQuantity;
if (replenishedCost.trim() == '') {
if (replenishedCost.trim() == '' && currentCost > 0 && currentQuantity > 0) {
var unitCost = currentCost / currentQuantity;
var newCost = newQuantity * unitCost;

View File

@@ -576,23 +576,6 @@ function showMultipleRemindersSelector() {
$("#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() {
if ($("#multipleRemindersCheck").is(":checked")) {
//validate multiple reminders