Compare commits

...

10 Commits

Author SHA1 Message Date
Ambulance Clerc
5ec3b70f71 changement version 2025-06-12 14:05:32 +02:00
Ambulance Clerc
30aebc805a refactor 2025-06-12 14:03:24 +02:00
Ambulance Clerc
edbf48609d change version 2025-06-12 13:55:48 +02:00
Ambulance Clerc
0a27e424cf refactor 2025-06-12 13:55:04 +02:00
Ambulance Clerc
14656c4f5a débug print 2025-06-12 12:20:43 +02:00
1a4a044f6b Actualiser cl_attriblink.py 2025-06-10 13:41:17 +00:00
Ambulance Clerc
2b14e8a9b2 update to 20250605-1624 2025-06-05 16:24:48 +02:00
Ambulance Clerc
563800317f add VSL 2025-06-05 16:24:03 +02:00
Ambulance Clerc
5f62b11dac update gitignore 2025-06-05 15:53:53 +02:00
Ambulance Clerc
fac7a7a4b2 remove debug print 2024-11-09 17:30:43 +01:00
6 changed files with 46 additions and 29 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
/update.exe
__pycache__

View File

@@ -1,4 +1,3 @@
class cl_AttribLink():
def __init__(self):
self.invoice_ID = None
@@ -148,6 +147,7 @@ class cl_AttribLink():
self.debtor_country = self.get_value_from_attrib(data=data,obj="debtor",key="country_name")
self.FIP = self.get_value_from_attrib(data=data, obj="patient", key="fip")
self.patient_AVS = self.get_value_from_attrib(data=data, obj="patient", key="AVS")
self.patient_category = self.get_value_from_attrib(data=data, obj="patient", key="category_name")
self.patient_birthdate = self.get_value_from_attrib(data=data, obj="patient", key="birthdate")
self.patient_lastname = self.get_value_from_attrib(data=data, obj="patient", key="lastname")
@@ -187,7 +187,7 @@ class cl_AttribLink():
print(f"ERROR AttribLink => obi[{obj}] and key [{key}] not found.")
def get_value_from_attrib(self,data,obj, key):
print(f"get value from {obj}=>{key}")
#print(f"get value from {obj}=>{key}")
ret = False
t_obj = None
if obj == "data":

View File

@@ -27,8 +27,8 @@ class cls_Invoice:
# con = "#chr(13)##chr(10)#"
con = "\n"
if debitor["gender"] is not None:
concat_str += con + "Monsieur" if debitor["gender"] == "Masculin" else con + "Madame"
if debitor["gender_name"] is not None:
concat_str += con + "Monsieur" if debitor["gender_name"] == "Masculin" else con + "Madame"
# con = "#chr(13)##chr(10)#"
con = "\n"
if debitor["lastname"] is not None:

View File

@@ -1 +1 @@
20241109-1726
20250612-1404

60
main.py
View File

