hardik27 commited on
Commit
0dda2ad
·
verified ·
1 Parent(s): 0fa910d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -142,9 +142,9 @@ def map_data_to_template(excel_file, mapping_file):
142
  extracted_data = extracted_data[~extracted_data['SchDate'].isna()]
143
  mapped_data = extracted_data.merge(mapping_data, on =['Part No.'],how='outer')[['Item Code','SchDate','Qty']]
144
  mapped_data = mapped_data[~mapped_data["SchDate"].isna()]
 
145
  mapped_data['SOType'] = "R"
146
- mapped_data = mapped_data[~mapped_data["SchDate"].isna()]
147
-
148
  return mapped_data
149
 
150
  def save_mapping_file_to_drive():
@@ -261,9 +261,9 @@ def main():
261
  if unmapped_part_no>0:
262
  st.markdown("#### There are {} Part No. with No ItemCode present. Upload a new file after mapping them".format(unmapped_part_no))
263
  mapping_uploaded_file = st.file_uploader("Upload the Data Master file with Item Code mapping", type=["xlsx","ods"])
264
- # else:
265
- # st.markdown("#### Using the Mapping file available in Google Drive")
266
- # mapping_uploaded_file = MAPPING_FILENAME
267
 
268
  if mapping_uploaded_file is not None:
269
  # st.write("Uploaded Mapping Excel file:", mapping_uploaded_file.name)
 
142
  extracted_data = extracted_data[~extracted_data['SchDate'].isna()]
143
  mapped_data = extracted_data.merge(mapping_data, on =['Part No.'],how='outer')[['Item Code','SchDate','Qty']]
144
  mapped_data = mapped_data[~mapped_data["SchDate"].isna()]
145
+ mapped_data = mapped_data[~mapped_data["SchDate"].str.strip().isin(["",None])]
146
  mapped_data['SOType'] = "R"
147
+
 
148
  return mapped_data
149
 
150
  def save_mapping_file_to_drive():
 
261
  if unmapped_part_no>0:
262
  st.markdown("#### There are {} Part No. with No ItemCode present. Upload a new file after mapping them".format(unmapped_part_no))
263
  mapping_uploaded_file = st.file_uploader("Upload the Data Master file with Item Code mapping", type=["xlsx","ods"])
264
+ else:
265
+ st.markdown("#### All Part No. are mapped with ItemCode so using the Mapping file available in Google Drive")
266
+ mapping_uploaded_file = MAPPING_FILENAME
267
 
268
  if mapping_uploaded_file is not None:
269
  # st.write("Uploaded Mapping Excel file:", mapping_uploaded_file.name)