Compare commits
6 Commits
20230620-1
...
20231128-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90bb7e53b0 | ||
|
|
56c23ae53c | ||
|
|
5998bf48cb | ||
|
|
5311208184 | ||
|
|
86a2b99f39 | ||
|
|
eb0e4b4429 |
@@ -7,6 +7,7 @@ class cls_Addresses:
|
|||||||
self.items.append(items)
|
self.items.append(items)
|
||||||
def get_item_by_AVS(self, seek):
|
def get_item_by_AVS(self, seek):
|
||||||
for item in self.items:
|
for item in self.items:
|
||||||
|
|
||||||
if item.AVS == seek:
|
if item.AVS == seek:
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
|||||||
@@ -37,27 +37,31 @@ class Check_addresses_popup(Toplevel):
|
|||||||
fonts = []
|
fonts = []
|
||||||
|
|
||||||
self.x_row = 0
|
self.x_row = 0
|
||||||
self.add_compares_element(new_frame=lbf_new,old_frame=lbf_old,label="N° AVS de l'adresse:",str1=item_1['insurance_policy_number'].replace('.',''), str2=item_2.AVS)
|
self.add_compares_element(new_frame=lbf_new,old_frame=lbf_old,label="N° AVS de l'adresse:",str1=self.ifNotNull(item_1['insurance_policy_number']).replace('.',''), str2=item_2.AVS)
|
||||||
self.add_compares_element(new_frame=lbf_new, old_frame=lbf_old, label="Nom:", str1=item_1['lastname'], str2=item_2.lastName)
|
self.add_compares_element(new_frame=lbf_new, old_frame=lbf_old, label="Nom:", str1=self.ifNotNull(item_1['lastname']), str2=item_2.lastName)
|
||||||
self.add_compares_element(new_frame=lbf_new, old_frame=lbf_old, label="Prénom:", str1=item_1['firstname'], str2=item_2.firstName)
|
self.add_compares_element(new_frame=lbf_new, old_frame=lbf_old, label="Prénom:", str1=self.ifNotNull(item_1['firstname']), str2=item_2.firstName)
|
||||||
self.add_compares_element(new_frame=lbf_new, old_frame=lbf_old, label="Date de naissance:", str1=datetime.strptime(item_1['birthdate'], "%Y-%m-%d").strftime("%d.%m.%Y"), str2=item_2.birth)
|
self.add_compares_element(new_frame=lbf_new, old_frame=lbf_old, label="Date de naissance:", str1=datetime.strptime(self.ifNotNull(item_1['birthdate']), "%Y-%m-%d").strftime("%d.%m.%Y"), str2=item_2.birth)
|
||||||
self.add_compares_element(new_frame=lbf_new, old_frame=lbf_old, label="Adresse:", str1=f"{item_1['street'].strip()} {item_1['street_number'].strip()}", str2=item_2.street.strip())
|
self.add_compares_element(new_frame=lbf_new, old_frame=lbf_old, label="Adresse:", str1=f"{self.ifNotNull(item_1['street']).strip()} {self.ifNotNull(item_1['street_number']).strip()}", str2=item_2.street.strip())
|
||||||
self.add_compares_element(new_frame=lbf_new, old_frame=lbf_old, label="Complément:", str1=f"{item_1['complement'].strip()}", str2=item_2.street_cpl.strip())
|
self.add_compares_element(new_frame=lbf_new, old_frame=lbf_old, label="Complément:", str1=f"{self.ifNotNull(item_1['complement']).strip()}", str2=item_2.street_cpl.strip())
|
||||||
self.add_compares_element(new_frame=lbf_new, old_frame=lbf_old, label="NPA/Localité:", str1=f"{item_1['postal_code']} {item_1['city']}", str2=f"{item_2.npa} {item_2.city}")
|
self.add_compares_element(new_frame=lbf_new, old_frame=lbf_old, label="NPA/Localité:", str1=f"{self.ifNotNull(item_1['postal_code'])} {self.ifNotNull(item_1['city'])}", str2=f"{item_2.npa} {item_2.city}")
|
||||||
|
|
||||||
|
|
||||||
if int(debitor["code"]) < 100:
|
if int(debitor["code"]) < 100:
|
||||||
|
if item_1["selfish"]:
|
||||||
|
force_color = "green"
|
||||||
|
else:
|
||||||
|
force_color = None
|
||||||
self.add_compares_element(new_frame=lbf_addr_2_new, old_frame=lbf_addr_2_old, label="Adresse livraison:", str1=item_1["addr_2"],
|
self.add_compares_element(new_frame=lbf_addr_2_new, old_frame=lbf_addr_2_old, label="Adresse livraison:", str1=item_1["addr_2"],
|
||||||
str2=self.ifNotNull(item_2.addr_2))
|
str2=self.ifNotNull(item_2.addr_2),force_color_1=force_color)
|
||||||
|
|
||||||
|
|
||||||
str_address_1 += item_1['insurance_policy_number'].replace('.', '')
|
str_address_1 += self.ifNotNull(item_1['insurance_policy_number']).replace('.', '')
|
||||||
str_address_1 += item_1['lastname'].strip()
|
str_address_1 += self.ifNotNull(item_1['lastname']).strip()
|
||||||
str_address_1 += item_1['firstname'].strip()
|
str_address_1 +=self.ifNotNull( item_1['firstname']).strip()
|
||||||
str_address_1 += datetime.strptime(item_1['birthdate'], "%Y-%m-%d").strftime("%d.%m.%Y")
|
str_address_1 += datetime.strptime(item_1['birthdate'], "%Y-%m-%d").strftime("%d.%m.%Y")
|
||||||
str_address_1 += f"{item_1['street'].strip()} {item_1['street_number'].strip()}"
|
str_address_1 += f"{self.ifNotNull(item_1['street']).strip()} {self.ifNotNull(item_1['street_number']).strip()}"
|
||||||
str_address_1 += f"{item_1['complement'].strip()}"
|
str_address_1 += f"{self.ifNotNull(item_1['complement']).strip()}"
|
||||||
str_address_1 += f"{item_1['postal_code']} {item_1['city']}"
|
str_address_1 += f"{self.ifNotNull(item_1['postal_code'])} {self.ifNotNull(item_1['city'])}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -104,19 +108,23 @@ class Check_addresses_popup(Toplevel):
|
|||||||
return ret
|
return ret
|
||||||
return value.strip()
|
return value.strip()
|
||||||
|
|
||||||
def add_compares_element(self,new_frame, old_frame,str1, str2, label):
|
def add_compares_element(self,new_frame, old_frame,str1, str2, label, force_color_1=None):
|
||||||
label_font = font.Font(weight='bold', size=9)
|
label_font = font.Font(weight='bold', size=9)
|
||||||
|
|
||||||
value_color = "black"
|
value_color_1 = "black"
|
||||||
|
value_color_2 = "black"
|
||||||
con = ""
|
con = ""
|
||||||
if str1 != str2:
|
if str1 != str2:
|
||||||
value_color = "red"
|
value_color_1 = "red"
|
||||||
|
value_color_2 = "red"
|
||||||
con = "*"
|
con = "*"
|
||||||
|
if force_color_1 is not None:
|
||||||
|
value_color_1 = force_color_1
|
||||||
|
|
||||||
Label(new_frame, text=str(label), font=label_font).grid(row=self.x_row, column=0, sticky="W")
|
Label(new_frame, text=str(label), font=label_font).grid(row=self.x_row, column=0, sticky="W")
|
||||||
Label(new_frame, text=con + str(str1) + con, fg=value_color, anchor="w", justify=LEFT).grid(row=self.x_row, column=1, sticky="W")
|
Label(new_frame, text=con + str(str1) + con, fg=value_color_1, anchor="w", justify=LEFT).grid(row=self.x_row, column=1, sticky="W")
|
||||||
Label(old_frame, text=str(label), font=label_font).grid(row=self.x_row, column=0, sticky="W")
|
Label(old_frame, text=str(label), font=label_font).grid(row=self.x_row, column=0, sticky="W")
|
||||||
Label(old_frame, text=con + str(str2) + con, fg=value_color, anchor="w", justify=LEFT).grid(row=self.x_row, column=1, sticky="W")
|
Label(old_frame, text=con + str(str2) + con, fg=value_color_2, anchor="w", justify=LEFT).grid(row=self.x_row, column=1, sticky="W")
|
||||||
|
|
||||||
self.x_row += 1
|
self.x_row += 1
|
||||||
|
|
||||||
@@ -175,6 +183,8 @@ class Check_debitor_popup(Toplevel):
|
|||||||
Label(lbf_new, text="Débiteur sélectionné dans Attrib", font=label_font).grid(row=1, column=0, sticky="W")
|
Label(lbf_new, text="Débiteur sélectionné dans Attrib", font=label_font).grid(row=1, column=0, sticky="W")
|
||||||
text_name = Text(lbf_new, fg="red", height=3,width= 30)
|
text_name = Text(lbf_new, fg="red", height=3,width= 30)
|
||||||
text_name.grid(row=1, column=1, sticky="W")
|
text_name.grid(row=1, column=1, sticky="W")
|
||||||
|
if 'name' not in debitor:
|
||||||
|
debitor['name'] = ""
|
||||||
text_name.insert(END,debitor['name'])
|
text_name.insert(END,debitor['name'])
|
||||||
text_name.configure(state='disabled')
|
text_name.configure(state='disabled')
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
20230620-1453
|
20231128-1459
|
||||||
40
main.py
40
main.py
@@ -289,7 +289,6 @@ class ClercAttrib2Biz():
|
|||||||
file_addresses_path = os.path.join(temp_dir, f"adresses.dbf")
|
file_addresses_path = os.path.join(temp_dir, f"adresses.dbf")
|
||||||
if os.path.exists(file_addresses_path):
|
if os.path.exists(file_addresses_path):
|
||||||
for record in DBF(file_addresses_path, load=True):
|
for record in DBF(file_addresses_path, load=True):
|
||||||
|
|
||||||
o_addresse = cls_addresse()
|
o_addresse = cls_addresse()
|
||||||
o_addresse.AVS = str(record["AD_CODE"])
|
o_addresse.AVS = str(record["AD_CODE"])
|
||||||
o_addresse.lastName =str( record["AD_NOM"])
|
o_addresse.lastName =str( record["AD_NOM"])
|
||||||
@@ -398,32 +397,34 @@ class ClercAttrib2Biz():
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
def compare_old_and_new_adresses(self, new, old, code):
|
def compare_old_and_new_adresses(self, new, old, code):
|
||||||
|
print(f"compare_old_and_new_adresses ")
|
||||||
if new['insurance_policy_number'].replace('.','') != old.AVS:
|
if self.ifNotNull(new['insurance_policy_number']).replace('.','') != old.AVS:
|
||||||
print("compare adresse exit avs")
|
print("compare adresse exit avs")
|
||||||
return False
|
return False
|
||||||
if new['lastname'].replace('.','') != old.lastName:
|
if self.ifNotNull(new['lastname']).replace('.','') != old.lastName:
|
||||||
print("compare adresse exit lastname")
|
print("compare adresse exit lastname")
|
||||||
return False
|
return False
|
||||||
if new['firstname'].replace('.','') != old.firstName:
|
if self.ifNotNull(new['firstname']).replace('.','') != old.firstName:
|
||||||
print("compare adresse exit firstname")
|
print("compare adresse exit firstname")
|
||||||
return False
|
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")
|
print("compare adresse exit date")
|
||||||
return False
|
return False
|
||||||
if f"{new['street'].strip()} {new['street_number'].strip()}" != f"{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 ({new['street'].strip()} {new['street_number'].strip()}) != [" + 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
|
return False
|
||||||
if f"{new['postal_code']} {new['city']}" != f"{old.npa} {old.city}":
|
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")
|
print("compare adresse exit city")
|
||||||
return False
|
return False
|
||||||
if new["addr_2"] != old.addr_2 and int(code) < 100:
|
if new["addr_2"] != old.addr_2 and int(code) < 100:
|
||||||
if not new["selfish"]:
|
if not new["selfish"]:
|
||||||
print(f"Exit selfish")
|
print(f"Exit selfish")
|
||||||
return False
|
return False
|
||||||
elif old.addr_2 == None:
|
if old.addr_2 != "None":
|
||||||
print(f"Exit addr_2 = {old.addr_2}/{new['selfish']}")
|
print(f"Exit addr_2 = {old.addr_2}/{new['selfish']}")
|
||||||
|
print(old.addr_2 != "None")
|
||||||
return False
|
return False
|
||||||
|
print("return True (same)")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@@ -443,8 +444,10 @@ class ClercAttrib2Biz():
|
|||||||
|
|
||||||
cur_invoice_index = 0
|
cur_invoice_index = 0
|
||||||
|
|
||||||
|
total_facture_total = 0
|
||||||
|
total_facture_amount = 0
|
||||||
for ele in data["invoices"]:
|
for ele in data["invoices"]:
|
||||||
|
|
||||||
cur_invoice_index += 1
|
cur_invoice_index += 1
|
||||||
self.progress_bar["value"] = cur_invoice_index / self.count_facture * 100
|
self.progress_bar["value"] = cur_invoice_index / self.count_facture * 100
|
||||||
b_address_update = True
|
b_address_update = True
|
||||||
@@ -563,7 +566,7 @@ class ClercAttrib2Biz():
|
|||||||
b_address_update = popup.show()
|
b_address_update = popup.show()
|
||||||
mode_selected = "Attrib" if b_address_update else "Winbiz"
|
mode_selected = "Attrib" if b_address_update else "Winbiz"
|
||||||
self.logger.warning(
|
self.logger.warning(
|
||||||
f"Adresse connue donnée [{mode_selected}] conservé: : {data.data['id']} / {data.Patient['fip_number']} {data.Debtor['code']} {data.Debtor['lastname']} {data.Debtor['firstname']}")
|
f"Adresse connue données {mode_selected} conservées: {data.data['id']} / {data.Patient['fip_number']} {data.Debtor['code']} {data.Debtor['lastname']} {data.Debtor['firstname']}")
|
||||||
print(f"Result Popup: {b_address_update}")
|
print(f"Result Popup: {b_address_update}")
|
||||||
else:
|
else:
|
||||||
b_address_update = True
|
b_address_update = True
|
||||||
@@ -573,7 +576,11 @@ class ClercAttrib2Biz():
|
|||||||
|
|
||||||
b_HRF = False
|
b_HRF = False
|
||||||
sHRF = ""
|
sHRF = ""
|
||||||
|
|
||||||
|
facture_total = 0
|
||||||
for article in data.Articles:
|
for article in data.Articles:
|
||||||
|
if 'price' in article:
|
||||||
|
facture_total += float(article['price'])
|
||||||
|
|
||||||
if "code" in article.keys():
|
if "code" in article.keys():
|
||||||
if article["code"] == "HRF":
|
if article["code"] == "HRF":
|
||||||
@@ -581,9 +588,12 @@ class ClercAttrib2Biz():
|
|||||||
sHRF = article["line_1"].replace("h", ":")
|
sHRF = article["line_1"].replace("h", ":")
|
||||||
print(f"pass HRF => {data.Patient['fip_number']} = {b_HRF}")
|
print(f"pass HRF => {data.Patient['fip_number']} = {b_HRF}")
|
||||||
#self.logger.warning(f"HRF: {data.data['id']}")
|
#self.logger.warning(f"HRF: {data.data['id']}")
|
||||||
break
|
|
||||||
|
|
||||||
|
|
||||||
|
print(f"Lecture de la facture #{cur_invoice_index} {ele['id']} montant total = {ele['total_price']} <> {facture_total}")
|
||||||
|
if float(ele['total_price']) != facture_total:
|
||||||
|
print(f"ERROR NOT SAME PRICE")
|
||||||
|
total_facture_total += facture_total
|
||||||
|
total_facture_amount += float(ele['total_price'])
|
||||||
|
|
||||||
for article in data.Articles:
|
for article in data.Articles:
|
||||||
self.bs_counter += 1
|
self.bs_counter += 1
|
||||||
@@ -771,6 +781,8 @@ class ClercAttrib2Biz():
|
|||||||
|
|
||||||
lines.append(csv_col.data)
|
lines.append(csv_col.data)
|
||||||
csv_col = None
|
csv_col = None
|
||||||
|
|
||||||
|
print(f"total_facture_total = {total_facture_total} <> {total_facture_amount}")
|
||||||
if not self.export_one_file.get():
|
if not self.export_one_file.get():
|
||||||
with open(os.path.join(dest_dir, f"bizexdoc_" + filename.replace(".json", "") + ".csv"), "w+", errors='replace', newline='') as csv_file:
|
with open(os.path.join(dest_dir, f"bizexdoc_" + filename.replace(".json", "") + ".csv"), "w+", errors='replace', newline='') as csv_file:
|
||||||
wr = csv.writer(csv_file, delimiter=';')
|
wr = csv.writer(csv_file, delimiter=';')
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
VERSION = "20230620-1453"
|
VERSION = "20231128-1459"
|
||||||
Reference in New Issue
Block a user