Réorganisation présentation page amortissements

This commit is contained in:
Jean-Christophe Engel 2026-06-10 20:36:37 +02:00
parent 54603e9142
commit 6495737428
6 changed files with 72 additions and 209 deletions

View file

@ -81,6 +81,8 @@
{{:assign msg="Détachement avoir affectué"}}
{{elseif $_GET.msg|match:"amortissement"}}
{{:assign msg="Amortissement enregistré"}}
{{elseif $_GET.msg|match:"modif"}}
{{:assign msg="Modifications enregistrées"}}
{{/if}}
<p class="block confirm">{{$msg}}</p>
{{elseif $_GET.err}}
@ -110,48 +112,16 @@
</fieldset>
</form>
<nav style="margin-bottom: 1em;">
<aside> {{* class="right">*}}
{{if $free_amort_lines && ! $created_amort}}
{{:linkbutton
label="Attacher un amortissement"
title="Attacher un amortissement existant"
href="other_amortizations.html?immo_doc_id=%s&filter=true"|args:$_GET.immo_doc_id
shape="link"
target="_dialog"}}
<h3 class="ruler">Immobilisation</h3>
<p class="actions-center">
{{if $total_amort == 0}}
{{:linkbutton label="Modifier les paramètres" href="modify_infos.html?immo_doc_id=%s"|args:$_GET.immo_doc_id shape="edit" target="_dialog"}}
{{if ! $info_immo.created}}
{{:linkbutton label="Supprimer les paramètres" href="delete_infos.html?immo_doc_id=%s"|args:$_GET.immo_doc_id shape="delete" target="_dialog"}}
{{/if}}
{{/if}}
{{:linkbutton
label="Enregistrer un amortissement"
title="Enregistrer un nouvel amortissement"
href="save_amort.html?immo_doc_id=%s"|args:$_GET.immo_doc_id target="_dialog"
shape="plus"
}}
</aside>
</nav>
</p>
{{if $linked_immos != null}}
<aside class="right">
<table class="list">
<caption>Écritures d'avoir liées</caption>
<tbody>
{{#foreach from=$linked_immos item="line"}}
{{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
<tr>
<td class="num"><a href="{{$url}}">#{{$line.trans_id}}</a></td>
<td>{{$line.label}}</td>
<td>{{$line.date|date_short}}</td>
<td class="money">{{"%f"|math:$line.amount|money_currency_html:false|raw}}</td>
<td>
{{if $total_amort == 0}}
{{:linkbutton label="Détacher" href="detach_credit.html?immo_doc_id=%s&credit_line_id=%s"|args:$_GET.immo_doc_id:$line.credit_line_id shape="minus"}}
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
</aside>
{{/if}}
<div class="informations">
<dl class="describe">
@ -186,7 +156,24 @@
</dl>
</div>
<h3 class="ruler">Amortissements enregistrés</h3>
<h3 class="ruler">Amortissements</h3>
<p class="actions-center">
{{if $free_amort_lines && ! $created_amort}}
{{:linkbutton
label="Attacher un amortissement"
title="Attacher un amortissement existant"
href="other_amortizations.html?immo_doc_id=%s&filter=true"|args:$_GET.immo_doc_id
shape="link"
target="_dialog"}}
{{/if}}
{{:linkbutton
label="Enregistrer un amortissement"
title="Enregistrer un nouvel amortissement"
href="save_amort.html?immo_doc_id=%s"|args:$_GET.immo_doc_id target="_dialog"
shape="plus"
}}
</p>
{{if $linked_amort != null}}
<section class="amortissement">
<table class="list">
@ -243,5 +230,41 @@
{{if $linked_amort == null}}
<p class="block alert">Aucun amortissement enregistré pour cette immobilisation ; utilisez le bouton « Enregistrer un amortissement » pour enregistrer un nouvel amortissement</p>
{{/if}}
<h3 class="ruler">Avoirs</h3>
<p class="actions-center">
{{if $total_amort == 0}}
{{:linkbutton label="Attacher une écriture d'avoir" href="link_immo.html?immo_doc_id=%s"|args:$_GET.immo_doc_id shape="link" target="_dialog"}}
{{/if}}
</p>
{{if $linked_immos != null}}
<table class="list">
<thead>
<th class="num"></th>
<th>Date</th>
<th>Libellé</th>
<th class="nombre">Montant</th>
<th class="actions"></th>
</thead>
<tbody>
{{#foreach from=$linked_immos item="line"}}
{{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
<tr>
<td class="num"><a href="{{$url}}">#{{$line.trans_id}}</a></td>
<td>{{$line.date|date_short}}</td>
<td>{{$line.label}}</td>
<td class="money">{{"%f"|math:$line.amount|money_currency_html:false|raw}}</td>
<td>
{{if $total_amort == 0}}
{{:linkbutton label="Détacher" href="detach_credit.html?immo_doc_id=%s&credit_line_id=%s"|args:$_GET.immo_doc_id:$line.credit_line_id shape="minus"}}
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
{{/if}}
{{:form_errors}}
{{:admin_footer}}