|
|
|
|
@@ -27,6 +27,7 @@ from version import *
|
|
|
|
|
|
|
|
|
|
src_dir = os.getenv('APPDATA') + "\Attrib2Biz\src"
|
|
|
|
|
dest_dir = os.getenv('APPDATA') + "\Attrib2Biz\output"
|
|
|
|
|
temp_dir = os.getenv('APPDATA') + '\Attrib2Biz\.temp'
|
|
|
|
|
file_path ="" #os.path.dirname(__file__)
|
|
|
|
|
|
|
|
|
|
Elements = []
|
|
|
|
|
@@ -40,9 +41,13 @@ if not os.path.exists(src_dir):
|
|
|
|
|
if not os.path.exists(dest_dir):
|
|
|
|
|
os.makedirs(dest_dir)
|
|
|
|
|
|
|
|
|
|
if not os.path.exists(temp_dir):
|
|
|
|
|
os.makedirs(temp_dir)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SuggestionPopup(Toplevel):
|
|
|
|
|
x_row = 0
|
|
|
|
|
no_selection_possible = False
|
|
|
|
|
def __init__(self, parent, item_1=None, item_2=None, debitor=None):
|
|
|
|
|
super().__init__(parent)
|
|
|
|
|
|
|
|
|
|
@@ -57,10 +62,6 @@ class SuggestionPopup(Toplevel):
|
|
|
|
|
lbf_new = LabelFrame(self, text="Nouveau patient")
|
|
|
|
|
lbf_new.grid(row=0, column=0, sticky='WE', padx=5, pady=5)
|
|
|
|
|
|
|
|
|
|
Label(lbf_new, text=f"N° AVS de l'adresse \t {item_1['insurance_policy_number'].replace('.','')}").grid(row=0, column=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lbf_old = LabelFrame(self, text="Ancien patient")
|
|
|
|
|
lbf_old.grid(row=0, column=1, sticky='NSEW', padx=5, pady=5)
|
|
|
|
|
|
|
|
|
|
@@ -112,7 +113,10 @@ class SuggestionPopup(Toplevel):
|
|
|
|
|
|
|
|
|
|
self.listbox.insert(END, f"Aucun changement possible, code débiteur {debitor['code']}")
|
|
|
|
|
self.listbox.configure(state='disabled')
|
|
|
|
|
self.no_selection_possible = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if int(debitor["code"]) == 1:
|
|
|
|
|
if str_address_1 == str_address_2:
|
|
|
|
|
self.listbox.selection_set(0)
|
|
|
|
|
print("adresse identique")
|
|
|
|
|
@@ -122,6 +126,7 @@ class SuggestionPopup(Toplevel):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def add_compares_element(self,new_frame, old_frame,str1, str2, label):
|
|
|
|
|
label_font = font.Font(weight='bold', size=9)
|
|
|
|
|
|
|
|
|
|
@@ -150,6 +155,8 @@ class SuggestionPopup(Toplevel):
|
|
|
|
|
self.selection = self.listbox.get(selection[0])
|
|
|
|
|
self.selection = True if self.selection == "Nouvelle" else False
|
|
|
|
|
self.destroy()
|
|
|
|
|
if self.no_selection_possible:
|
|
|
|
|
self.destroy()
|
|
|
|
|
|
|
|
|
|
def show(self):
|
|
|
|
|
self.deiconify()
|
|
|
|
|
@@ -196,11 +203,13 @@ class ClercAttrib2Biz():
|
|
|
|
|
self.prompt = None
|
|
|
|
|
self.b_prompt_open = False
|
|
|
|
|
|
|
|
|
|
self.check_addresses = BooleanVar(self.fenetre)
|
|
|
|
|
self.delete_after_parse = BooleanVar(self.fenetre)
|
|
|
|
|
self.export_format_biz = BooleanVar(self.fenetre)
|
|
|
|
|
self.export_one_file = BooleanVar(self.fenetre)
|
|
|
|
|
self.run_excel_after_export = BooleanVar(self.fenetre)
|
|
|
|
|
|
|
|
|
|
self.check_addresses.set(True)
|
|
|
|
|
self.export_one_file.set(True)
|
|
|
|
|
self.run_excel_after_export.set(False)
|
|
|
|
|
self.export_format_biz.set(True)
|
|
|
|
|
@@ -304,11 +313,12 @@ class ClercAttrib2Biz():
|
|
|
|
|
lbf_3 = LabelFrame(self.fenetre, text="Options")
|
|
|
|
|
lbf_3.grid(row=0, column=1, rowspan=2, sticky='NSEW', padx=5, pady=5)
|
|
|
|
|
|
|
|
|
|
Checkbutton(lbf_3, text="Supprimer fichiers après conversion", variable= self.delete_after_parse, onvalue=True, offvalue=False).grid(row=0, sticky='W')
|
|
|
|
|
Checkbutton(lbf_3, text="Export au format .biz", variable= self.export_format_biz, onvalue=True, offvalue=False, command=self.refresh_ui).grid(row=1, sticky='W')
|
|
|
|
|
Checkbutton(lbf_3, text="Export en 1 seul fichier", variable= self.export_one_file, onvalue=True, offvalue=False, command=self.refresh_ui).grid(row=2, sticky='W')
|
|
|
|
|
Checkbutton(lbf_3, text="Vérifier les Adresses", variable=self.check_addresses, onvalue=True, offvalue=False).grid(row=0, sticky='W')
|
|
|
|
|
Checkbutton(lbf_3, text="Supprimer fichiers après conversion", variable= self.delete_after_parse, onvalue=True, offvalue=False).grid(row=1, sticky='W')
|
|
|
|
|
Checkbutton(lbf_3, text="Export au format .biz", variable= self.export_format_biz, onvalue=True, offvalue=False, command=self.refresh_ui).grid(row=2, sticky='W')
|
|
|
|
|
Checkbutton(lbf_3, text="Export en 1 seul fichier", variable= self.export_one_file, onvalue=True, offvalue=False, command=self.refresh_ui).grid(row=3, sticky='W')
|
|
|
|
|
self.cb_run = Checkbutton(lbf_3, text="Lancer la conversion excel", variable=self.run_excel_after_export, onvalue=True, offvalue=False)
|
|
|
|
|
self.cb_run.grid(row=3, sticky='W')
|
|
|
|
|
self.cb_run.grid(row=4, sticky='W')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -319,11 +329,15 @@ class ClercAttrib2Biz():
|
|
|
|
|
self.thread = Thread(target=self.start_parsing)
|
|
|
|
|
|
|
|
|
|
auto_update = auto_updater()
|
|
|
|
|
if auto_update.new_update_available():
|
|
|
|
|
auto_update.temp_dir = temp_dir + '\\'
|
|
|
|
|
update_available = auto_update.new_update_available()
|
|
|
|
|
if update_available == True:
|
|
|
|
|
self.logger.warning(f"Nouvelle version du script disponible. {auto_update.dl_version}")
|
|
|
|
|
if messagebox.askyesno(title="Nouvelle version trouvée", message=f"Une nouvelle version a été trouvée, vous pouvez l'installer dès maintenant !", ):
|
|
|
|
|
subprocess.call("update.exe")
|
|
|
|
|
subprocess.call(temp_dir + "\\update.exe")
|
|
|
|
|
self.fenetre.destroy()
|
|
|
|
|
elif update_available == "ERROR":
|
|
|
|
|
messagebox.showerror(title="ERREUR téléchargement", message="Erreur lors du téléchargement de la nouvelle mise à jour")
|
|
|
|
|
|
|
|
|
|
def disable_prompt(self):
|
|
|
|
|
self.prompt.destroy()
|
|
|
|
|
@@ -488,12 +502,14 @@ class ClercAttrib2Biz():
|
|
|
|
|
if data.Patient['insurance_policy_number'] == None:
|
|
|
|
|
data.Patient['insurance_policy_number'] = f"{uuid.uuid4()}"[:15]
|
|
|
|
|
|
|
|
|
|
if self.check_addresses.get():
|
|
|
|
|
addresses_exist = self.addresses.get_item_by_AVS(data.Patient['insurance_policy_number'].replace(".", ""))
|
|
|
|
|
if addresses_exist is not None:
|
|
|
|
|
|
|
|
|
|
popup = SuggestionPopup(self.fenetre, item_1=data.Patient, item_2=addresses_exist,debitor=data.Debtor )
|
|
|
|
|
popup = SuggestionPopup(self.fenetre, item_1=data.Patient, item_2=addresses_exist, debitor=data.Debtor)
|
|
|
|
|
b_address_update = popup.show()
|
|
|
|
|
print(f"Result Popup: {b_address_update}")
|
|
|
|
|
else:
|
|
|
|
|
b_address_update = True
|
|
|
|
|
|
|
|
|
|
#self.draw_test(item_1=data.Patient, item_2=addresses_exist)
|
|
|
|
|
#messagebox.showerror(title="AVS Trouvé", message=f"Le code AVS de l'adresse {data.Patient['insurance_policy_number']} est déjà existant: [{data.Debtor['code']}], merci de le corriger ")
|
|
|
|
|
|