From 3bcd6bcdc8f46347715c0d0f09b2251bc6766d3a Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Wed, 2 Sep 2026 10:04:10 +0200 Subject: [PATCH] =?UTF-8?q?Ne=20pas=20afficher=20montant=20par=20d=C3=A9fa?= =?UTF-8?q?ut=20si=20plus=20d'un=20exercice=20possible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- save_amort.html | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/save_amort.html b/save_amort.html index 2504ff8..2a991e0 100644 --- a/save_amort.html +++ b/save_amort.html @@ -219,13 +219,13 @@ {{if $years|count == 1}} {{:assign var=selected_year value=$years.0.id}} + {{:assign var=date_amort value=$years.0.end_date}} + {{:include file="_calcul_dates.html" date_debut=$date_debut date_fin=$date_amort keep="nbjours"}} + {{* montant de l'amortissement *}} + {{:assign montant_amort="%f/%f/365*%d"|math:$ligne_immo.amount:$info_immo.duration:$nbjours|intval}} + {{:assign montant_amort="min(%f, %d-%d)"|math:$montant_amort:$ligne_immo.amount:$total_amort}} {{/if}} -{{:assign var=date_amort value=$years.0.end_date}} -{{:include file="_calcul_dates.html" date_debut=$date_debut date_fin=$date_amort keep="nbjours"}} -{{* montant de l'amortissement *}} -{{:assign montant_amort="%f/%f/365*%d"|math:$ligne_immo.amount:$info_immo.duration:$nbjours|intval}} -{{:assign montant_amort="min(%f, %d-%d)"|math:$montant_amort:$ligne_immo.amount:$total_amort}} {{:assign var="debit_account.6811" value="6811 — Dot. aux amortissements des immobilisations"}} {{:assign var="credit_account.%s"|args:$code_amort value="%s — "|args:$code_amort|cat:$amort_account_label}} @@ -242,7 +242,13 @@ {{:input type="select" default=$selected_year name="id_year" label="Exercice" required=true default_empty="— Faire un choix —" options=$open_years}} {{:input type="date" name="date_amort" label="Date" required=true default=$date_amort|date_short}} {{:input type="text" name="designation" label="Libellé" required=true default=$amort_label size="50"}} - {{:input type="money" name="montant" label="Montant" required=true default=$montant_amort}} + {{if $total_amort == 0 || $nbjours < 365 || $nbjours > 366}} + {{:assign msg="Montant calculé au prorata du nombre de jours d'amortissement dans l'exercice"}} + {{if $nbjours != null}} + {{:assign msg=$msg|cat:" (%s)"|args:$nbjours}} + {{/if}} + {{/if}} + {{:input type="money" name="montant" label="Montant" required=true default=$montant_amort help=$msg}} {{:input type="list" name="debit_account"