fix: handle string EAN codes in Excel (not just integers)
This commit is contained in:
7
main.py
7
main.py
@@ -41,7 +41,12 @@ def download_and_parse():
|
||||
if row[1] is None: # col B (index 1) = item_code
|
||||
continue
|
||||
ean_raw = row[3] # col D
|
||||
ean = str(int(ean_raw)) if ean_raw is not None else ""
|
||||
if ean_raw is None:
|
||||
ean = ""
|
||||
elif isinstance(ean_raw, (int, float)):
|
||||
ean = str(int(ean_raw))
|
||||
else:
|
||||
ean = str(ean_raw).strip()
|
||||
brand_raw = row[9] # col J
|
||||
brand = str(brand_raw) if brand_raw is not None else ""
|
||||
min_box = row[10] if row[10] is not None else 1 # col K
|
||||
|
||||
Reference in New Issue
Block a user