WIP scale fw
This commit is contained in:
@@ -397,6 +397,15 @@
|
||||
handleProductScan(product);
|
||||
});
|
||||
|
||||
socket.on('scale_update', function (data) {
|
||||
const weightInput = document.getElementById('weight-input');
|
||||
const weightModal = document.getElementById('weightModal');
|
||||
|
||||
if (weightModal.classList.contains('show')) {
|
||||
weightInput.value = data.grams;
|
||||
}
|
||||
});
|
||||
|
||||
function goToInventory() {
|
||||
if (missingProductData) {
|
||||
window.location.href = `/?barcode=${missingProductData.barcode}`;
|
||||
|
||||
@@ -287,6 +287,13 @@ permanentemente', 'executeBulkDelete()') %}
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('scale_update', function (data) {
|
||||
const unitType = document.getElementById('form-unit-type').value;
|
||||
if (unitType === 'kg') {
|
||||
document.getElementById('form-stock').value = data.kilograms;
|
||||
}
|
||||
});
|
||||
|
||||
// Replace your existing updateForm function with this one
|
||||
function updateForm(b, n, p, i, t, stock, unit) {
|
||||
dismissPrompt();
|
||||
|
||||
Reference in New Issue
Block a user