Ajout affichage montant avoir
This commit is contained in:
parent
f34af9b3fd
commit
f3ce9858ef
2 changed files with 23 additions and 8 deletions
|
|
@ -27,11 +27,13 @@
|
|||
{{/select}}
|
||||
|
||||
{{* chercher les liaisons de l'écriture d'immobilisation *}}
|
||||
{{:assign total_credits=0}}
|
||||
{{#select
|
||||
CASE links.id_related = :immo_trans_id
|
||||
WHEN true THEN links.id_transaction
|
||||
WHEN false THEN links.id_related
|
||||
END as linked_id,
|
||||
line.credit,
|
||||
acc.code
|
||||
FROM acc_transactions_links as links
|
||||
INNER JOIN acc_transactions_lines AS line on line.id_transaction = linked_id
|
||||
|
|
@ -41,6 +43,7 @@
|
|||
;
|
||||
:immo_trans_id = $ligne_immo.immo_trans_id
|
||||
}}
|
||||
{{:assign total_credits="%d+%d"|math:$total_credits:$credit}}
|
||||
{{:assign var="linked_transactions.%d."|args:$code value=$linked_id}}
|
||||
{{/select}}
|
||||
{{:assign var="immo_transactions" from="linked_transactions.%d"|args:$ligne_immo.code}}
|
||||
|
|
@ -173,8 +176,14 @@
|
|||
<dl class="describe">
|
||||
<dt>Immobilisation</dt>
|
||||
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.immo_trans_id}}</a></span> {{$ligne_immo.label}}{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $ligne_immo.label}} — {{$ligne_immo.line_label}}{{/if}}</dd>
|
||||
<dt>Montant</dt>
|
||||
<dt>Montant de l'immobilisation</dt>
|
||||
<dd class="money strong">{{"%f"|math:$ligne_immo.montant|money_currency_html:false|raw}}</dd>
|
||||
{{if $total_credits > 0}}
|
||||
<dt>Montant des avoirs</dt>
|
||||
<dd class="money">{{"%f"|math:$total_credits|money_currency_html:false|raw}}</dd>
|
||||
<dt>Montant à amortir</dt>
|
||||
<dd class="money">{{"%d-%d"|math:$ligne_immo.montant:$total_credits|money_currency_html:false|raw}}</dd>
|
||||
{{/if}}
|
||||
<dt>Date de l'écriture d'immobilisation</dt>
|
||||
<dd>{{$ligne_immo.date_achat|date_short}}</dd>
|
||||
</dl>
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@
|
|||
}}
|
||||
{{:assign total_credits="%d+%d"|math:$total_credits:$credit}}
|
||||
{{/select}}
|
||||
{{:assign var="ligne_immo.montant" value="%d-%d"|math:$ligne_immo.montant:$total_credits}}
|
||||
{{:assign solde=$ligne_immo.montant}}
|
||||
{{:assign montant_amortissable="%d-%d"|math:$ligne_immo.montant:$total_credits}}
|
||||
{{:assign solde=$montant_amortissable}}
|
||||
|
||||
{{* lister les lignes des écritures d'amortissement liées à l'immobilisation *}}
|
||||
{{#select
|
||||
|
|
@ -105,10 +105,10 @@
|
|||
{{/select}}
|
||||
|
||||
{{if $status == "amortized"}}
|
||||
{{:assign amort_amount=$ligne_immo.montant}}
|
||||
{{:assign amort_amount=$montant_amortissable}}
|
||||
{{:assign valeur_residuelle=0}}
|
||||
{{else}}
|
||||
{{:assign valeur_residuelle=$ligne_immo.montant}}
|
||||
{{:assign valeur_residuelle=$montant_amortissable}}
|
||||
{{#foreach from=$linked_amort}}
|
||||
{{:assign valeur_residuelle="%d-%d"|math:$valeur_residuelle:$amort_amount}}
|
||||
{{/foreach}}
|
||||
|
|
@ -239,8 +239,14 @@
|
|||
<dl class="describe">
|
||||
<dt>Immobilisation</dt>
|
||||
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.immo_trans_id}}</a></span> {{$ligne_immo.label}}{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $ligne_immo.label}} — {{$ligne_immo.line_label}}{{/if}}</dd>
|
||||
<dt>Montant</dt>
|
||||
<dt>Montant de l'immobilisation</dt>
|
||||
<dd class="money strong">{{"%f"|math:$ligne_immo.montant|money_currency_html:false|raw}}</dd>
|
||||
{{if $total_credits > 0}}
|
||||
<dt>Montant des avoirs</dt>
|
||||
<dd class="money">{{"%f"|math:$total_credits|money_currency_html:false|raw}}</dd>
|
||||
<dt>Montant à amortir</dt>
|
||||
<dd class="money strong">{{"%f"|math:$montant_amortissable|money_currency_html:false|raw}}</dd>
|
||||
{{/if}}
|
||||
<dt>Début d'amortissement</dt>
|
||||
<dd>{{$date_debut|date_short}}</dd>
|
||||
{{if $duree != null}}
|
||||
|
|
@ -249,13 +255,13 @@
|
|||
{{/if}}
|
||||
{{if $valeur_residuelle > 0}}
|
||||
<dt>Montant des amortissements</dt>
|
||||
<dd>{{"%d-%d"|math:$ligne_immo.montant:$valeur_residuelle|money_currency_html:false|raw}}</dd>
|
||||
<dd>{{"%d-%d"|math:$montant_amortissable:$valeur_residuelle|money_currency_html:false|raw}}</dd>
|
||||
<dt>Valeur nette comptable</dt>
|
||||
<dd>{{$valeur_residuelle|money_currency_html:false|raw}}</dd>
|
||||
{{/if}}
|
||||
{{if $duree != null && $valeur_residuelle > 0}}
|
||||
<dt>Annuité estimée</dt>
|
||||
<dd>{{"min(%d, %f/%d)"|math:$valeur_residuelle:$ligne_immo.montant:$duree|money_currency_html:false|raw}}</dd>
|
||||
<dd>{{"min(%d, %f/%d)"|math:$valeur_residuelle:$montant_amortissable:$duree|money_currency_html:false|raw}}</dd>
|
||||
{{/if}}
|
||||
</dl>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue