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}}
|
{{/select}}
|
||||||
|
|
||||||
{{* chercher les liaisons de l'écriture d'immobilisation *}}
|
{{* chercher les liaisons de l'écriture d'immobilisation *}}
|
||||||
|
{{:assign total_credits=0}}
|
||||||
{{#select
|
{{#select
|
||||||
CASE links.id_related = :immo_trans_id
|
CASE links.id_related = :immo_trans_id
|
||||||
WHEN true THEN links.id_transaction
|
WHEN true THEN links.id_transaction
|
||||||
WHEN false THEN links.id_related
|
WHEN false THEN links.id_related
|
||||||
END as linked_id,
|
END as linked_id,
|
||||||
|
line.credit,
|
||||||
acc.code
|
acc.code
|
||||||
FROM acc_transactions_links as links
|
FROM acc_transactions_links as links
|
||||||
INNER JOIN acc_transactions_lines AS line on line.id_transaction = linked_id
|
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
|
: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}}
|
{{:assign var="linked_transactions.%d."|args:$code value=$linked_id}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{:assign var="immo_transactions" from="linked_transactions.%d"|args:$ligne_immo.code}}
|
{{:assign var="immo_transactions" from="linked_transactions.%d"|args:$ligne_immo.code}}
|
||||||
|
|
@ -173,8 +176,14 @@
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<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>
|
<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>
|
<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>
|
<dt>Date de l'écriture d'immobilisation</dt>
|
||||||
<dd>{{$ligne_immo.date_achat|date_short}}</dd>
|
<dd>{{$ligne_immo.date_achat|date_short}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,8 @@
|
||||||
}}
|
}}
|
||||||
{{:assign total_credits="%d+%d"|math:$total_credits:$credit}}
|
{{:assign total_credits="%d+%d"|math:$total_credits:$credit}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{:assign var="ligne_immo.montant" value="%d-%d"|math:$ligne_immo.montant:$total_credits}}
|
{{:assign montant_amortissable="%d-%d"|math:$ligne_immo.montant:$total_credits}}
|
||||||
{{:assign solde=$ligne_immo.montant}}
|
{{:assign solde=$montant_amortissable}}
|
||||||
|
|
||||||
{{* lister les lignes des écritures d'amortissement liées à l'immobilisation *}}
|
{{* lister les lignes des écritures d'amortissement liées à l'immobilisation *}}
|
||||||
{{#select
|
{{#select
|
||||||
|
|
@ -105,10 +105,10 @@
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{if $status == "amortized"}}
|
{{if $status == "amortized"}}
|
||||||
{{:assign amort_amount=$ligne_immo.montant}}
|
{{:assign amort_amount=$montant_amortissable}}
|
||||||
{{:assign valeur_residuelle=0}}
|
{{:assign valeur_residuelle=0}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign valeur_residuelle=$ligne_immo.montant}}
|
{{:assign valeur_residuelle=$montant_amortissable}}
|
||||||
{{#foreach from=$linked_amort}}
|
{{#foreach from=$linked_amort}}
|
||||||
{{:assign valeur_residuelle="%d-%d"|math:$valeur_residuelle:$amort_amount}}
|
{{:assign valeur_residuelle="%d-%d"|math:$valeur_residuelle:$amort_amount}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
@ -239,8 +239,14 @@
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<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>
|
<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>
|
<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>
|
<dt>Début d'amortissement</dt>
|
||||||
<dd>{{$date_debut|date_short}}</dd>
|
<dd>{{$date_debut|date_short}}</dd>
|
||||||
{{if $duree != null}}
|
{{if $duree != null}}
|
||||||
|
|
@ -249,13 +255,13 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $valeur_residuelle > 0}}
|
{{if $valeur_residuelle > 0}}
|
||||||
<dt>Montant des amortissements</dt>
|
<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>
|
<dt>Valeur nette comptable</dt>
|
||||||
<dd>{{$valeur_residuelle|money_currency_html:false|raw}}</dd>
|
<dd>{{$valeur_residuelle|money_currency_html:false|raw}}</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $duree != null && $valeur_residuelle > 0}}
|
{{if $duree != null && $valeur_residuelle > 0}}
|
||||||
<dt>Annuité estimée</dt>
|
<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}}
|
{{/if}}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue