Correction erreur date début amortissement importé depuis balance initiale

This commit is contained in:
Jean-Christophe Engel 2026-09-11 15:25:38 +02:00
parent d149a85018
commit 3173b06cf1
2 changed files with 10 additions and 6 deletions

View file

@ -41,6 +41,11 @@
{{:assign amort_label=$line_label|or:$trans_label}}
{{/foreach}}
{{* date de début du 1er exercice dans paheko *}}
{{#years order="start_date" limit=1}}
{{:assign first_date=$start_date}}
{{/years}}
{{if $total_amort == 0}}
{{* 1er amortissement *}}
{{* déterminer le compte d'amortissement en fonction du compte d'immobilisation *}}
@ -55,8 +60,10 @@
{{:assign var=libelle value="Amortissement %s"|args:$ligne_immo.trans_label}}
{{else}}
{{* amortissements suivants *}}
{{:assign date_debut=$date_debut|strtotime}}
{{:assign date_debut="%d+(60*60*24)"|math:$date_debut|date:"Y-m-d"}}
{{if $date_debut != $first_date}}
{{:assign date_debut=$date_debut|strtotime}}
{{:assign date_debut="%d+(60*60*24)"|math:$date_debut|date:"Y-m-d"}}
{{/if}}
{{/if}}
{{*
@ -244,9 +251,6 @@
{{:input type="text" name="designation" label="Libellé" required=true default=$amort_label size="50"}}
{{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