Compare commits
3 Commits
20230620-1
...
20230620-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb0e4b4429 | ||
|
|
4387a1d00b | ||
|
|
c722af1091 |
@@ -59,7 +59,7 @@ class cls_Invoice:
|
||||
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()+ self.ifNotNull(patient['street']).strip() + self.ifNotNull(patient['street_number']).strip() + self.ifNotNull(patient['postal_code']).strip() +self.ifNotNull(patient['city']).strip()
|
||||
str_compare = self.ifNotNull(patient['lastname']).replace('.','') + self.ifNotNull(patient['firstname']).replace('.','') + self.ifNotNull(patient['complement']).strip()+ self.ifNotNull(patient['street']).strip() + self.ifNotNull(patient['street_number']).strip() + self.ifNotNull(patient['postal_code']).strip() +self.ifNotNull(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
|
||||
|
||||
@@ -1 +1 @@
|
||||
20230620-1109
|
||||
20230620-1502
|
||||
34
main.py
34
main.py
@@ -397,23 +397,33 @@ class ClercAttrib2Biz():
|
||||
|
||||
return ret
|
||||
|
||||
def compare_old_and_new_adresses(self, new, old):
|
||||
def compare_old_and_new_adresses(self, new, old, code):
|
||||
|
||||
if new['insurance_policy_number'].replace('.','') != old.AVS:
|
||||
if self.ifNotNull(new['insurance_policy_number']).replace('.','') != old.AVS:
|
||||
print("compare adresse exit avs")
|
||||
return False
|
||||
if new['lastname'].replace('.','') != old.lastName:
|
||||
if self.ifNotNull(new['lastname']).replace('.','') != old.lastName:
|
||||
print("compare adresse exit lastname")
|
||||
return False
|
||||
if new['firstname'].replace('.','') != old.firstName:
|
||||
if self.ifNotNull(new['firstname']).replace('.','') != old.firstName:
|
||||
print("compare adresse exit firstname")
|
||||
return False
|
||||
if datetime.strptime(new['birthdate'], "%Y-%m-%d").strftime("%d.%m.%Y") != old.birth:
|
||||
if datetime.strptime(self.ifNotNull(new['birthdate']), "%Y-%m-%d").strftime("%d.%m.%Y") != old.birth:
|
||||
print("compare adresse exit date")
|
||||
return False
|
||||
if f"{new['street'].strip()} {new['street_number'].strip()}" != f"{old.street.strip()}":
|
||||
print(f"({new['street'].strip()} {new['street_number'].strip()}) != [" + old.street.strip()+"]")
|
||||
if f"{self.ifNotNull(new['street']).strip()} {self.ifNotNull(new['street_number']).strip()}" != f"{self.ifNotNull(old.street).strip()}":
|
||||
print(f"compare adresse exit ({self.ifNotNull(new['street']).strip()} {self.ifNotNull(new['street_number']).strip()}) != [" + self.ifNotNull(old.street).strip()+"]")
|
||||
return False
|
||||
if f"{new['postal_code']} {new['city']}" != f"{old.npa} {old.city}":
|
||||
return False
|
||||
if new["addr_2"] != old.addr_2 and not new["selfish"]:
|
||||
if f"{self.ifNotNull(new['postal_code'])} {self.ifNotNull(new['city'])}" != f"{self.ifNotNull(old.npa)} {self.ifNotNull(old.city)}":
|
||||
print("compare adresse exit city")
|
||||
return False
|
||||
if new["addr_2"] != old.addr_2 and int(code) < 100:
|
||||
if not new["selfish"]:
|
||||
print(f"Exit selfish")
|
||||
return False
|
||||
elif old.addr_2 == None:
|
||||
print(f"Exit addr_2 = {old.addr_2}/{new['selfish']}")
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
@@ -547,7 +557,7 @@ class ClercAttrib2Biz():
|
||||
|
||||
if self.check_addresses.get():
|
||||
addresses_exist = self.addresses.get_item_by_AVS(data.Patient['insurance_policy_number'].replace(".", ""))
|
||||
if addresses_exist is not None and not self.compare_old_and_new_adresses(new=data.Patient, old=addresses_exist):
|
||||
if addresses_exist is not None and not self.compare_old_and_new_adresses(new=data.Patient, old=addresses_exist, code=data.Debtor['code']):
|
||||
|
||||
popup = Check_addresses_popup(self.fenetre, item_1=data.Patient, item_2=addresses_exist, debitor=data.Debtor, factureID=data.data['id'])
|
||||
b_address_update = popup.show()
|
||||
@@ -646,7 +656,7 @@ class ClercAttrib2Biz():
|
||||
print("NON mise à jour de l'adresse")
|
||||
|
||||
if int(data.Debtor["code"]) > 1:
|
||||
csv_col.data[42] = data.Patient["addr_2"].replace("\r\n", "#chr(13)##chr(10)#") #Adresse de livraison
|
||||
csv_col.data[42] = data.Patient["addr_2"].replace("\n", "#chr(13)##chr(10)#") #Adresse de livraison
|
||||
else:
|
||||
csv_col.data[19] = data.Debtor["code"] # Code adresse à récupérer dans recherche d'adresse automatisée
|
||||
csv_col.data[22] = data.Debtor["lastname"]
|
||||
|
||||
@@ -1 +1 @@
|
||||
VERSION = "20230620-1109"
|
||||
VERSION = "20230620-1502"
|
||||
Reference in New Issue
Block a user