Séparation amortissements à rattacher en deux onglets (compte, tous)

This commit is contained in:
Jean-Christophe Engel 2026-06-10 14:24:49 +02:00
parent 33c65388f9
commit 54603e9142
4 changed files with 51 additions and 32 deletions

View file

@ -38,12 +38,14 @@
{{/if}}
{{* 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"}}
{{:include file="./_get_amort_lines.html" immo_doc_id=$_GET.immo_doc_id keep="linked_amort, total_amort, created_amort"}}
{{:assign valeur_residuelle="%d-%d"|math:$valeur_residuelle:$total_amort}}
{{if $valeur_residuelle > 0}}
{{* lister les amortissements non attachés à une immo *}}
{{:include file="./_get_free_amort.html" filter_condition="1" keep="free_amort_lines"}}
{{:assign account_filter="28%"|quote_sql}}
{{:assign filter_condition="account.code LIKE "|cat:$account_filter}}
{{:include file="./_get_free_amort.html" filter_condition=$filter_condition keep="free_amort_lines"}}
{{/if}}
{{:admin_header title="Liste des amortissements" custom_css="./style.css" current="module_amortization"}}
@ -110,11 +112,11 @@
<nav style="margin-bottom: 1em;">
<aside> {{* class="right">*}}
{{if $free_amort_lines}}
{{if $free_amort_lines && ! $created_amort}}
{{:linkbutton
label="Attacher un amortissement"
title="Attacher un amortissement existant"
href="other_amortizations.html?immo_doc_id=%s"|args:$_GET.immo_doc_id
href="other_amortizations.html?immo_doc_id=%s&filter=true"|args:$_GET.immo_doc_id
shape="link"
target="_dialog"}}
{{/if}}
@ -220,7 +222,9 @@
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
<td>{{$line.account_label}}</td>
<td>
{{:linkbutton label="Détacher" href="detach_amort.html?immo_doc_id=%s&amort_line_id=%s"|args:$_GET.immo_doc_id:$line.line_id shape="minus"}}
{{if ! $created_amort}}
{{:linkbutton label="Détacher" href="detach_amort.html?immo_doc_id=%s&amort_line_id=%s"|args:$_GET.immo_doc_id:$line.line_id shape="minus"}}
{{/if}}
</td>
</tr>
{{/foreach}}
@ -229,7 +233,7 @@
</section>
{{/if}}
{{if $free_amort_lines}}
{{if $free_amort_lines && ! $created_amort}}
<p class="block alert">
Il y a des écritures d'amortissement qui ne sont pas attachées à une immobilisation ! <br />
Utilisez le bouton « Attacher un amortissement » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation.