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) { if (existing) {
existing.quantity += (item.quantity || 1); existing.quantity += (item.quantity || 1);
renderCart(); renderCart();
if (window.BarcodeFeedback) BarcodeFeedback.success();
return; return;
} }
@@ -502,6 +503,19 @@ const POS = (() => {
if (data.data.length === 0) { if (data.data.length === 0) {
container.innerHTML = '<div style="padding:20px;text-align:center;color:var(--color-text-muted);">Sin resultados</div>'; 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 { } else {
let html = ''; let html = '';
data.data.forEach(item => { data.data.forEach(item => {
@@ -542,6 +556,7 @@ const POS = (() => {
price_2: item.price_2, price_2: item.price_2,
price_3: item.price_3, price_3: item.price_3,
}); });
if (window.BarcodeFeedback) BarcodeFeedback.success();
hideSearchResults(); hideSearchResults();
document.getElementById('itemSearch').value = ''; document.getElementById('itemSearch').value = '';
document.getElementById('itemSearch').focus(); document.getElementById('itemSearch').focus();