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

@ -9,4 +9,4 @@
{{:assign ts_debut=$date_debut|strtotime}} {{:assign ts_debut=$date_debut|strtotime}}
{{:assign ts_fin=$date_fin|strtotime}} {{:assign ts_fin=$date_fin|strtotime}}
{{:assign nbjours="1+abs(%d-%d)/(60*60*24)"|math:$ts_fin:$ts_debut}} {{:assign nbjours="round(1+abs(%d-%d)/(60*60*24), 0)"|math:$ts_fin:$ts_debut}}

View file

@ -41,6 +41,11 @@
{{:assign amort_label=$line_label|or:$trans_label}} {{:assign amort_label=$line_label|or:$trans_label}}
{{/foreach}} {{/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}} {{if $total_amort == 0}}
{{* 1er amortissement *}} {{* 1er amortissement *}}
{{* déterminer le compte d'amortissement en fonction du compte d'immobilisation *}} {{* 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}} {{:assign var=libelle value="Amortissement %s"|args:$ligne_immo.trans_label}}
{{else}} {{else}}
{{* amortissements suivants *}} {{* amortissements suivants *}}
{{:assign date_debut=$date_debut|strtotime}} {{if $date_debut != $first_date}}
{{:assign date_debut="%d+(60*60*24)"|math:$date_debut|date:"Y-m-d"}} {{:assign date_debut=$date_debut|strtotime}}
{{:assign date_debut="%d+(60*60*24)"|math:$date_debut|date:"Y-m-d"}}
{{/if}}
{{/if}} {{/if}}
{{* {{*
@ -244,9 +251,6 @@
{{:input type="text" name="designation" label="Libellé" required=true default=$amort_label size="50"}} {{:input type="text" name="designation" label="Libellé" required=true default=$amort_label size="50"}}
{{if $total_amort == 0 || $nbjours < 365 || $nbjours > 366}} {{if $total_amort == 0 || $nbjours < 365 || $nbjours > 366}}
{{:assign msg="Montant calculé au prorata du nombre de jours d'amortissement dans l'exercice"}} {{: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}} {{/if}}
{{:input type="money" name="montant" label="Montant" required=true default=$montant_amort help=$msg}} {{:input type="money" name="montant" label="Montant" required=true default=$montant_amort help=$msg}}
{{:input {{:input