diff --git a/amortization.html b/amortization.html index 5f70eb1..1bb78db 100644 --- a/amortization.html +++ b/amortization.html @@ -29,13 +29,7 @@ {{* déduire le montant des écritures liées à l'immo courante au crédit du même compte *}} {{:include file="_get_credit_lines.html" immo_doc_id=$_GET.immo_doc_id keep="linked_immos, total_credits"}} {{:assign solde="%d-%d"|math:$ligne_immo.amount:$total_credits}} - -{{if $info_immo.status == "amortized"}} - {{:assign amort_amount=$solde}} - {{:assign valeur_residuelle=0}} -{{else}} - {{:assign valeur_residuelle=$solde}} -{{/if}} +{{:assign valeur_residuelle=$solde}} {{* lister les amortissements liés à l'immobilisation *}} {{:include file="./_get_amort_lines.html" immo_doc_id=$_GET.immo_doc_id keep="linked_amort, total_amort, created_amort"}} @@ -122,7 +116,6 @@ {{/if}} -
Immobilisation
@@ -145,7 +138,7 @@ {{/if}} {{if $valeur_residuelle > 0}}
Montant des amortissements
-
{{"%d-%d"|math:$solde:$valeur_residuelle|money_currency_html:false|raw}}
+
{{$total_amort|money_currency_html:false|raw}}
Valeur nette résiduelle
{{$valeur_residuelle|money_currency_html:false|raw}}
{{/if}} diff --git a/save_amort.html b/save_amort.html index c5c8c7b..1705579 100644 --- a/save_amort.html +++ b/save_amort.html @@ -22,10 +22,6 @@ {{/if}} {{:assign var="amort_label" value="Amortissement %s"|args:$amort_label}} -{{if $info_immo.status == "amortized" || $info_immo.status == "archived"}} - {{:error message="Cette immobilisation est complètement amortie ; il est impossible d'ajouter une écriture d'amortissement"}} -{{/if}} - {{* déduire le montant des écritures liées à l'immo courante au crédit du même compte *}} {{:include file="_get_credit_lines.html" immo_doc_id=$_GET.immo_doc_id keep="total_credits"}} {{:assign var="ligne_immo.amount" value="%d-%d"|math:$ligne_immo.amount:$total_credits}} @@ -82,7 +78,9 @@ {{:assign var="years_data.%d"|args:$id value=$ts_debut|cat:" "|cat:$ts_fin}} {{:assign msg_years=$msg_years|cat:"\n"|cat:" - "|cat:$label|cat:" : "|cat:$debut|cat:" à "|cat:$fin}} {{else}} - {{:error message="Aucun exercice ouvert pour enregistrer un amortissement"}} + {{:assign date_debut=$date_debut|date_short}} + {{:assign msg="Pas d'exercice ouvert pour enregistrer un amortissement à partir du %s"|args:$date_debut}} + {{:error message=$msg}} {{/years}} {{* Traiter l'envoi du formulaire *}}