From eca7779b447e53386fd4502ff161a5d7b10e4561 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 14 Apr 2025 14:06:31 +0000 Subject: [PATCH] sharepoint warmfront to get csv but installer will be different --- etl/hubspot_to_invoice.py | 4 +++- etl/surveyPrice/surveyPrice.py | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/etl/hubspot_to_invoice.py b/etl/hubspot_to_invoice.py index bc3d466..4b6fc4c 100644 --- a/etl/hubspot_to_invoice.py +++ b/etl/hubspot_to_invoice.py @@ -11,4 +11,6 @@ from etl.surveyPrice.surveyPrice import SurveyPrice sp = SurveyPrice() -sp.get_cavity_pricing_table("JJC_EMPTIES") \ No newline at end of file +sp.get_cavity_pricing_table("JJC - EMPTIES") +df = sp.get_all_surveys_from_hubspot() +df \ No newline at end of file diff --git a/etl/surveyPrice/surveyPrice.py b/etl/surveyPrice/surveyPrice.py index e27680f..10fb18f 100644 --- a/etl/surveyPrice/surveyPrice.py +++ b/etl/surveyPrice/surveyPrice.py @@ -8,7 +8,7 @@ class SurveyPrice(): A class to work out all prices and uploads to sharepoint for review """ def __init__(self): - self.sharepoint_client = SharePointScraper(SharePointInstaller.WARMFRONT) + self.warmfront_sharepoint_client = SharePointScraper(SharePointInstaller.WARMFRONT) self.master_rate_card_path = None self.all_hubspot_submissions = None self.download_price_card() @@ -27,14 +27,14 @@ class SurveyPrice(): def download_price_card(self): url = None - for files in self.sharepoint_client.get_folders_in_path("/Commercials/Rate Cards")['value']: + for files in self.warmfront_sharepoint_client.get_folders_in_path("/Commercials/Rate Cards")['value']: if files['name'] == "MASTER RATE CARD.xlsx": url = files['@microsoft.graph.downloadUrl'] break if url: - content = self.sharepoint_client.get_file_content(url) - self.master_rate_card_path = self.sharepoint_client.create_temp_file(content, "rate_card/rate_card_all.xlsx") + content = self.warmfront_sharepoint_client.get_file_content(url) + self.master_rate_card_path = self.warmfront_sharepoint_client.create_temp_file(content, "rate_card/rate_card_all.xlsx") return self.master_rate_card_path