Spaces:
Running
Running
pierreguillou
commited on
Update helpers/rapport_generator.py
Browse files- helpers/rapport_generator.py +14 -8
helpers/rapport_generator.py
CHANGED
@@ -310,13 +310,18 @@ class RapportGenerator:
|
|
310 |
"""Formate les valeurs monétaires"""
|
311 |
try:
|
312 |
valeur = str(data.get(f'VALEUR_{prefix}', 0)).strip()
|
|
|
|
|
313 |
except:
|
314 |
valeur = "0.0"
|
315 |
try:
|
316 |
monnaie = data.get(f'MONNAIE_{prefix}', '€').strip()
|
317 |
except:
|
318 |
monnaie = "euros"
|
319 |
-
|
|
|
|
|
|
|
320 |
|
321 |
def generate_report(self):
|
322 |
"""Génère le rapport complet"""
|
@@ -333,22 +338,23 @@ class RapportGenerator:
|
|
333 |
# Liste des champs à traiter
|
334 |
fields_to_process = [
|
335 |
# Champs simples
|
336 |
-
("
|
337 |
-
("
|
338 |
-
("
|
|
|
339 |
|
340 |
# Champs complexes avec formatage spécial
|
341 |
-
("MAGISTRAT_ORDONNANCE_REFERE", "Magistrat
|
342 |
lambda x: self._format_person_info_simple(x, "MAGISTRAT_ORDONNANCE_REFERE")),
|
343 |
|
344 |
-
("GREFFIER_ORDONNANCE_REFERE", "Greffier
|
345 |
lambda x: self._format_person_info_simple(x, "GREFFIER_ORDONNANCE_REFERE")),
|
346 |
|
347 |
("CONSIGNATION", "Consignation",
|
348 |
lambda x: self._format_monetary_value(x, "CONSIGNATION")),
|
349 |
|
350 |
-
("SOMME_A_CONSIGER", "Somme A Consiger",
|
351 |
-
lambda x: self._format_monetary_value(x, "SOMME_A_CONSIGER"))
|
352 |
]
|
353 |
|
354 |
# Traitement de chaque champ
|
|
|
310 |
"""Formate les valeurs monétaires"""
|
311 |
try:
|
312 |
valeur = str(data.get(f'VALEUR_{prefix}', 0)).strip()
|
313 |
+
if valeur == "None":
|
314 |
+
valeur = "0.0"
|
315 |
except:
|
316 |
valeur = "0.0"
|
317 |
try:
|
318 |
monnaie = data.get(f'MONNAIE_{prefix}', '€').strip()
|
319 |
except:
|
320 |
monnaie = "euros"
|
321 |
+
if valeur == "0.0":
|
322 |
+
return "Non spécifié"
|
323 |
+
else:
|
324 |
+
return f"{valeur} {monnaie}".strip()
|
325 |
|
326 |
def generate_report(self):
|
327 |
"""Génère le rapport complet"""
|
|
|
338 |
# Liste des champs à traiter
|
339 |
fields_to_process = [
|
340 |
# Champs simples
|
341 |
+
("TRIBUNAL_ORDONNANCE_REFERE", "Tribunal"),
|
342 |
+
("DATE_ORDONNANCE_REFERE", "Date Ordonnance Référé"),
|
343 |
+
("REFERENCE_DOSSIER", "Référence Dossier"),
|
344 |
+
("REFERENCE_PORTALIS", "Référence Portalis"),
|
345 |
|
346 |
# Champs complexes avec formatage spécial
|
347 |
+
("MAGISTRAT_ORDONNANCE_REFERE", "Magistrat",
|
348 |
lambda x: self._format_person_info_simple(x, "MAGISTRAT_ORDONNANCE_REFERE")),
|
349 |
|
350 |
+
("GREFFIER_ORDONNANCE_REFERE", "Greffier",
|
351 |
lambda x: self._format_person_info_simple(x, "GREFFIER_ORDONNANCE_REFERE")),
|
352 |
|
353 |
("CONSIGNATION", "Consignation",
|
354 |
lambda x: self._format_monetary_value(x, "CONSIGNATION")),
|
355 |
|
356 |
+
#("SOMME_A_CONSIGER", "Somme A Consiger",
|
357 |
+
#lambda x: self._format_monetary_value(x, "SOMME_A_CONSIGER"))
|
358 |
]
|
359 |
|
360 |
# Traitement de chaque champ
|