@@ -32,9 +32,9 @@ from custom_popup import *
from cl_attriblink import cl_AttribLink
src_dir = os.getenv('APPDATA') + "\Attrib2Biz\src"
dest_dir = os.getenv('APPDATA') + "\Attrib2Biz\output"
temp_dir = os.getenv('APPDATA') + '\Attrib2Biz\.temp'
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 = []
@@ -554,19 +554,24 @@ class ClercAttrib2Biz():
b_HRF = False
sHRF = ""
b_VSL = False
facture_total = 0
for article in data.Articles:
if 'price' in article:
facture_total += float(self.attrib_link.get_value_from_attrib(data=article,obj="article",key="price"))
if "code" in article.keys():
if self.attrib_link.get_value_from_attrib(data=article,obj="article",key="code") == "HRF":
temp_code = self.attrib_link.get_value_from_attrib(data=article,obj="article",key="code")
if temp_code == "HRF":
b_HRF = True
sHRF = self.attrib_link.get_value_from_attrib(data=article,obj="article",key="line_1").replace("h", ":")
print(f"pass HRF => {self.attrib_link.FIP} = {b_HRF}")
#self.logger.warning(f"HRF: {self.attrib_link.invoice_ID}")
elif "VSL" in temp_code:
b_VSL = True
print(f"Lecture de la facture #{cur_invoice_index} {self.attrib_link.get_value_from_attrib(data=ele,obj="invoice",key="id")} montant total = {self.attrib_link.get_value_from_attrib(data=ele,obj="invoice",key="total_price")} <> {facture_total}")
#print(f"Lecture de la facture #{cur_invoice_index} {self.attrib_link.get_value_from_attrib(data=ele,obj="invoice",key="id")} montant total = {self.attrib_link.get_value_from_attrib(data=ele,obj="invoice",key="total_price")} <> {facture_total}")
if float(self.attrib_link.get_value_from_attrib(data=ele,obj="invoice",key="total_price")) != facture_total:
print(f"ERROR NOT SAME PRICE")
total_facture_total += facture_total
@@ -691,21 +696,24 @@ class ClercAttrib2Biz():
csv_col.data[56] = 0 # prix total
compte_number = None
if self.attrib_link.intervention_base == "Uvrier":
compte_number = 3018
if b_VSL:
compte_number = 3019
else:
if self.attrib_link.intervention_type == "P1":
compte_number = 3001 if self.attrib_link.intervention_team == "Planification" else 3011
if self.attrib_link.intervention_type == "P2":
compte_number = 3002 if self.attrib_link.intervention_team == "Planification" else 3012
if self.attrib_link.intervention_type == "P3":
compte_number = 3003 if self.attrib_link.intervention_team == "Planification" else 3013
if self.attrib_link.intervention_type == "S1":
compte_number = 3004 if self.attrib_link.intervention_team == "Planification" else 3014
if self.attrib_link.intervention_type == "S2":
compte_number = 3005 if self.attrib_link.intervention_team == "Planification" else 3015
if self.attrib_link.intervention_type == "S3":
compte_number = 3005 if self.attrib_link.intervention_team == "Planification" else 3015
if self.attrib_link.intervention_base == "Uvrier":
compte_number = 3018
else:
if self.attrib_link.intervention_type == "P1":
compte_number = 3001 if self.attrib_link.intervention_team == "Planification" else 3011
if self.attrib_link.intervention_type == "P2":
compte_number = 3002 if self.attrib_link.intervention_team == "Planification" else 3012
if self.attrib_link.intervention_type == "P3":
compte_number = 3003 if self.attrib_link.intervention_team == "Planification" else 3013
if self.attrib_link.intervention_type == "S1":
compte_number = 3004 if self.attrib_link.intervention_team == "Planification" else 3014
if self.attrib_link.intervention_type == "S2":
compte_number = 3005 if self.attrib_link.intervention_team == "Planification" else 3015
if self.attrib_link.intervention_type == "S3":
compte_number = 3005 if self.attrib_link.intervention_team == "Planification" else 3015
csv_col.data[59] = compte_number
csv_col.data[60] = 0
@@ -748,10 +756,18 @@ class ClercAttrib2Biz():
csv_col.data[116] = self.ifNotNull(self.attrib_link.patient_category) + " - " + self.ifNotNull(self.attrib_link.intervention_type)
csv_col.data[118] = self.attrib_link.km
csv_col.data[135] = self.attrib_link.intervention_base
if self.attrib_link.debtor_code == "100" or self.attrib_link.debtor_code == "101" or self.attrib_link.debtor_code == "158":
csv_col.data[136] = "EBILL" #code présentation de facture
if self.attrib_link.debtor_code in ["100", "101", "158"]:
temp_facture_model = "EBILL" # code présentation de facture
elif b_VSL:
temp_facture_model = "VSL" # code présentation de facture
else:
csv_col.data[136] = 3 #code présentation de facture
temp_facture_model = 3
print(f"code = {self.attrib_link.debtor_code}, model: {temp_facture_model}")
csv_col.data[136] = temp_facture_model #code présentation de facture
csv_col.data[146] = 3 #Code méthode de payement définit à 3
csv_col.data[168] = 1 if self.attrib_link.intervention_team == "Planification" else 2
csv_col.data[169] = self.attrib_link.patient_AVS

View File

@@ -1,2 +1,2 @@
VERSION = "20241109-1726"
VERSION = "20250612-1404"