Débug check adress

This commit is contained in:
Ambulance Clerc
2022-07-05 16:07:29 +02:00
parent 0d499cd0f6
commit 1a7d649651
3 changed files with 20 additions and 3 deletions

View File

@@ -1 +1 @@
20220705-1341
20220705-1607

19
main.py
View File

@@ -353,6 +353,23 @@ class ClercAttrib2Biz():
return ret
def compare_old_and_new_adresses(self, new, old):
if new['insurance_policy_number'].replace('.','') != old.AVS:
return False
if new['lastname'].replace('.','') != old.lastName:
return False
if new['firstname'].replace('.','') != old.firstName:
return False
if datetime.strptime(new['birthdate'], "%Y-%m-%d").strftime("%d.%m.%Y") != old.birth:
return False
if f"{new['street']} {new['street_number']}" != old.street:
return False
if f"{new['postal_code']} {new['city']}" != f"{old.npa} {old.city}":
return False
return True
def parseFile(self, data, filename):
self.index_counter += 1
@@ -436,7 +453,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:
if addresses_exist is not None and not self.compare_old_and_new_adresses(new=data.Patient, old=addresses_exist):
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()
print(f"Result Popup: {b_address_update}")

View File

@@ -1 +1 @@
VERSION = "20220705-1341"
VERSION = "20220705-1607"