Compare commits
6 Commits
20220822-1
...
20220902-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
191821d81d | ||
|
|
99a89585b5 | ||
|
|
e60ed4b5fa | ||
|
|
4c75a6167b | ||
|
|
842ae5fb69 | ||
|
|
355d17810f |
@@ -235,7 +235,10 @@ class Input_popup(Toplevel):
|
||||
|
||||
label_font = font.Font(weight='bold', size=9)
|
||||
Label(lbf_new, text="", font=label_font).grid(row=0, column=0, sticky="W")
|
||||
Entry(lbf_new, textvariable=self.inp_value, width=100).grid(row=0, column=1, sticky="W", pady=10)
|
||||
input_entry = Entry(lbf_new, textvariable=self.inp_value, width=100)
|
||||
input_entry.grid(row=0, column=1, sticky="W", pady=10)
|
||||
input_entry.focus()
|
||||
self.after(0,input_entry.focus)
|
||||
|
||||
|
||||
self.btn = Button(self, text="Valider", command=self.destroy)
|
||||
|
||||
@@ -1 +1 @@
|
||||
20220822-1735
|
||||
20220902-1508
|
||||
33
main.py
33
main.py
@@ -285,7 +285,7 @@ class ClercAttrib2Biz():
|
||||
self.count_facture = 0
|
||||
x = 0
|
||||
|
||||
self.export_filename = f"bizexdoc_export_Attrib_v{datetime.now().year}{datetime.now().month}{datetime.now().month}{datetime.now().hour}{datetime.now().minute}.csv"
|
||||
self.export_filename = f"bizexdoc_export_Attrib_v{datetime.now().year}{datetime.now().month}{datetime.now().day}{datetime.now().hour}{datetime.now().minute}.csv"
|
||||
|
||||
if self.export_format_biz:
|
||||
if self.export_one_file.get() and os.path.exists(os.path.join(dest_dir, self.export_filename)):
|
||||
@@ -306,7 +306,7 @@ class ClercAttrib2Biz():
|
||||
|
||||
print(f"remove src.csv => {os.path.join(dest_dir, 'src.csv')}")
|
||||
|
||||
|
||||
self.progress_bar["value"] = 0
|
||||
for filename in os.listdir(dir):
|
||||
x += 1
|
||||
if ".json" in filename:
|
||||
@@ -315,11 +315,17 @@ class ClercAttrib2Biz():
|
||||
data = json.load(f)
|
||||
|
||||
if self.export_format_biz.get():
|
||||
self.parseFile(data, filename)
|
||||
bRet = self.parseFile(data, filename)
|
||||
if bRet:
|
||||
messagebox.showinfo(title="Fin de conversion",
|
||||
message="La conversion s'est terminée avec succès")
|
||||
return False
|
||||
|
||||
else:
|
||||
self.convertFile(data, filename)
|
||||
if self.delete_after_parse.get():
|
||||
os.remove(dir + "/" + filename)
|
||||
|
||||
self.progress_bar["value"] = x / len(os.listdir(dir)) * 100
|
||||
self.fenetre.update_idletasks()
|
||||
self.nb_facture_var.set(self.count_facture)
|
||||
@@ -382,6 +388,7 @@ class ClercAttrib2Biz():
|
||||
|
||||
|
||||
def parseFile(self, data, filename):
|
||||
self.progress_bar["value"] = 0
|
||||
self.index_counter += 1
|
||||
lines = []
|
||||
self.count_facture += len(data["invoices"])
|
||||
@@ -393,10 +400,12 @@ class ClercAttrib2Biz():
|
||||
csv_col.data[5] = f""
|
||||
lines.append(csv_col.data)
|
||||
|
||||
cur_invoice_index = 0
|
||||
|
||||
x = 70
|
||||
|
||||
for ele in data["invoices"]:
|
||||
cur_invoice_index += 1
|
||||
self.progress_bar["value"] = cur_invoice_index / self.count_facture * 100
|
||||
b_address_update = True
|
||||
data = cls_Invoice()
|
||||
data.parse_item(ele)
|
||||
@@ -409,9 +418,15 @@ class ClercAttrib2Biz():
|
||||
messagebox.showerror(title="Erreur code débiteur", message=f"Le code débiteur de la facture {data.data['id']} est faux: [{data.Debtor['code']}], merci de le corriger ")
|
||||
inp_popup = Input_popup(self.fenetre, default=data.Debtor["code"], factureID=data.data['id'], fip=data.Patient['fip_number'])
|
||||
data.Debtor["code"] = str(inp_popup.show())
|
||||
if data.Debtor["code"] is None or '.' in data.Debtor["code"]:
|
||||
messagebox.showerror(title="Erreur Critique",
|
||||
message=f"Les informations de la factures [{data.data['id']}] comportes trop d'erreur arrêt du processus ")
|
||||
return False
|
||||
|
||||
if int(data.Debtor["code"]) == 1:
|
||||
if not self.check_code_validity(data.Debtor["code"],data):
|
||||
messagebox.showerror(title="Erreur Critique",
|
||||
message=f"Les informations de la factures [{data.data['id']}] comportes trop d'erreur arrêt du processus ")
|
||||
return False
|
||||
|
||||
|
||||
@@ -450,6 +465,15 @@ class ClercAttrib2Biz():
|
||||
debitor_popup = Check_debitor_popup(self.fenetre,data.Debtor,self.o_debs.get_names_by_code(data.Debtor['code']),data.data['id'],data.Patient['fip_number'], object=self.o_debs)
|
||||
data.Debtor["code"] = debitor_popup.show()
|
||||
|
||||
if data.Debtor["code"] is None or '.' in data.Debtor["code"]:
|
||||
messagebox.showerror(title="Erreur Critique",
|
||||
message=f"Les informations de la factures [{data.data['id']}] comportes trop d'erreur arrêt du processus ")
|
||||
return False
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if data.Patient["complement"] != None:
|
||||
@@ -709,6 +733,7 @@ class ClercAttrib2Biz():
|
||||
wr.writerow(cdr)
|
||||
else:
|
||||
self.save_file(lines,fileName=self.export_filename)
|
||||
|
||||
def addToIndexs(self,obj,data,cat, key):
|
||||
#self.a_index[cat].append({"key":key,"index":len(obj.data)})
|
||||
if key not in self.a_index[cat]:
|
||||
|
||||
@@ -1 +1 @@
|
||||
VERSION = "20220822-1735"
|
||||
VERSION = "20220902-1508"
|
||||
Reference in New Issue
Block a user