fix: handle string EAN codes in Excel (not just integers)

This commit is contained in:
Malin
2026-03-20 11:02:40 +01:00
parent db7c31260b
commit 95cbf8d25d

View File

@@ -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