v0.11.1 - Fixed weight Discrepancy bug
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -94,6 +94,7 @@ def upload_master(session_id):
|
||||
|
||||
conn = get_db()
|
||||
cursor = conn.cursor()
|
||||
cursor.execute('DELETE FROM BaselineInventory_Master WHERE session_id = ?', [session_id])
|
||||
try:
|
||||
stream = io.StringIO(file.stream.read().decode("UTF8"), newline=None)
|
||||
csv_reader = csv.DictReader(stream)
|
||||
|
||||
Reference in New Issue
Block a user