|
|
|
@@ -1,4 +1,5 @@
|
|
|
|
import csv
|
|
|
|
import csv
|
|
|
|
|
|
|
|
import re
|
|
|
|
import json
|
|
|
|
import json
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import logging
|
|
|
|
import logging
|
|
|
|
@@ -9,6 +10,7 @@ import time
|
|
|
|
import uuid
|
|
|
|
import uuid
|
|
|
|
import tkinter
|
|
|
|
import tkinter
|
|
|
|
from datetime import datetime
|
|
|
|
from datetime import datetime
|
|
|
|
|
|
|
|
import pickle
|
|
|
|
|
|
|
|
|
|
|
|
import tkinter.filedialog
|
|
|
|
import tkinter.filedialog
|
|
|
|
from tkinter import *
|
|
|
|
from tkinter import *
|
|
|
|
@@ -17,6 +19,7 @@ from tkinter import messagebox
|
|
|
|
from tkinter.ttk import Progressbar
|
|
|
|
from tkinter.ttk import Progressbar
|
|
|
|
from tkinter.scrolledtext import ScrolledText
|
|
|
|
from tkinter.scrolledtext import ScrolledText
|
|
|
|
from threading import *
|
|
|
|
from threading import *
|
|
|
|
|
|
|
|
from dbfread import DBF
|
|
|
|
|
|
|
|
|
|
|
|
from class_invoices import *
|
|
|
|
from class_invoices import *
|
|
|
|
from class_addresses import *
|
|
|
|
from class_addresses import *
|
|
|
|
@@ -87,19 +90,23 @@ class ClercAttrib2Biz():
|
|
|
|
self.prompt = None
|
|
|
|
self.prompt = None
|
|
|
|
self.b_prompt_open = False
|
|
|
|
self.b_prompt_open = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.config = {}
|
|
|
|
|
|
|
|
|
|
|
|
self.check_addresses = BooleanVar(self.fenetre)
|
|
|
|
self.check_addresses = BooleanVar(self.fenetre)
|
|
|
|
self.delete_after_parse = 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.export_one_file = BooleanVar(self.fenetre)
|
|
|
|
self.run_excel_after_export = BooleanVar(self.fenetre)
|
|
|
|
self.winbiz_folder_path = StringVar(self.fenetre)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Défault value for config
|
|
|
|
self.check_addresses.set(True)
|
|
|
|
self.check_addresses.set(True)
|
|
|
|
self.export_one_file.set(True)
|
|
|
|
self.export_one_file.set(True)
|
|
|
|
self.run_excel_after_export.set(False)
|
|
|
|
self.delete_after_parse.set(False)
|
|
|
|
self.export_format_biz.set(True)
|
|
|
|
self.winbiz_folder_path.set(temp_dir)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.load_config()
|
|
|
|
|
|
|
|
|
|
|
|
self.draw_mainWindows()
|
|
|
|
self.draw_mainWindows()
|
|
|
|
self.refresh_ui()
|
|
|
|
|
|
|
|
self.read_addresses()
|
|
|
|
self.read_addresses()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -115,6 +122,31 @@ class ClercAttrib2Biz():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def save_config(self, event=None):
|
|
|
|
|
|
|
|
self.config["cfg_check_adresses"] = self.check_addresses.get()
|
|
|
|
|
|
|
|
self.config["cfg_delete_after_parse"] = self.delete_after_parse.get()
|
|
|
|
|
|
|
|
self.config["cfg_export_one_file"] = self.export_one_file.get()
|
|
|
|
|
|
|
|
self.config["winbiz_folder_path"] = self.winbiz_folder_path.get()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with open(os.path.join(temp_dir,"config.dat"),"wb") as pickle_file:
|
|
|
|
|
|
|
|
pickle.dump(self.config,pickle_file, pickle.HIGHEST_PROTOCOL)
|
|
|
|
|
|
|
|
def load_config(self):
|
|
|
|
|
|
|
|
if not os.path.exists(os.path.join(temp_dir, "config.dat")):
|
|
|
|
|
|
|
|
self.save_config()
|
|
|
|
|
|
|
|
with open(os.path.join(temp_dir, "config.dat"), "rb") as pickle_file:
|
|
|
|
|
|
|
|
self.config = pickle.load(pickle_file)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.check_addresses.set(self.read_config_element("cfg_check_adresses", True))
|
|
|
|
|
|
|
|
self.delete_after_parse.set(self.read_config_element("cfg_delete_after_parse", False))
|
|
|
|
|
|
|
|
self.export_one_file.set(self.read_config_element("cfg_export_one_file", True))
|
|
|
|
|
|
|
|
self.winbiz_folder_path.set(self.read_config_element("winbiz_folder_path", temp_dir))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def read_config_element(self,name, default):
|
|
|
|
|
|
|
|
val = self.config.get(name)
|
|
|
|
|
|
|
|
if val is not None:
|
|
|
|
|
|
|
|
return val
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
return default
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main_timer_fn(self):
|
|
|
|
def main_timer_fn(self):
|
|
|
|
@@ -203,12 +235,13 @@ class ClercAttrib2Biz():
|
|
|
|
lbf_3 = LabelFrame(self.fenetre, text="Options")
|
|
|
|
lbf_3 = LabelFrame(self.fenetre, text="Options")
|
|
|
|
lbf_3.grid(row=0, column=1, rowspan=2, sticky='NSEW', padx=5, pady=5)
|
|
|
|
lbf_3.grid(row=0, column=1, rowspan=2, sticky='NSEW', padx=5, pady=5)
|
|
|
|
|
|
|
|
|
|
|
|
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="Vérifier les Adresses", variable=self.check_addresses, onvalue=True, offvalue=False, command=self.save_config).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="Supprimer fichiers après conversion", variable= self.delete_after_parse, onvalue=True, offvalue=False, command=self.save_config).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,
|
|
|
|
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')
|
|
|
|
command=self.save_config).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)
|
|
|
|
textEntry = Entry(lbf_3, textvariable=self.winbiz_folder_path, validate="focusout", validatecommand=self.save_config)
|
|
|
|
self.cb_run.grid(row=4, sticky='W')
|
|
|
|
textEntry.grid(row=5, sticky="WE", columnspan=3)
|
|
|
|
|
|
|
|
textEntry.bind("<KeyRelease>", self.save_config)
|
|
|
|
|
|
|
|
|
|
|
|
menu_bar = Menu(self.fenetre)
|
|
|
|
menu_bar = Menu(self.fenetre)
|
|
|
|
menu_param = Menu(menu_bar, tearoff=0)
|
|
|
|
menu_param = Menu(menu_bar, tearoff=0)
|
|
|
|
@@ -241,40 +274,32 @@ class ClercAttrib2Biz():
|
|
|
|
self.prompt.destroy()
|
|
|
|
self.prompt.destroy()
|
|
|
|
self.b_prompt_open = False
|
|
|
|
self.b_prompt_open = False
|
|
|
|
|
|
|
|
|
|
|
|
def refresh_ui(self):
|
|
|
|
|
|
|
|
#print("pass refresh UI")
|
|
|
|
|
|
|
|
if self.export_one_file.get() and not self.export_format_biz.get():
|
|
|
|
|
|
|
|
self.cb_run['state'] = "active"
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
self.cb_run['state'] = "disabled"
|
|
|
|
|
|
|
|
self.run_excel_after_export.set(False)
|
|
|
|
|
|
|
|
if self.export_format_biz.get():
|
|
|
|
|
|
|
|
self.cb_run['state'] = "disabled"
|
|
|
|
|
|
|
|
self.run_excel_after_export.set(False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def read_addresses(self):
|
|
|
|
def read_addresses(self):
|
|
|
|
file_addresses_path = os.path.join(dest_dir, f"adresses.txt")
|
|
|
|
if os.path.exists(os.path.join(self.winbiz_folder_path.get(),"adresses.dbf")):
|
|
|
|
|
|
|
|
shutil.copyfile(os.path.join(self.winbiz_folder_path.get(),"adresses.dbf"), os.path.join(temp_dir,"adresses.dbf"))
|
|
|
|
|
|
|
|
shutil.copyfile(os.path.join(self.winbiz_folder_path.get(), "adresses.FPT"),os.path.join(temp_dir, "adresses.FPT"))
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
messagebox.showerror(title="Impossible d'ouvrir le fichier d'adresse existantes", message=f"Le fichier {self.winbiz_folder_path.get()} est introuvable. Aucune vérification des adresses possible")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
file_addresses_path = os.path.join(temp_dir, f"adresses.dbf")
|
|
|
|
if os.path.exists(file_addresses_path):
|
|
|
|
if os.path.exists(file_addresses_path):
|
|
|
|
file = open(file_addresses_path)
|
|
|
|
for record in DBF(file_addresses_path):
|
|
|
|
csvreader = csv.reader(file, delimiter=';')
|
|
|
|
|
|
|
|
rows = []
|
|
|
|
|
|
|
|
for row in csvreader:
|
|
|
|
|
|
|
|
rows.append(row)
|
|
|
|
|
|
|
|
o_addresse = cls_addresse()
|
|
|
|
o_addresse = cls_addresse()
|
|
|
|
o_addresse.AVS = row[5]
|
|
|
|
o_addresse.AVS = str(record["AD_CODE"])
|
|
|
|
o_addresse.lastName = row[9]
|
|
|
|
o_addresse.lastName =str( record["AD_NOM"])
|
|
|
|
o_addresse.firstName = row[10]
|
|
|
|
o_addresse.firstName = str(record["AD_PRENOM"])
|
|
|
|
o_addresse.birth = row[38]
|
|
|
|
if record["AD_NAISSAN"] is not None:
|
|
|
|
o_addresse.street = row[11]
|
|
|
|
o_addresse.birth = datetime.strptime(str(record["AD_NAISSAN"]), "%Y-%m-%d").strftime("%d.%m.%Y")
|
|
|
|
o_addresse.street_cpl = row[12]
|
|
|
|
|
|
|
|
o_addresse.npa = row[13]
|
|
|
|
else:
|
|
|
|
o_addresse.city = row[15]
|
|
|
|
o_addresse.birth = ""
|
|
|
|
|
|
|
|
o_addresse.street =str( record["AD_RUE_2"])
|
|
|
|
|
|
|
|
o_addresse.street_cpl =str( record["AD_RUE_1"])
|
|
|
|
|
|
|
|
o_addresse.npa =str( record["AD_NPA"])
|
|
|
|
|
|
|
|
o_addresse.city = str(record["AD_VILLE"])
|
|
|
|
self.addresses.add_addresse(o_addresse)
|
|
|
|
self.addresses.add_addresse(o_addresse)
|
|
|
|
|
|
|
|
logging.warning(f"Chargement du fichier adresses.dbf terminé ! {len(self.addresses.items)} adresses trouvées ")
|
|
|
|
|
|
|
|
|
|
|
|
file.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
messagebox.showwarning(title="Impossible d'ouvrir le fichier d'adresse existantes", message=f"Le fichier {file_addresses_path} est introuvable. Aucune vérification des adresses possible")
|
|
|
|
messagebox.showwarning(title="Impossible d'ouvrir le fichier d'adresse existantes", message=f"Le fichier {file_addresses_path} est introuvable. Aucune vérification des adresses possible")
|
|
|
|
|
|
|
|
|
|
|
|
@@ -287,7 +312,6 @@ class ClercAttrib2Biz():
|
|
|
|
|
|
|
|
|
|
|
|
self.export_filename = f"bizexdoc_export_Attrib_v{datetime.now().year}{datetime.now().month}{datetime.now().day}{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)):
|
|
|
|
if self.export_one_file.get() and os.path.exists(os.path.join(dest_dir, self.export_filename)):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
os.remove(os.path.join(dest_dir, self.export_filename))
|
|
|
|
os.remove(os.path.join(dest_dir, self.export_filename))
|
|
|
|
@@ -296,15 +320,7 @@ class ClercAttrib2Biz():
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
print(f"remove {self.export_filename} => {os.path.join(dest_dir, self.export_filename)}")
|
|
|
|
print(f"remove {self.export_filename} => {os.path.join(dest_dir, self.export_filename)}")
|
|
|
|
else:
|
|
|
|
|
|
|
|
if self.export_one_file.get() and os.path.exists(os.path.join(dest_dir, f"src.csv")):
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
os.remove(os.path.join(dest_dir, f"src.csv"))
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
messagebox.showerror(title="Erreur fichier déjà ouvert", message=f"Le fichier src.csv est déjà ouvert. Veuillez le fermer et recommencer")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(f"remove src.csv => {os.path.join(dest_dir, 'src.csv')}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.progress_bar["value"] = 0
|
|
|
|
self.progress_bar["value"] = 0
|
|
|
|
for filename in os.listdir(dir):
|
|
|
|
for filename in os.listdir(dir):
|
|
|
|
@@ -314,24 +330,20 @@ class ClercAttrib2Biz():
|
|
|
|
with open(dir + "/" + filename, encoding="utf-8") as f:
|
|
|
|
with open(dir + "/" + filename, encoding="utf-8") as f:
|
|
|
|
data = json.load(f)
|
|
|
|
data = json.load(f)
|
|
|
|
|
|
|
|
|
|
|
|
if self.export_format_biz.get():
|
|
|
|
|
|
|
|
bRet = self.parseFile(data, filename)
|
|
|
|
bRet = self.parseFile(data, filename)
|
|
|
|
if bRet:
|
|
|
|
if bRet:
|
|
|
|
messagebox.showinfo(title="Fin de conversion",
|
|
|
|
messagebox.showinfo(title="Fin de conversion",
|
|
|
|
message="La conversion s'est terminée avec succès")
|
|
|
|
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.progress_bar["value"] = x / len(os.listdir(dir)) * 100
|
|
|
|
self.fenetre.update_idletasks()
|
|
|
|
self.fenetre.update_idletasks()
|
|
|
|
self.nb_facture_var.set(self.count_facture)
|
|
|
|
self.nb_facture_var.set(self.count_facture)
|
|
|
|
|
|
|
|
if self.delete_after_parse.get():
|
|
|
|
if self.run_excel_after_export.get():
|
|
|
|
os.remove(dir + "/" + filename)
|
|
|
|
self.open_export_file()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def ifNotNull(self,value, ret=""):
|
|
|
|
def ifNotNull(self,value, ret=""):
|
|
|
|
if value == None:
|
|
|
|
if value == None:
|
|
|
|
@@ -353,6 +365,14 @@ class ClercAttrib2Biz():
|
|
|
|
data.Debtor["street"] = data.Debtor["street"].strip()
|
|
|
|
data.Debtor["street"] = data.Debtor["street"].strip()
|
|
|
|
if data.data["comments"] is not None:
|
|
|
|
if data.data["comments"] is not None:
|
|
|
|
data.data["comments"] = data.data["comments"].strip().replace("\n",'')
|
|
|
|
data.data["comments"] = data.data["comments"].strip().replace("\n",'')
|
|
|
|
|
|
|
|
if data.Debtor["code"] is not None:
|
|
|
|
|
|
|
|
data.Debtor["code"] = data.Debtor["code"].strip()
|
|
|
|
|
|
|
|
data.Debtor["code"] = re.sub(r'[^0-9]', '', data.Debtor["code"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if "name" in data.Debtor.keys() and data.Debtor["name"] is not None:
|
|
|
|
|
|
|
|
data.Debtor["name"] = data.Debtor["name"].replace("(facturation)","")
|
|
|
|
|
|
|
|
data.Debtor["name"] = data.Debtor["name"].strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def check_code_validity(self, code,data):
|
|
|
|
def check_code_validity(self, code,data):
|
|
|
|
ret = True
|
|
|
|
ret = True
|
|
|
|
@@ -381,7 +401,8 @@ class ClercAttrib2Biz():
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
if datetime.strptime(new['birthdate'], "%Y-%m-%d").strftime("%d.%m.%Y") != old.birth:
|
|
|
|
if datetime.strptime(new['birthdate'], "%Y-%m-%d").strftime("%d.%m.%Y") != old.birth:
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
if f"{new['street']} {new['street_number']}" != old.street:
|
|
|
|
if f"{new['street'].strip()} {new['street_number'].strip()}" != f"{old.street.strip()}":
|
|
|
|
|
|
|
|
print(f"({new['street'].strip()} {new['street_number'].strip()}) != [" + old.street.strip()+"]")
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
if f"{new['postal_code']} {new['city']}" != f"{old.npa} {old.city}":
|
|
|
|
if f"{new['postal_code']} {new['city']}" != f"{old.npa} {old.city}":
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
@@ -436,7 +457,7 @@ class ClercAttrib2Biz():
|
|
|
|
if data.Debtor["code"] != "1" and data.Debtor["code"] != None and int(data.Debtor["code"]) < 100:
|
|
|
|
if data.Debtor["code"] != "1" and data.Debtor["code"] != None and int(data.Debtor["code"]) < 100:
|
|
|
|
if data.Patient["fip_number"] not in self.a_listings["to_check"]:
|
|
|
|
if data.Patient["fip_number"] not in self.a_listings["to_check"]:
|
|
|
|
self.a_listings["to_check"].append(data.Patient["fip_number"])
|
|
|
|
self.a_listings["to_check"].append(data.Patient["fip_number"])
|
|
|
|
self.logger.warning(f"Vérifier facture N°: {data.data['id']} / {data.Patient['fip_number']} {data.Debtor['code']} {data.Debtor['lastname']} {data.Debtor['firstname']}")
|
|
|
|
#self.logger.warning(f"Vérifier facture N°: {data.data['id']} / {data.Patient['fip_number']} {data.Debtor['code']} {data.Debtor['lastname']} {data.Debtor['firstname']}")
|
|
|
|
|
|
|
|
|
|
|
|
for elem in data.Debtor:
|
|
|
|
for elem in data.Debtor:
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
@@ -457,7 +478,25 @@ class ClercAttrib2Biz():
|
|
|
|
self.logger.warn(f"Débiteur établissement facture N°: {data.data['id']} / {data.Patient['fip_number']} {data.Debtor['name']}")
|
|
|
|
self.logger.warn(f"Débiteur établissement facture N°: {data.data['id']} / {data.Patient['fip_number']} {data.Debtor['name']}")
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
if int(data.Debtor["code"]) == 1 and data.Patient["lastname"] + data.Patient["firstname"] != data.Debtor["lastname"] + data.Debtor["firstname"]:
|
|
|
|
if int(data.Debtor["code"]) == 1:
|
|
|
|
|
|
|
|
b_check_debitor = False
|
|
|
|
|
|
|
|
if data.Debtor["lastname"] == None:
|
|
|
|
|
|
|
|
b_check_debitor = True
|
|
|
|
|
|
|
|
data.Debtor["lastname"] = ""
|
|
|
|
|
|
|
|
messagebox.showerror(title="Erreur",
|
|
|
|
|
|
|
|
message=f"Le débiteur n'a pas de nom, vérifier la facture ATTRIB et vérifier le code débiteur: facture N°: {data.data['id']} / {data.Patient['fip_number']}")
|
|
|
|
|
|
|
|
if data.Debtor["firstname"] == None:
|
|
|
|
|
|
|
|
b_check_debitor = True
|
|
|
|
|
|
|
|
data.Debtor["firstname"] = ""
|
|
|
|
|
|
|
|
messagebox.showerror(title="Erreur",
|
|
|
|
|
|
|
|
message=f"Le débiteur n'a pas de prénom, vérifier la facture ATTRIB et vérifier le code débiteur: facture N°: {data.data['id']} / {data.Patient['fip_number']}")
|
|
|
|
|
|
|
|
if b_check_debitor:
|
|
|
|
|
|
|
|
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.Patient["lastname"] + data.Patient["firstname"] != data.Debtor["lastname"] + data.Debtor["firstname"]:
|
|
|
|
self.a_listings["to_check"].append(data.Patient["fip_number"])
|
|
|
|
self.a_listings["to_check"].append(data.Patient["fip_number"])
|
|
|
|
print(data.Patient["complement"])
|
|
|
|
print(data.Patient["complement"])
|
|
|
|
self.logger.warning(f"Débiteur différents: facture N°: {data.data['id']} / {data.Patient['fip_number']}")
|
|
|
|
self.logger.warning(f"Débiteur différents: facture N°: {data.data['id']} / {data.Patient['fip_number']}")
|
|
|
|
@@ -470,10 +509,7 @@ class ClercAttrib2Biz():
|
|
|
|
messagebox.showerror(title="Erreur",
|
|
|
|
messagebox.showerror(title="Erreur",
|
|
|
|
message=f"Débiteur > 100 sans nom de débiteur ou d'établissement, vérifier la facture ATTRIB et vérifier le code débiteur: facture N°: {data.data['id']} / {data.Patient['fip_number']}")
|
|
|
|
message=f"Débiteur > 100 sans nom de débiteur ou d'établissement, vérifier la facture ATTRIB et vérifier le code débiteur: facture N°: {data.data['id']} / {data.Patient['fip_number']}")
|
|
|
|
self.a_listings["to_check"].append(data.Patient["fip_number"])
|
|
|
|
self.a_listings["to_check"].append(data.Patient["fip_number"])
|
|
|
|
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 not self.o_debs.is_in_debitor_name(code=data.Debtor["code"],search_name=data.Debtor["name"]):
|
|
|
|
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)
|
|
|
|
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)
|
|
|
|
@@ -490,12 +526,13 @@ class ClercAttrib2Biz():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'''
|
|
|
|
if data.Patient["complement"] != None:
|
|
|
|
Désactivé, plus utile
|
|
|
|
|
|
|
|
if data.Patient["complement"] != None :
|
|
|
|
self.a_listings["to_check"].append(data.Patient["fip_number"])
|
|
|
|
self.a_listings["to_check"].append(data.Patient["fip_number"])
|
|
|
|
print(data.Patient["complement"])
|
|
|
|
print(data.Patient["complement"])
|
|
|
|
self.logger.warning(f"Complément patient: facture N°: {data.data['id']} / {data.Patient['fip_number']}")
|
|
|
|
self.logger.warning(f"Complément patient: facture N°: {data.data['id']} / {data.Patient['fip_number']}")
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
if data.Patient['insurance_policy_number'] == None:
|
|
|
|
if data.Patient['insurance_policy_number'] == None:
|
|
|
|
data.Patient['insurance_policy_number'] = f"{uuid.uuid4()}"[:15]
|
|
|
|
data.Patient['insurance_policy_number'] = f"{uuid.uuid4()}"[:15]
|
|
|
|
@@ -503,8 +540,12 @@ class ClercAttrib2Biz():
|
|
|
|
if self.check_addresses.get():
|
|
|
|
if self.check_addresses.get():
|
|
|
|
addresses_exist = self.addresses.get_item_by_AVS(data.Patient['insurance_policy_number'].replace(".", ""))
|
|
|
|
addresses_exist = self.addresses.get_item_by_AVS(data.Patient['insurance_policy_number'].replace(".", ""))
|
|
|
|
if addresses_exist is not None and not self.compare_old_and_new_adresses(new=data.Patient, old=addresses_exist):
|
|
|
|
if addresses_exist is not None and not self.compare_old_and_new_adresses(new=data.Patient, old=addresses_exist):
|
|
|
|
|
|
|
|
|
|
|
|
popup = Check_addresses_popup(self.fenetre, item_1=data.Patient, item_2=addresses_exist, debitor=data.Debtor, factureID=data.data['id'])
|
|
|
|
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()
|
|
|
|
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']}")
|
|
|
|
print(f"Result Popup: {b_address_update}")
|
|
|
|
print(f"Result Popup: {b_address_update}")
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
b_address_update = True
|
|
|
|
b_address_update = True
|
|
|
|
@@ -652,7 +693,7 @@ class ClercAttrib2Biz():
|
|
|
|
csv_col.data[40] = datetime.strptime(data.Patient["birthdate"], "%Y-%m-%d").strftime("%d.%m.%Y")
|
|
|
|
csv_col.data[40] = datetime.strptime(data.Patient["birthdate"], "%Y-%m-%d").strftime("%d.%m.%Y")
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
csv_col.data[40] = ""
|
|
|
|
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 ")
|
|
|
|
messagebox.showerror(title="Erreur date de naissance", message=f"La date de naissance de la facture {data.data['id']} ({data.Patient['lastname']}) est faux: [{data.Patient['birthdate']}], merci de le corriger ")
|
|
|
|
csv_col.data[48] = 0
|
|
|
|
csv_col.data[48] = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -734,7 +775,10 @@ class ClercAttrib2Biz():
|
|
|
|
csv_col.data[116] = self.ifNotNull(data.Patient["category"]) + " - " + self.ifNotNull(data.Intervention["type"])
|
|
|
|
csv_col.data[116] = self.ifNotNull(data.Patient["category"]) + " - " + self.ifNotNull(data.Intervention["type"])
|
|
|
|
csv_col.data[118] = data.Intervention["kilometers"]
|
|
|
|
csv_col.data[118] = data.Intervention["kilometers"]
|
|
|
|
csv_col.data[135] = data.Intervention["base_name"]
|
|
|
|
csv_col.data[135] = data.Intervention["base_name"]
|
|
|
|
csv_col.data[136] = 3 if data.Debtor["code"] != "101" else "EBILL" #code présentation de facture
|
|
|
|
if data.Debtor["code"] == "100" or data.Debtor["code"] == "101":
|
|
|
|
|
|
|
|
csv_col.data[136] = "EBILL" #code présentation de facture
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
csv_col.data[136] = 3 #code présentation de facture
|
|
|
|
csv_col.data[146] = 3 #Code méthode de payement définit à 3
|
|
|
|
csv_col.data[146] = 3 #Code méthode de payement définit à 3
|
|
|
|
csv_col.data[168] = 1 if data.Intervention["team_name"] == "Planification" else 2
|
|
|
|
csv_col.data[168] = 1 if data.Intervention["team_name"] == "Planification" else 2
|
|
|
|
csv_col.data[169] = data.Patient['insurance_policy_number']
|
|
|
|
csv_col.data[169] = data.Patient['insurance_policy_number']
|
|
|
|
@@ -758,207 +802,6 @@ class ClercAttrib2Biz():
|
|
|
|
self.a_index["global"].append(key)
|
|
|
|
self.a_index["global"].append(key)
|
|
|
|
obj.data.append(data)
|
|
|
|
obj.data.append(data)
|
|
|
|
|
|
|
|
|
|
|
|
def convertFile(self, data, filename): #à utiliser pour un export avec fichier excel de Thomas
|
|
|
|
|
|
|
|
self.count_facture += len(data["invoices"])
|
|
|
|
|
|
|
|
self.a_listings["to_check"] = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lines = []
|
|
|
|
|
|
|
|
for ele in data["invoices"]:
|
|
|
|
|
|
|
|
data = cls_Invoice()
|
|
|
|
|
|
|
|
data.parse_item(ele)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
b_update_debitor = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(f"Code débiteur => {data.data['id']}: {data.Debtor['code']}" )
|
|
|
|
|
|
|
|
if data.Debtor["code"] == "None" or '.' in data.Debtor["code"]:
|
|
|
|
|
|
|
|
print("ERROR code débiteur")
|
|
|
|
|
|
|
|
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"] != "1" and data.Debtor["code"] != None and int(data.Debtor["code"]) < 100:
|
|
|
|
|
|
|
|
if data.Patient["fip_number"] not in self.a_listings["to_check"] :
|
|
|
|
|
|
|
|
self.a_listings["to_check"].append(data.Patient["fip_number"])
|
|
|
|
|
|
|
|
self.logger.warning(f"Vérifier facture N°: {data.data['id']} / {data.Patient['fip_number']} {data.Debtor['code']} {data.Debtor['lastname']} {data.Debtor['firstname']}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for elem in data.Debtor:
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
''' TODO activer ce code quand les débiteur auront un bon numéro
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if int(data.Debtor["code"]) > 100:
|
|
|
|
|
|
|
|
print("code débiteur > 100 => no update data")
|
|
|
|
|
|
|
|
b_update_debitor = False
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
messagebox.showerror(title="Erreur de code débiteur", message=f"il y a une erreur dans le code débiteur, il faut le vérifier. \n(n'est pas un chiffre) {data.Patient['fip_number']}")
|
|
|
|
|
|
|
|
exit()
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
if data.Debtor["type"] == "Établissement":
|
|
|
|
|
|
|
|
self.a_listings["to_check"].append(data.Patient["fip_number"])
|
|
|
|
|
|
|
|
print(data.Patient["complement"])
|
|
|
|
|
|
|
|
self.logger.warn(f"Débiteur établissement facture N°: {data.data['id']} / {data.Patient['fip_number']} {data.Debtor['name']}")
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if data.Debtor["code"] == 1 and data.Patient["lastname"] + data.Patient["firstname"] != data.Debtor["lastname"] + data.Debtor["firstname"]:
|
|
|
|
|
|
|
|
self.a_listings["to_check"].append(data.Patient["fip_number"])
|
|
|
|
|
|
|
|
print(data.Patient["complement"])
|
|
|
|
|
|
|
|
self.logger.warning(f"Débiteur différents: facture N°: {data.data['id']} / {data.Patient['fip_number']}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if data.Patient["complement"] != None :
|
|
|
|
|
|
|
|
self.a_listings["to_check"].append(data.Patient["fip_number"])
|
|
|
|
|
|
|
|
print(data.Patient["complement"])
|
|
|
|
|
|
|
|
self.logger.warning(f"Complément 22 patient: facture N°: {data.data['id']} / {data.Patient['fip_number']}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if data.Patient['insurance_policy_number'] == None:
|
|
|
|
|
|
|
|
data.Patient['insurance_policy_number'] = f"{uuid.uuid4()}"[:15]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
b_HRF = False
|
|
|
|
|
|
|
|
sHRF = ""
|
|
|
|
|
|
|
|
for article in data.Articles:
|
|
|
|
|
|
|
|
if "code" in article.keys():
|
|
|
|
|
|
|
|
if article["code"] == "HRF":
|
|
|
|
|
|
|
|
b_HRF = True
|
|
|
|
|
|
|
|
sHRF = article["line_1"].replace("h",":")
|
|
|
|
|
|
|
|
print(f"pass HRF => {data.Patient['fip_number']}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for article in data.Articles:
|
|
|
|
|
|
|
|
csv_col = cls_Col(False)
|
|
|
|
|
|
|
|
pass_article = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
##Donnée globales
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.addToIndexs(obj=csv_col,data=data.data["id"],cat="invoice",key="ID")
|
|
|
|
|
|
|
|
self.addToIndexs(obj=csv_col,data=data.data["date"],cat="invoice",key="date") # Date du document
|
|
|
|
|
|
|
|
self.addToIndexs(obj=csv_col, data=data.data["total_price"], cat="invoice", key="total_price")
|
|
|
|
|
|
|
|
self.addToIndexs(obj=csv_col, data=data.data["comments"], cat="invoice", key="comments")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
whitout_transport = False
|
|
|
|
|
|
|
|
for elem in data.Intervention:
|
|
|
|
|
|
|
|
if elem == "without_transportation":
|
|
|
|
|
|
|
|
whitout_transport = True
|
|
|
|
|
|
|
|
print(f"without_transportation {data.Patient['fip_number']}")
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.addToIndexs(obj=csv_col, data=data.Intervention[elem], cat="intervention", key=elem)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if whitout_transport:
|
|
|
|
|
|
|
|
for x in range(8):
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
#csv_col.data.append("")
|
|
|
|
|
|
|
|
self.addToIndexs(obj=csv_col, data="", cat="intervention", key=x)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.addToIndexs(obj=csv_col, data=whitout_transport, cat="intervention", key="whitout_transport")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if b_HRF:
|
|
|
|
|
|
|
|
print(f"pass Change end_time on b_HRF")
|
|
|
|
|
|
|
|
dt = datetime.fromisoformat(csv_col.data[self.a_index["global"].index("end_time")])
|
|
|
|
|
|
|
|
month = "0" + str(dt.month) if dt.month < 10 else dt.month
|
|
|
|
|
|
|
|
csv_col.data[self.a_index["global"].index("end_time")] = f"{dt.year}-{month}-{dt.day}T"+sHRF+":00+01:00"
|
|
|
|
|
|
|
|
print( csv_col.data[self.a_index["global"].index("end_time")])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for elem in data.Patient:
|
|
|
|
|
|
|
|
if elem == "lastname":
|
|
|
|
|
|
|
|
if data.Patient[elem] == None:
|
|
|
|
|
|
|
|
data.Patient[elem] = "Patient inconnu"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if elem == "street_number":
|
|
|
|
|
|
|
|
print(f"ADRESS: data.Patient[elem]")
|
|
|
|
|
|
|
|
if data.Patient[elem] != None and "-" in data.Patient[elem] and "\t" not in data.Patient[elem]:
|
|
|
|
|
|
|
|
data.Patient[elem] = f"\t{data.Patient[elem]}"
|
|
|
|
|
|
|
|
print(f"ERROR DEBUG ADRESS: { data.Patient[elem]}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.addToIndexs(obj=csv_col, data=data.Patient[elem], cat="patient", key=elem)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for elem in data.Debtor:
|
|
|
|
|
|
|
|
if "name" in data.Debtor.keys():
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if elem == "street_number":
|
|
|
|
|
|
|
|
if data.Patient[elem] != None and "-" in data.Patient[elem] and "\t" not in data.Patient[elem]:
|
|
|
|
|
|
|
|
data.Patient[elem] = f"\t{data.Patient[elem]}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if elem != "name":
|
|
|
|
|
|
|
|
csv_col.data.append(data.Debtor[elem])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if "name" in data.Debtor.keys():
|
|
|
|
|
|
|
|
csv_col.data.append(data.Debtor["name"])
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
csv_col.data.append("")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# csv_col.data[126] = ' '.join(filter(None,temp_data)) # Débiteur nom
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Données prestations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if "code" in article.keys():
|
|
|
|
|
|
|
|
if article["code"] == "HRF":
|
|
|
|
|
|
|
|
csv_col = None
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
csv_col.data.append(article["code"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
csv_col.data.append("")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
csv_col.data.append(article["line_1"])
|
|
|
|
|
|
|
|
csv_col.data.append(article["line_2"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if "quantity" in article.keys():
|
|
|
|
|
|
|
|
csv_col.data.append(article["quantity"])
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
csv_col.data.append("")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if "unit_price" in article.keys():
|
|
|
|
|
|
|
|
csv_col.data.append(article["unit_price"])
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
csv_col.data.append("")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if "unit" in article.keys():
|
|
|
|
|
|
|
|
csv_col.data.append(article["unit"])
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
csv_col.data.append("")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if "price" in article.keys():
|
|
|
|
|
|
|
|
csv_col.data.append(article["price"])
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
csv_col.data.append("")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lines.append(csv_col.data)
|
|
|
|
|
|
|
|
csv_col = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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=';')
|
|
|
|
|
|
|
|
for cdr in lines:
|
|
|
|
|
|
|
|
wr.writerow(cdr)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
self.save_file(lines)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def save_file(self,lines, fileName = "src.csv"):
|
|
|
|
def save_file(self,lines, fileName = "src.csv"):
|
|
|
|
with open(os.path.join(dest_dir, fileName), "a+", errors='replace',newline='') as csv_file:
|
|
|
|
with open(os.path.join(dest_dir, fileName), "a+", errors='replace',newline='') as csv_file:
|
|
|
|
wr = csv.writer(csv_file, delimiter=';')
|
|
|
|
wr = csv.writer(csv_file, delimiter=';')
|
|
|
|
|