débug comparaison HRF et suppression du break au moment du HRF

This commit is contained in:
Ambulance Clerc
2023-10-31 11:43:30 +01:00
parent 5998bf48cb
commit 56c23ae53c
3 changed files with 17 additions and 6 deletions

19
main.py
View File

@@ -444,8 +444,10 @@ class ClercAttrib2Biz():
cur_invoice_index = 0
total_facture_total = 0
total_facture_amount = 0
for ele in data["invoices"]:
cur_invoice_index += 1
self.progress_bar["value"] = cur_invoice_index / self.count_facture * 100
b_address_update = True
@@ -564,7 +566,7 @@ class ClercAttrib2Biz():
b_address_update = popup.show()
mode_selected = "Attrib" if b_address_update else "Winbiz"
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}")
else:
b_address_update = True
@@ -574,7 +576,11 @@ class ClercAttrib2Biz():
b_HRF = False
sHRF = ""
facture_total = 0
for article in data.Articles:
if 'price' in article:
facture_total += float(article['price'])
if "code" in article.keys():
if article["code"] == "HRF":
@@ -582,9 +588,12 @@ class ClercAttrib2Biz():
sHRF = article["line_1"].replace("h", ":")
print(f"pass HRF => {data.Patient['fip_number']} = {b_HRF}")
#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:
self.bs_counter += 1
@@ -772,6 +781,8 @@ class ClercAttrib2Biz():
lines.append(csv_col.data)
csv_col = None
print(f"total_facture_total = {total_facture_total} <> {total_facture_amount}")
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:
wr = csv.writer(csv_file, delimiter=';')