Spaces:
Running
Running
Update src/DocumentGen/AutoPDFGeneration.py
Browse files
src/DocumentGen/AutoPDFGeneration.py
CHANGED
|
@@ -89,8 +89,16 @@ def generer_contrat_pret(loan_data, client_info, df_amortissement):
|
|
| 89 |
|
| 90 |
story.append(Paragraph("<b>ARTICLE 3 - TABLEAU D'AMORTISSEMENT</b>", styles['Heading4']))
|
| 91 |
data_amort = [["Date", "Versement", "Solde Restant"]]
|
|
|
|
|
|
|
| 92 |
for _, row in df_amortissement.iterrows():
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
if len(data_amort) > 20:
|
| 96 |
data_amort = data_amort[:20]
|
|
|
|
| 89 |
|
| 90 |
story.append(Paragraph("<b>ARTICLE 3 - TABLEAU D'AMORTISSEMENT</b>", styles['Heading4']))
|
| 91 |
data_amort = [["Date", "Versement", "Solde Restant"]]
|
| 92 |
+
|
| 93 |
+
|
| 94 |
for _, row in df_amortissement.iterrows():
|
| 95 |
+
versement = int(row['Versement']) if pd.notna(row['Versement']) else 0
|
| 96 |
+
solde = int(row['Solde_Restant']) if pd.notna(row['Solde_Restant']) else 0
|
| 97 |
+
data_amort.append([
|
| 98 |
+
row['Date'],
|
| 99 |
+
f"{versement:,}".replace(",", " "),
|
| 100 |
+
f"{solde:,}".replace(",", " ")
|
| 101 |
+
])
|
| 102 |
|
| 103 |
if len(data_amort) > 20:
|
| 104 |
data_amort = data_amort[:20]
|