From 2e4ea93c476ac353258ab6f895e026558e50d540 Mon Sep 17 00:00:00 2001 From: Sam <7569798+Samlant@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:16:54 -0500 Subject: [PATCH] code cleanup fixed when $35 agent fee was applied to Concept's premium; removed ambiguous date terms from string prior to parsing using datefinder; cleaned up some duplicate html code in the email module to reduce redundancy and improve clarity. --- app/model/email/email.py | 6 +-- app/model/email/html.py | 44 ++++++++++++++----- .../carriers/builders/concept.py | 3 +- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/app/model/email/email.py b/app/model/email/email.py index fe3c71d..26be195 100644 --- a/app/model/email/email.py +++ b/app/model/email/email.py @@ -20,13 +20,13 @@ class EmailHandler: username: Optional[str] = None img_sig_url: Optional[str] = None attachments_list: Optional[list] = None - greeting_style: str = "font-size=14px;color:#1F3864;" - body_style: str = "font-size=14px;color:#1F3864;" + greeting_style: str = "font-size:14px;color:#1F3864;" + body_style: str = "font-size:14px;color:#1F3864;" salutation_style: str = ( "margin:0in;font-size:14px;font-family:Calibri,sans-serif;color:#1F3864;" ) username_style: str = ( - "margin:0in;font-size=14px;font-family:Calibri,sans-serif;color:#1F3864;" + "margin:0in;font-size:14px;font-family:Calibri,sans-serif;color:#1F3864;" ) def view_letter(self) -> bool: diff --git a/app/model/email/html.py b/app/model/email/html.py index d7de114..772bba6 100644 --- a/app/model/email/html.py +++ b/app/model/email/html.py @@ -69,19 +69,39 @@ def make_signature(sig_img: str, signature_settings: dict[str, str]) -> str: office_street = signature_settings["office_street"] office_city_st_zip = signature_settings["office_city_st_zip"] signature = f""" -

NOVAMAR INSURANCE GROUP

+

+ NOVAMAR INSURANCE GROUP +
-

Main:(800)-823-2798

-

Office :{office_phone}

-

Fax:(941)-328-3598


-

{office_street}

-

{office_city_st_zip}


-

www.novamarinsurance.com

-

www.novamarinsurance.com.mx

- -

-

Established in 1987 with offices in: Seattle | Newport Beach | San Diego | Sarasota | Jacksonville | Puerto Vallarta | Cancun | San Miguel de Allende

-

Please be advised that coverage is not bound, renewed, amended or in force unless confirmed in writing by a Novamar Insurance Group agent or by the represented company.

+
+ Main:(800)-823-2798 +
+ Office :{office_phone} +

+ Fax:(941)-328-3598 +
+ {office_street} +
+ {office_city_st_zip} +
+ www.novamarinsurance.com +
+ www.novamarinsurance.com.mx +

+
+ +

+ + + + +

+
+

+ Established in 1987 with offices in: Seattle | Newport Beach | San Diego | Sarasota | Jacksonville | Puerto Vallarta | Cancun | San Miguel de Allende +
+ Please be advised that coverage is not bound, renewed, amended or in force unless confirmed in writing by a Novamar Insurance Group agent or by the represented company. +

""" if sig_img != "": signature = f"" + signature diff --git a/app/model/surplus_lines/surplus_lines/carriers/builders/concept.py b/app/model/surplus_lines/surplus_lines/carriers/builders/concept.py index 9be8f26..0e54100 100644 --- a/app/model/surplus_lines/surplus_lines/carriers/builders/concept.py +++ b/app/model/surplus_lines/surplus_lines/carriers/builders/concept.py @@ -100,6 +100,7 @@ def get_eff_date(self) -> datetime: if "with effect from" in block: break x = self.pages[0][i] + x = x.replace("00.01", "") dates = datefinder.find_dates(x) y = [] for date in dates: @@ -151,6 +152,7 @@ def get_premiums(self) -> bool: x = self.pages[0][i].partition("US$")[2].partition("cancelling")[0] premium = x.strip().replace(",", "") premium = float(premium) + premium += 35 elif ( self.user_doc_type == "cancel" or self.user_doc_type == "rp" @@ -163,7 +165,6 @@ def get_premiums(self) -> bool: premium = float(premium) else: raise ValueError - premium += 35 self.premiums.append(premium) return True