From 105080c111f7a92cbeaaeb47f6295703b23d5fcb Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Wed, 20 Mar 2024 18:08:47 +0100 Subject: [PATCH] Correction erreurs montant max amortissement --- amortization.html | 3 ++- save_amort.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/amortization.html b/amortization.html index dccea2c..a9daca2 100644 --- a/amortization.html +++ b/amortization.html @@ -192,6 +192,7 @@ {{#foreach count="%d+1"|math:$nbamort key="num"}} + {{:assign solde_prec=$solde}} {{:assign solde="%f-%d"|math:$solde:$annuite_courante}} {{#select id from acc_years where :amort_date >= start_date and :amort_date <= end_date and closed = 0; :amort_date=$date_amort|parse_date}} {{:assign enregistrer=1}} @@ -214,7 +215,7 @@ {{if $enregistrer == 1}} {{:linkbutton label="Enregistrer" - href="save_amort.html?amount=%d&account=%s&year=%s&trans_id=%d&immo_id=%s&project_id=%d&label=%s&solde=%d"|args:$annuite_courante:$ligne_immo.account_id:$current_year:$ligne_immo.trans_id:$_GET.immo_id:$project_id:$libelle:$solde + href="save_amort.html?amount=%d&account=%s&year=%s&trans_id=%d&immo_id=%s&project_id=%d&label=%s&solde=%d"|args:$annuite_courante:$ligne_immo.account_id:$current_year:$ligne_immo.trans_id:$_GET.immo_id:$project_id:$libelle:$solde_prec shape="right" target="_dialog" }} diff --git a/save_amort.html b/save_amort.html index 52f9065..b824363 100644 --- a/save_amort.html +++ b/save_amort.html @@ -38,8 +38,8 @@ {{/if}} {{* vérifier que le montant ne dépasse pas le solde restant *}} - {{:assign solde="%f/100"|math:$_GET.solde}} - {{if $_POST.montant > $solde}} + {{if $_POST.montant|trim|money_int > $_GET.solde|intval}} + {{:assign solde=$_GET.solde|money_raw}} {{:error message="Le montant indiqué « %s » dépasse le solde à amortir « %s »"|args:$_POST.montant:$solde}} {{/if}}