Débug de la feature adresse_livraison

This commit is contained in:
Ambulance Clerc
2023-06-16 19:43:34 +02:00
parent 1146ff01c7
commit 5adbc77555
5 changed files with 24 additions and 15 deletions

View File

@@ -25,36 +25,44 @@ class cls_Invoice:
if debitor["name"] is not None:
concat_str += con + debitor["name"]
# con = "#chr(13)##chr(10)#"
con = "\r\n"
con = "\n"
if debitor["gender"] is not None:
concat_str += con + "Monsieur" if debitor["gender"] == "Masculin" else con + "Madame"
# con = "#chr(13)##chr(10)#"
con = "\r\n"
con = "\n"
if debitor["lastname"] is not None:
concat_str += con + self.ifNotNull(debitor["lastname"]) + " " + self.ifNotNull(
debitor["firstname"])
# con = "#chr(13)##chr(10)#"
con = "\r\n"
con = "\n"
if debitor["complement"] is not None:
concat_str += con + debitor["complement"]
# con = "#chr(13)##chr(10)#"
con = "\r\n"
con = "\n"
if debitor["street"] is not None:
concat_str += con + self.ifNotNull(debitor["street"]) + " " + self.ifNotNull(
debitor["street_number"])
# con = "#chr(13)##chr(10)#"
con = "\r\n"
con = "\n"
if debitor["city"] is not None:
concat_str += con + self.ifNotNull(debitor["postal_code"]) + " " + self.ifNotNull(
debitor["city"])
# con = "#chr(13)##chr(10)#"
con = "\r\n"
con = "\n"
if debitor["country_name"] != "Suisse":
concat_str += con + debitor["country_name"]
# con = "#chr(13)##chr(10)#"
con = "\r\n"
con = "\n"
self.Patient["addr_2"] = concat_str
self.Patient["selfish"] = self.is_addr_2_selfish(self.Patient)
def is_addr_2_selfish(self, patient):
print(patient)
temp_addr_2 = str(patient["addr_2"]).replace("Monsieur","").replace("Madame","").replace("\n","").replace(" ","")
str_compare = patient['lastname'].replace('.','') + patient['firstname'].replace('.','') + self.ifNotNull(patient['complement']).strip()+ patient['street'].strip() + patient['street_number'].strip() + patient['postal_code'].strip() + patient['city'].strip()
str_compare = str_compare.replace(" ","")
print(f"is_addr_2_selfish ? {str_compare} <> {temp_addr_2} = {str_compare == temp_addr_2}")
return str_compare == temp_addr_2
def ifNotNull(self, value, ret=""):
if value == None or value == "None":
return ret