From 56c23ae53ca822cc4a18f254119107f1b02a7a2a Mon Sep 17 00:00:00 2001 From: Ambulance Clerc Date: Tue, 31 Oct 2023 11:43:30 +0100 Subject: [PATCH] =?UTF-8?q?d=C3=A9bug=20=20comparaison=20HRF=20et=20suppre?= =?UTF-8?q?ssion=20du=20break=20au=20moment=20du=20HRF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dl_version | 2 +- main.py | 19 +++++++++++++++---- version.py | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/dl_version b/dl_version index 8671060..927a568 100644 --- a/dl_version +++ b/dl_version @@ -1 +1 @@ -20230620-1559 \ No newline at end of file +20231031-1142 \ No newline at end of file diff --git a/main.py b/main.py index c409003..38feb15 100644 --- a/main.py +++ b/main.py @@ -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=';') diff --git a/version.py b/version.py index 58a28d5..f508bdb 100644 --- a/version.py +++ b/version.py @@ -1 +1 @@ -VERSION = "20230620-1559" \ No newline at end of file +VERSION = "20231031-1142" \ No newline at end of file