v0.11.1 - Fixed weight Discrepancy bug

This commit is contained in:
Javier
2026-01-25 20:40:51 -06:00
parent ff577a6cbf
commit 136fe03e07
6 changed files with 49 additions and 9 deletions

View File

@@ -310,8 +310,14 @@ def scan_lot(session_id, location_count_id):
# Check against MASTER baseline
master = query_db('''
SELECT * FROM BaselineInventory_Master
SELECT
system_bin,
SUM(system_quantity) as system_quantity,
MAX(item) as item,
MAX(description) as description
FROM BaselineInventory_Master
WHERE session_id = ? AND lot_number = ? AND system_bin = ?
GROUP BY system_bin
''', [session_id, lot_number, location['location_name']], one=True)
# Determine master_status (only if not a duplicate issue)
@@ -328,8 +334,16 @@ def scan_lot(session_id, location_count_id):
else:
# Check if lot exists in different location
master_other = query_db('''
SELECT * FROM BaselineInventory_Master
SELECT
system_bin,
SUM(system_quantity) as system_quantity,
MAX(item) as item,
MAX(description) as description
FROM BaselineInventory_Master
WHERE session_id = ? AND lot_number = ?
GROUP BY system_bin
ORDER BY system_bin
LIMIT 1
''', [session_id, lot_number], one=True)
if master_other:
@@ -346,8 +360,16 @@ def scan_lot(session_id, location_count_id):
# For duplicates, still check baseline for item info
if not master:
master = query_db('''
SELECT * FROM BaselineInventory_Master
SELECT
system_bin,
SUM(system_quantity) as system_quantity,
MAX(item) as item,
MAX(description) as description
FROM BaselineInventory_Master
WHERE session_id = ? AND lot_number = ?
GROUP BY system_bin
ORDER BY system_bin
LIMIT 1
''', [session_id, lot_number], one=True)
master_status = 'match' # Don't override with wrong_location for duplicates
variance_lbs = None