From d4c484778c3b31f95c6dcf2ef6c0c13d7c112447 Mon Sep 17 00:00:00 2001 From: oliver Date: Wed, 10 Jun 2026 06:54:12 -0300 Subject: [PATCH] DPD --- app.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 56708dd..89f1026 100644 --- a/app.js +++ b/app.js @@ -260,9 +260,21 @@ function updateQueuePill() { } } +// ── Barcode extraction ──────────────────────────────────────────────── +// Scanned codes have 8 space-separated blocks; the 3rd through 6th +// (0-indexed 2..5) form the real scan code, concatenated without spaces. +// E.g. "0003 580 0626 5027 3077 23 328 040" → "06265027307723" +function extractCode(raw) { + const parts = raw.trim().split(/\s+/); + if (parts.length >= 6) { + return parts.slice(2, 6).join(""); + } + return raw.trim(); // fallback: use as-is +} + // ── Enqueue (called immediately on Enter) ────────────────────────────── function enqueue(raw) { - const code = raw.trim(); + const code = extractCode(raw); if (!code) return; const user = userSelect.value;