Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -24,8 +24,8 @@ def parse_excel_file(file_path):
|
|
| 24 |
materials = []
|
| 25 |
for _, row in df.iterrows():
|
| 26 |
try:
|
| 27 |
-
quantity = row[resolved_columns["تعداد"]]
|
| 28 |
-
if pd.isna(quantity) or
|
| 29 |
continue
|
| 30 |
except:
|
| 31 |
continue
|
|
@@ -33,7 +33,7 @@ def parse_excel_file(file_path):
|
|
| 33 |
material = {
|
| 34 |
"code": str(row[resolved_columns["کد"]]).strip(),
|
| 35 |
"description": str(row[resolved_columns["عنوان"]]).strip(),
|
| 36 |
-
"quantity":
|
| 37 |
"unit": str(row[resolved_columns["واحد"]]).strip()
|
| 38 |
}
|
| 39 |
materials.append(material)
|
|
|
|
| 24 |
materials = []
|
| 25 |
for _, row in df.iterrows():
|
| 26 |
try:
|
| 27 |
+
quantity = float(row[resolved_columns["تعداد"]])
|
| 28 |
+
if pd.isna(quantity) or quantity <= 0:
|
| 29 |
continue
|
| 30 |
except:
|
| 31 |
continue
|
|
|
|
| 33 |
material = {
|
| 34 |
"code": str(row[resolved_columns["کد"]]).strip(),
|
| 35 |
"description": str(row[resolved_columns["عنوان"]]).strip(),
|
| 36 |
+
"quantity": quantity,
|
| 37 |
"unit": str(row[resolved_columns["واحد"]]).strip()
|
| 38 |
}
|
| 39 |
materials.append(material)
|