Compare commits

..

2 Commits

Author SHA1 Message Date
Ambulance Clerc
e35a24030d Débug des rappels avec inversion de deux champs dans l'objet de facture 2022-07-08 10:16:09 +02:00
Ambulance Clerc
1a7d649651 Débug check adress 2022-07-05 16:07:29 +02:00
3 changed files with 23 additions and 5 deletions

View File

@@ -1 +1 @@
20220705-1341
20220708-1015

24
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}")
@@ -632,8 +649,9 @@ class ClercAttrib2Biz():
csv_col.data[72] = "BU - 73 - aff"
csv_col.data[73] = 0
csv_col.data[115] = self.ifNotNull(data.Patient["lastname"]) + " " + self.ifNotNull(data.Patient["firstname"])
csv_col.data[108] = data.Patient["complement"]
#Objet facture
csv_col.data[108] = self.ifNotNull(data.Patient["lastname"]) + " " + self.ifNotNull(data.Patient["firstname"])
csv_col.data[115] = data.Patient["complement"]
csv_col.data[109] = datetime.strptime(data.Patient["birthdate"], "%Y-%m-%d").strftime("%d.%m.%Y") if data.Patient["birthdate"] is not None else ""
if data.Patient["insurance_policy_number"] is not None and '-' not in data.Patient["insurance_policy_number"]:
csv_col.data[109] += ", " + data.Patient["insurance_policy_number"]

View File

@@ -1 +1 @@
VERSION = "20220705-1341"
VERSION = "20220708-1015"