Commit Graph

1 Commits

Author SHA1 Message Date
8dadd66f45 fix: Add support for ANSI MH10.8.2 barcode format
Fixes barcode parsing for ANSI MH10.8.2 format barcodes that don't use GS/RS separators.

Problem:
- Barcodes like [)>06PSAM9019-ND1PJL-100-25-T... were not being parsed
- Only separator-based and JSON formats were supported
- User's real-world barcodes were being added to queue as raw strings

Solution:
- Added ANSI MH10.8.2 format detection ([)>06 prefix)
- Extract part code between P and first field marker (1P, 30P)
- Extract quantity from Q<digits> pattern
- Updated both desktop and web app parsing logic

Tested with real barcode:
- Input: [)>06PSAM9019-ND1PJL-100-25-T30PSAM9019-NDK1...Q1811...
- Parsed: Part=SAM9019-ND, Qty=1811 

Files Changed:
- src/stocktool/stock_tool_gui_v2.py - Enhanced parse_scan()
- src/stocktool/web/static/js/app.js - Enhanced parseBarcode()
- test_barcode_parsing.py - Test script for validation
- test_barcode_analyze.py - Barcode structure analysis tool
- QUICKSTART_WEB.md - Quick start guide for web app

Supported Formats Now:
1. JSON-like: {PM:PART-CODE,QTY:10}
2. Separator-based: GS/RS (\x1D, \x1E) separated fields
3. ANSI MH10.8.2: [)>06P<part>...Q<qty>... (NEW!)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 11:29:20 +07:00