mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-08 11:17:29 +00:00
Merge pull request #92 from Hestia-Homes/feature/fix_month_end
quick fix for script
This commit is contained in:
commit
d5bd06e388
1 changed files with 21 additions and 19 deletions
|
|
@ -168,29 +168,31 @@ if not epc_ns.empty:
|
|||
filtered_dfs.append(epc_ns)
|
||||
|
||||
|
||||
final_df = None
|
||||
|
||||
if filtered_dfs:
|
||||
final_df = pd.concat(filtered_dfs).reset_index(drop=True)
|
||||
|
||||
final_df = pd.concat(filtered_dfs).reset_index(drop=True)
|
||||
if final_df:
|
||||
final_df["job_type"] = final_df["job_type"].str.lower()
|
||||
rate_card_df["job_type"] = rate_card_df["job_type"].str.lower()
|
||||
|
||||
final_df["job_type"] = final_df["job_type"].str.lower()
|
||||
rate_card_df["job_type"] = rate_card_df["job_type"].str.lower()
|
||||
# Now perform the merge
|
||||
combined_with_rates = final_df.merge(rate_card_df, on="job_type", how="left")
|
||||
import datetime
|
||||
timestamp = datetime.datetime.now().strftime('%Y-%m-%d_%H-%M')
|
||||
|
||||
# Now perform the merge
|
||||
combined_with_rates = final_df.merge(rate_card_df, on="job_type", how="left")
|
||||
import datetime
|
||||
timestamp = datetime.datetime.now().strftime('%Y-%m-%d_%H-%M')
|
||||
# Upload to sharepoint
|
||||
attribute = ['address', 'client', 'job_type', 'rate']
|
||||
master_folder_name = "2501 Accent housing"
|
||||
file_name = f"{master_folder_name}_{timestamp}.xlsx"
|
||||
combined_with_rates[attribute].to_excel(file_name, index=False)
|
||||
|
||||
# Upload to sharepoint
|
||||
attribute = ['address', 'client', 'job_type', 'rate']
|
||||
master_folder_name = "2501 Accent housing"
|
||||
file_name = f"{master_folder_name}_{timestamp}.xlsx"
|
||||
combined_with_rates[attribute].to_excel(file_name, index=False)
|
||||
file_path = os.path.abspath(file_name)
|
||||
|
||||
file_path = os.path.abspath(file_name)
|
||||
upload_to_month_end_folder(file_name, file_path, master_folder_name)
|
||||
|
||||
upload_to_month_end_folder(file_name, file_path, master_folder_name)
|
||||
|
||||
invoice_name = "rate_card.xlsx"
|
||||
file_path = os.path.abspath(invoice_name)
|
||||
rate_card_df.to_excel(invoice_name, index=False)
|
||||
upload_to_month_end_folder(invoice_name, file_path, master_folder_name)
|
||||
invoice_name = "rate_card.xlsx"
|
||||
file_path = os.path.abspath(invoice_name)
|
||||
rate_card_df.to_excel(invoice_name, index=False)
|
||||
upload_to_month_end_folder(invoice_name, file_path, master_folder_name)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue