Compare commits

...

5 Commits

Author SHA1 Message Date
Ambulance Clerc
1907632dca Ajout du pays dans adresse livraison si pas suisse 2022-07-29 09:37:05 +02:00
Ambulance Clerc
6d9b991c04 Changement dans les colonnes code présentation et méthode de payement toujours = 3
Prise en charge des EBILL pour code 101
2022-07-15 10:12:49 +02:00
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
Ambulance Clerc
0d499cd0f6 Inversion Street et complément (position) dans adresse livraison 2022-07-05 13:42:12 +02:00
3 changed files with 32 additions and 10 deletions

View File

@@ -1 +1 @@
20220630-1013 20220729-0936

38
main.py
View File

@@ -353,6 +353,23 @@ class ClercAttrib2Biz():
return ret 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): def parseFile(self, data, filename):
self.index_counter += 1 self.index_counter += 1
@@ -436,7 +453,7 @@ class ClercAttrib2Biz():
if self.check_addresses.get(): if self.check_addresses.get():
addresses_exist = self.addresses.get_item_by_AVS(data.Patient['insurance_policy_number'].replace(".", "")) 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']) 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() b_address_update = popup.show()
print(f"Result Popup: {b_address_update}") print(f"Result Popup: {b_address_update}")
@@ -546,15 +563,19 @@ class ClercAttrib2Biz():
if data.Debtor["lastname"] is not None: if data.Debtor["lastname"] is not None:
concat_str += con + self.ifNotNull(data.Debtor["lastname"]) + " " + self.ifNotNull(data.Debtor["firstname"]) concat_str += con + self.ifNotNull(data.Debtor["lastname"]) + " " + self.ifNotNull(data.Debtor["firstname"])
con = "#chr(13)##chr(10)#" con = "#chr(13)##chr(10)#"
if data.Debtor["street"] is not None:
concat_str += con + self.ifNotNull(data.Debtor["street"]) + " " + self.ifNotNull(data.Debtor["street_number"])
con = "#chr(13)##chr(10)#"
if data.Debtor["complement"] is not None: if data.Debtor["complement"] is not None:
concat_str += con + data.Debtor["complement"] concat_str += con + data.Debtor["complement"]
con = "#chr(13)##chr(10)#" con = "#chr(13)##chr(10)#"
if data.Debtor["street"] is not None:
concat_str += con + self.ifNotNull(data.Debtor["street"]) + " " + self.ifNotNull(data.Debtor["street_number"])
con = "#chr(13)##chr(10)#"
if data.Debtor["city"] is not None: if data.Debtor["city"] is not None:
concat_str += con + self.ifNotNull(data.Debtor["postal_code"]) + " " + self.ifNotNull(data.Debtor["city"]) concat_str += con + self.ifNotNull(data.Debtor["postal_code"]) + " " + self.ifNotNull(data.Debtor["city"])
con = "#chr(13)##chr(10)#" con = "#chr(13)##chr(10)#"
if data.Debtor["country_name"] != "Suisse":
concat_str += con + data.Debtor["country_name"]
con = "#chr(13)##chr(10)#"
@@ -632,8 +653,9 @@ class ClercAttrib2Biz():
csv_col.data[72] = "BU - 73 - aff" csv_col.data[72] = "BU - 73 - aff"
csv_col.data[73] = 0 csv_col.data[73] = 0
csv_col.data[115] = self.ifNotNull(data.Patient["lastname"]) + " " + self.ifNotNull(data.Patient["firstname"]) #Objet facture
csv_col.data[108] = data.Patient["complement"] 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 "" 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"]: 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"] csv_col.data[109] += ", " + data.Patient["insurance_policy_number"]
@@ -660,8 +682,8 @@ class ClercAttrib2Biz():
csv_col.data[116] = self.ifNotNull(data.Patient["category"]) + " - " + self.ifNotNull(data.Intervention["type"]) csv_col.data[116] = self.ifNotNull(data.Patient["category"]) + " - " + self.ifNotNull(data.Intervention["type"])
csv_col.data[118] = data.Intervention["kilometers"] csv_col.data[118] = data.Intervention["kilometers"]
csv_col.data[135] = data.Intervention["base_name"] csv_col.data[135] = data.Intervention["base_name"]
csv_col.data[136] = 2 if data.Intervention["base_name"] == "Uvrier" else 3 csv_col.data[136] = 3 if data.Debtor["code"] != "101" else "EBILL" #code présentation de facture
csv_col.data[146] = csv_col.data[136] csv_col.data[146] = 3 #Code méthode de payement définit à 3
csv_col.data[168] = 1 if data.Intervention["team_name"] == "Planification" else 2 csv_col.data[168] = 1 if data.Intervention["team_name"] == "Planification" else 2
csv_col.data[169] = data.Patient['insurance_policy_number'] csv_col.data[169] = data.Patient['insurance_policy_number']

View File

@@ -1 +1 @@
VERSION = "20220630-1013" VERSION = "20220729-0936"