Compare commits
2 Commits
20220609-0
...
20220614-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a46da5a89 | ||
|
|
e8d1bf7696 |
@@ -33,11 +33,11 @@ class cls_debitors:
|
||||
|
||||
def add_items(self, code, name):
|
||||
for deb in self.items:
|
||||
if deb.code == code:
|
||||
if deb.code == int(code):
|
||||
deb.add_name(name)
|
||||
return
|
||||
deb = cls_debitor()
|
||||
deb.code = code
|
||||
deb.code = int(code)
|
||||
deb.add_name(name)
|
||||
self.items.append(deb)
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@ from datetime import datetime
|
||||
class Check_addresses_popup(Toplevel):
|
||||
x_row = 0
|
||||
no_selection_possible = False
|
||||
def __init__(self, parent, item_1=None, item_2=None, debitor=None):
|
||||
def __init__(self, parent, item_1=None, item_2=None, debitor=None, factureID=""):
|
||||
super().__init__(parent)
|
||||
|
||||
self.geometry(f"700x300+{parent.winfo_x() + 25 }+{parent.winfo_y() +25 }")
|
||||
self.resizable(True,True)
|
||||
self.iconbitmap("./logo_clerc_03X_icon.ico")
|
||||
self.title(f"Choix de l'adresse à conserver {item_1['fip_number']}. Code débiteur: {debitor['code']}")
|
||||
self.title(f"Choix de l'adresse à conserver {item_1['fip_number']}/{factureID}. Code débiteur: {debitor['code']}")
|
||||
|
||||
self.columnconfigure(0, weight=1)
|
||||
self.columnconfigure(1, weight=1)
|
||||
@@ -121,3 +121,75 @@ class Check_addresses_popup(Toplevel):
|
||||
self.wait_window(self)
|
||||
return self.selection
|
||||
|
||||
class Check_debitor_popup(Toplevel):
|
||||
x_row = 0
|
||||
no_selection_possible = False
|
||||
def __init__(self, parent, debitor=None, lists_available_names=None, factureID=None,fip=None,object=None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.object = object
|
||||
self.debitor = debitor
|
||||
|
||||
self.inp_code = StringVar()
|
||||
self.inp_code.set(debitor['code'])
|
||||
|
||||
self.geometry(f"850x300+{parent.winfo_x() + 25 }+{parent.winfo_y() +25 }")
|
||||
self.resizable(True,True)
|
||||
self.iconbitmap("./logo_clerc_03X_icon.ico")
|
||||
self.title(f"Incohérence sur les débiteurs {fip}/{factureID}. Code débiteur: {debitor['code']}")
|
||||
|
||||
self.columnconfigure(0, weight=1)
|
||||
self.columnconfigure(1, weight=1)
|
||||
|
||||
lbf_new = LabelFrame(self, text="Données Attrib")
|
||||
lbf_new.grid(row=0, column=0, sticky='WE', padx=5, pady=5)
|
||||
|
||||
label_font = font.Font(weight='bold', size=9)
|
||||
Label(lbf_new, text="Code saisi", font=label_font).grid(row=0, column=0, sticky="W")
|
||||
Entry(lbf_new, textvariable=self.inp_code, width= 10).grid(row=0, column=1, sticky="W", pady= 10)
|
||||
|
||||
|
||||
|
||||
Label(lbf_new, text="Débiteur sélectionné", font=label_font).grid(row=1, column=0, sticky="W")
|
||||
text_name = Text(lbf_new, fg="red", height=3,width= 30)
|
||||
text_name.grid(row=1, column=1, sticky="W")
|
||||
text_name.insert(END,debitor['name'])
|
||||
text_name.configure(state='disabled')
|
||||
|
||||
|
||||
lbf_old = LabelFrame(self, text="Nom possible")
|
||||
lbf_old.grid(row=0, column=1, sticky='NSEW', padx=5, pady=5)
|
||||
|
||||
|
||||
|
||||
self.listbox = Text(lbf_old, height=5, width=50)
|
||||
self.listbox.grid(row=1,column=0, columnspan= 2, pady=15,padx=15, sticky='NSEW')
|
||||
|
||||
for info in lists_available_names :
|
||||
self.listbox.insert(END, f"{info}\n")
|
||||
|
||||
self.listbox.configure(state='disabled')
|
||||
self.no_selection_possible = True
|
||||
|
||||
self.btn = Button(lbf_old, text="Ajouter", command=self.add)
|
||||
self.btn.grid(row=2, column=0, columnspan= 2, pady=10, padx=10, sticky='NSEW')
|
||||
|
||||
self.btn = Button(self, text="Valider", command=self.destroy)
|
||||
self.btn.grid(row=2,column=0, columnspan= 2, pady=10,padx=10, sticky='NSEW')
|
||||
|
||||
|
||||
def add(self):
|
||||
self.destroy()
|
||||
if self.object is not None:
|
||||
self.object.add_items(code=self.inp_code.get(), name=self.debitor["name"])
|
||||
self.object.save_debitors()
|
||||
def destroy(self):
|
||||
super().destroy()
|
||||
|
||||
def show(self):
|
||||
self.deiconify()
|
||||
self.wm_protocol("WM_DELETE_WINDOW", self.destroy)
|
||||
self.wait_window(self)
|
||||
print("nouveau code = "+ self.inp_code.get())
|
||||
return self.inp_code.get()
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
20220609-0006
|
||||
20220614-1653
|
||||
15
main.py
15
main.py
@@ -384,8 +384,9 @@ class ClercAttrib2Biz():
|
||||
|
||||
if int(data.Debtor["code"]) >= 100:
|
||||
if not self.o_debs.is_in_debitor_name(code=data.Debtor["code"],search_name=data.Debtor["name"]):
|
||||
messagebox.showerror(title="Erreur code débiteur erroné", message=f"Information débiteur incohérente: facture N°: {data.data['id']} / {data.Patient['fip_number']}.\nCode débiteur: {data.Debtor['code']}\nNom du débiteur: {data.Debtor['name']}. \nAurait dû être: {self.o_debs.get_names_by_code(data.Debtor['code'])}")
|
||||
|
||||
#messagebox.showerror(title="Erreur code débiteur erroné", message=f"Information débiteur incohérente: facture N°: {data.data['id']} / {data.Patient['fip_number']}.\nCode débiteur: {data.Debtor['code']}\nNom du débiteur: {data.Debtor['name']}. \nAurait dû être: {self.o_debs.get_names_by_code(data.Debtor['code'])}")
|
||||
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"] = int(debitor_popup.show())
|
||||
|
||||
|
||||
|
||||
@@ -401,7 +402,7 @@ class ClercAttrib2Biz():
|
||||
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 = Check_addresses_popup(self.fenetre, item_1=data.Patient, item_2=addresses_exist, debitor=data.Debtor)
|
||||
popup = Check_addresses_popup(self.fenetre, item_1=data.Patient, item_2=addresses_exist, debitor=data.Debtor, factureID=data.data['id'])
|
||||
b_address_update = popup.show()
|
||||
print(f"Result Popup: {b_address_update}")
|
||||
else:
|
||||
@@ -491,8 +492,12 @@ class ClercAttrib2Biz():
|
||||
con = ""
|
||||
concat_str = ""
|
||||
if "name" in data.Debtor.keys():
|
||||
if data.Debtor["name"] is not None:
|
||||
concat_str += con + data.Debtor["name"]
|
||||
con = "#chr(13)##chr(10)#"
|
||||
else:
|
||||
messagebox.showerror(title="Erreur nom débiteur erroné", message=f"Le nom débiteur de la facture {data.data['id']} est faux: [{data.Debtor['name']}], merci de le corriger ")
|
||||
|
||||
|
||||
if data.Debtor["gender"] is not None:
|
||||
concat_str += con + "Monsieur" if data.Debtor["gender"] == "Masculin" else con + "Madame"
|
||||
@@ -531,7 +536,11 @@ class ClercAttrib2Biz():
|
||||
else:
|
||||
csv_col.data[21] = ''
|
||||
|
||||
if data.Patient["birthdate"] is not None:
|
||||
csv_col.data[40] = datetime.strptime(data.Patient["birthdate"], "%Y-%m-%d").strftime("%d.%m.%Y")
|
||||
else:
|
||||
csv_col.data[40] = ""
|
||||
messagebox.showerror(title="Erreur date de naissance", message=f"La date de naissance de la facture {data.data['id']} est faux: [{data.Patient['birthdate']}], merci de le corriger ")
|
||||
csv_col.data[48] = 0
|
||||
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
VERSION = "20220609-0006"
|
||||
VERSION = "20220614-1653"
|
||||
Reference in New Issue
Block a user