137 lines
4.2 KiB
HTML
137 lines
4.2 KiB
HTML
{{* -*- brindille -*- *}}
|
|
|
|
{{*
|
|
Lister les écritures d'amortissement indépendantes
|
|
et proposer des les attacher à l'immo sélectionnée
|
|
@param immo_doc_id id du doc d'immo associé
|
|
*}}
|
|
{{* données de l'immobilisation *}}
|
|
{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id|intval keep="info_immo, ligne_immo, message"}}
|
|
{{if $message != null}}
|
|
{{:error message=$message}}
|
|
{{/if}}
|
|
|
|
{{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}}
|
|
{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}}
|
|
{{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}}
|
|
{{/if}}
|
|
|
|
{{if $_GET.filter}}
|
|
{{* déterminer le compte d'amortissement en fonction du compte d'immobilisation *}}
|
|
{{:include
|
|
file="./_get_amort_code.html"
|
|
code_immo=$ligne_immo.account_code
|
|
keep="code_amort"
|
|
}}
|
|
{{:include file="_get_config.html" keep="module.config"}}
|
|
{{:assign account_condition="account.code = "|cat:$code_amort}}
|
|
{{:assign filter_condition=$account_condition|cat:" AND NOT ("}}
|
|
{{#foreach from=$module.config.filters item="filter"}}
|
|
{{:assign filter="%"|cat:$filter|cat:"%"|quote_sql}}
|
|
{{:assign filter_condition=$filter_condition|cat:" trans.label LIKE "|cat:$filter|cat:" OR "}}
|
|
{{/foreach}}
|
|
{{:assign filter_condition=$filter_condition|cat:"0)"}}
|
|
{{else}}
|
|
{{:assign account_filter="28%"|quote_sql}}
|
|
{{:assign filter_condition="account.code LIKE "|cat:$account_filter}}
|
|
{{/if}}
|
|
|
|
{{* lister les amortissements non rattachés à une immo *}}
|
|
{{:include file="./_get_free_amort.html" filter_condition=$filter_condition keep="free_amort_lines"}}
|
|
|
|
{{:admin_header title="Amortissements non rattachés" custom_css="./style.css" current="module_amortization"}}
|
|
|
|
{{* barre de navigation *}}
|
|
{{if ! $dialog}}
|
|
{{:include
|
|
file="_nav.html"
|
|
current="index"
|
|
subcurrent="managed"
|
|
subsubcurrent="amortization"
|
|
type_immo="managed"
|
|
autres_amort=$free_amort_lines
|
|
}}
|
|
{{/if}}
|
|
|
|
<nav class="tabs">
|
|
<ul>
|
|
<li {{if $_GET.filter}}class="current"{{/if}}>
|
|
<a href="other_amortizations.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&filter=true">
|
|
Amortissements du compte {{$code_amort}}
|
|
</a>
|
|
</li>
|
|
<li {{if ! $_GET.filter}}class="current"{{/if}}>
|
|
<a href="other_amortizations.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}">
|
|
Tous les amortissements
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
|
|
{{if $free_amort_lines != null}}
|
|
<section class="amortissement">
|
|
<h3 class="ruler">Immobilisation « {{$label_immo}} »</h3>
|
|
<table class="list">
|
|
<thead>
|
|
<tr>
|
|
<th>N°</th>
|
|
<th>Date</th>
|
|
<th>Libellé</th>
|
|
<th class="nombre">Montant</th>
|
|
<th>N° compte</th>
|
|
<th>Compte</th>
|
|
<th class="actions"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{#foreach from=$free_amort_lines item="line"}}
|
|
{{*
|
|
{{if $_GET.filter && $line.account_code != $code_amort}}
|
|
{{:continue}}
|
|
{{/if}}
|
|
*}}
|
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
|
<tr>
|
|
<td class="num"><a href="{{$trans_url}}">#{{$line.trans_id}}</a></td>
|
|
<td>{{$line.trans_date|date_short}}</td>
|
|
<td>
|
|
{{if $line.line_label != null}}
|
|
{{$line.line_label}}
|
|
{{if $line.trans_label != $line.line_label}}
|
|
— {{$line.trans_label}}
|
|
{{/if}}
|
|
{{else}}
|
|
{{$line.trans_label}}
|
|
{{/if}}
|
|
</td>
|
|
<td class="money">{{"%f"|math:$line.amount|money_html:false|raw}}</td>
|
|
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
|
<td>{{$line.account_label}}</td>
|
|
<td>
|
|
{{:linkbutton label="Attacher" href="attach_amort.html?immo_doc_id=%s&amort_line_id=%s"|args:$_GET.immo_doc_id:$line.line_id shape="plus"}}
|
|
</td>
|
|
</tr>
|
|
{{/foreach}}
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
{{else}}
|
|
<p class="block alert">Aucun amortissement pour le compte {{$code_amort}}</p>
|
|
{{/if}}
|
|
|
|
|
|
{{:form_errors}}
|
|
{{:admin_footer}}
|
|
|
|
<script type="text/javascript">
|
|
function changeVisibility(evt, idcheck = 'f_unhide_1') {
|
|
this.form.dispatchEvent(new Event('submit'));
|
|
this.form.submit();
|
|
}
|
|
|
|
(function () {
|
|
document.getElementById('f_unhide_1').onclick = changeVisibility;
|
|
})();
|
|
|
|
</script>
|