Correction erreur calcul montant + réorganisation affichage

This commit is contained in:
Jean-Christophe Engel 2024-03-19 16:05:39 +01:00
parent b91c1087ae
commit 061a27d40d

View File

@ -172,11 +172,12 @@
</section> </section>
{{/if}} {{/if}}
{{:assign project_id=$ligne_immo.project_id}} {{if $solde > 0}}
{{:assign project_label=$ligne_immo.project_label}} {{:assign project_id=$ligne_immo.project_id}}
{{:assign nbamort="%d-%d"|math:$duree:$nbamort}} {{:assign project_label=$ligne_immo.project_label}}
{{:assign nbamort="%d-%d"|math:$duree:$nbamort}}
<section class="amortissement"> {{:assign annuite_courante="min(%f,%f)"|math:$annuite:$solde}}
<section class="amortissement">
<h3 class="ruler">Amortissements à enregistrer</h3> <h3 class="ruler">Amortissements à enregistrer</h3>
<table class="list"> <table class="list">
<thead> <thead>
@ -232,25 +233,11 @@
{{/foreach}} {{/foreach}}
</tbody> </tbody>
</table> </table>
</section> </section>
{{/if}}
<section class="amortissement"> {{* Autres amortissements non rattachés *}}
<h3 class="ruler">Autres amortissements non rattachés</h3> {{#select
<table class="list">
<thead>
<tr>
<th></th>
<th>Date</th>
<th class="nombre">Montant</th>
<th>Libellé</th>
<th>N° compte</th>
<th>Compte</th>
<th class="actions"></th>
</tr>
</thead>
<tbody>
{{#select
li.id as l_id, li.id as l_id,
li.id_transaction as t_id, li.id_transaction as t_id,
li.credit as montant, li.credit as montant,
@ -266,45 +253,67 @@
inner join acc_transactions as trans on trans.id = li.id_transaction inner join acc_transactions as trans on trans.id = li.id_transaction
inner join acc_years as y on y.id = trans.id_year inner join acc_years as y on y.id = trans.id_year
where acc.code like "28%" where acc.code like "28%"
order by trans.date, trans.label order by trans.date, trans.label;
}} assign=autre_amort
}}
{{:assign linked="false"}} {{:assign linked="false"}}
{{#select {{#select
id_transaction, id_transaction,
id_related id_related
from acc_transactions_links from acc_transactions_links
where id_transaction = :id_amort or id_related = :id_amort; where id_transaction = :id_amort or id_related = :id_amort;
:id_amort=$t_id}} :id_amort=$t_id
{{:assign linked="true"}} }}
{{/select}} {{:assign var=autre_amort.linked value="true"}}
{{if $linked != "true"}}
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$t_id}}
<tr>
<td class="num"><a href={{$trans_url}}>#{{$t_id}}</a></td>
<td>{{$t_date|date_short}}</td>
<td class="money">{{"%f"|math:$montant|money}}</td>
<td>{{if $l_label == null}}
{{$t_label}}
{{else}} {{else}}
{{$l_label}} {{:assign var="autres_amortissements." value=$autre_amort}}
{{/select}}
{{/select}}
{{if $autres_amortissements != null}}
<section class="amortissement">
<h3 class="ruler">Autres amortissements non rattachés</h3>
<table class="list">
<thead>
<tr>
<th></th>
<th>Date</th>
<th class="nombre">Montant</th>
<th>Libellé</th>
<th>N° compte</th>
<th>Compte</th>
<th class="actions"></th>
</tr>
</thead>
<tbody>
{{#foreach from=$autres_amortissements item="line"}}
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.t_id}}
<tr>
<td class="num"><a href={{$trans_url}}>#{{$line.t_id}}</a></td>
<td>{{$line.t_date|date_short}}</td>
<td class="money">{{"%f"|math:$line.montant|money}}</td>
<td>{{if $line.l_label == null}}
{{$line.t_label}}
{{else}}
{{$line.l_label}}
{{/if}} {{/if}}
</td> </td>
<td>{{$a_code}}</td> <td>{{$line.a_code}}</td>
<td>{{$a_label}}</td> <td>{{$line.a_label}}</td>
<td> <td>
{{if $linked != "true"}} {{if $linked != "true"}}
{{:linkbutton label="Attacher" href="attach_amort.html?amort_id=%d&immo_id=%d"|args:$l_id:$ligne_immo.immo_id shape="plus"}} {{:linkbutton label="Attacher" href="attach_amort.html?amort_id=%d&immo_id=%d"|args:$line.l_id:$ligne_immo.immo_id shape="plus"}}
{{else}} {{else}}
{{:linkbutton label="Attacher" href="" shape="lock" class="disabled"}} {{:linkbutton label="Attacher" href="" shape="lock" class="disabled"}}
{{/if}} {{/if}}
</td> </td>
</tr> </tr>
{{/if}} {{/foreach}}
{{/select}}
</tbody> </tbody>
</table> </table>
</section> </section>
{{/if}}
{{:form_errors}} {{:form_errors}}
{{:admin_footer}} {{:admin_footer}}