feat(ui): barcode scanner feedback in POS, timeline & kanban CSS, image comparator modal, ticket preview modal

This commit is contained in:
2026-05-26 09:30:14 +00:00
parent 68d6f81671
commit b6a327c98c

View File

@@ -242,6 +242,7 @@ const POS = (() => {
if (existing) {
existing.quantity += (item.quantity || 1);
renderCart();
if (window.BarcodeFeedback) BarcodeFeedback.success();
return;
}
@@ -502,6 +503,19 @@ const POS = (() => {
if (data.data.length === 0) {
container.innerHTML = '<div style="padding:20px;text-align:center;color:var(--color-text-muted);">Sin resultados</div>';
if (window.BarcodeFeedback) BarcodeFeedback.error();
} else if (data.data.length === 1 && q.length >= 8) {
// Auto-select single result on barcode scan (long codes)
const item = data.data[0];
let price = item.price_1;
if (currentCustomer) {
const tier = currentCustomer.price_tier || 1;
price = tier === 3 ? item.price_3 : tier === 2 ? item.price_2 : item.price_1;
}
addFromSearch(item, price);
input.value = '';
hideSearchResults();
return;
} else {
let html = '';
data.data.forEach(item => {
@@ -542,6 +556,7 @@ const POS = (() => {
price_2: item.price_2,
price_3: item.price_3,
});
if (window.BarcodeFeedback) BarcodeFeedback.success();
hideSearchResults();
document.getElementById('itemSearch').value = '';
document.getElementById('itemSearch').focus();