Réorganisation sortie bilan (onglets) + contrôle cohérence montant

This commit is contained in:
Jean-Christophe Engel 2026-07-13 10:25:11 +02:00
parent 9e620c3efb
commit 24707afd31
17 changed files with 327 additions and 173 deletions

View file

@ -12,7 +12,9 @@
{{/if}}
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$ligne_immo.trans_id}}
{{:assign date_debut=$info_immo.date_mes|or:$info_immo.date_achat|or:$ligne_immo.date_achat}}
{{:assign date_immo=$info_immo.date_mes|or:$info_immo.date_achat|or:$ligne_immo.date_achat}}
{{:assign montant_immo=$info_immo.amount|or:$ligne_immo.amount}}
{{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}}
{{if $label_immo|strpos:$ligne_immo.line_label ===false }}
{{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}}
@ -21,6 +23,10 @@
{{:assign var="ligne_immo.amount" value=$info_immo.amount}}
{{/if}}
{{* déduire le montant des écritures liées à l'immo courante au crédit du même compte *}}
{{:include file="_get_credit_lines.html" immo_doc_id=$_GET.immo_doc_id keep="linked_immos, total_credits"}}
{{:assign solde="%d-%d"|math:$montant_immo:$total_credits}}
{{*
lister les écritures au crédit du compte de l'immobilisation
*}}
@ -59,8 +65,11 @@
:account_code = $account_code
!table = $module.table
:date_immo = $date_immo
assign="other_immos."
assign="credit_line"
}}
{{if $credit_line.credit_amount < $solde}}
{{:assign var="other_immos." value=$credit_line}}
{{/if}}
{{/select}}
{{:admin_header title="Écritures au crédit du compte d'immobilisation" custom_css="./style.css" current="module_amortization"}}
@ -78,12 +87,12 @@
<nav class="tabs">
<ul>
<li {{if $_GET.filter}}class="current"{{/if}}>
<a href="link_immo.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&filter=true">
<a href="link_immo.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&filter=true&from={{$_GET.from}}">
Compte {{$ligne_immo.account_code}} et sous-comptes
</a>
</li>
<li {{if ! $_GET.filter}}class="current"{{/if}}>
<a href="link_immo.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}">
<a href="link_immo.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&from={{$_GET.from}}">
Compte {{$ligne_immo.account_code|substr:0:2}} et sous-comptes
</a>
</li>
@ -98,7 +107,7 @@
<dt>Montant</dt>
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
<dt>Date de l'immobilisation</dt>
<dd>{{$date_debut|date_short}}</dd>
<dd>{{$date_immo|date_short}}</dd>
</dl>
</div>
@ -129,7 +138,7 @@
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
<td>{{$line.account_label}}</td>
<td class="actions">
{{:linkbutton label="Attacher" href="attach_credit.html?credit_line_id=%d&immo_doc_id=%s"|args:$line.credit_line_id:$_GET.immo_doc_id shape="plus"}}
{{:linkbutton label="Attacher" href="attach_credit.html?credit_line_id=%d&immo_doc_id=%s&from=%s"|args:$line.credit_line_id:$_GET.immo_doc_id:$_GET.from shape="plus"}}
</td>
</tr>
{{/foreach}}