DPD
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user