111 lines
3.5 KiB
HTML
111 lines
3.5 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}}
|
|
|
|
{{:include file="_get_config.html" keep="module.config"}}
|
|
{{if $_POST.unhide == null}}
|
|
{{:assign filter_condition=" 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 filter_condition="1"}}
|
|
{{/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="other"
|
|
subsubcurrent="amortization"
|
|
type_immo="other"
|
|
autres_amort=$free_amort_lines
|
|
}}
|
|
{{/if}}
|
|
|
|
{{if $_POST.unhide != null}}
|
|
{{:assign checked="checked"}}
|
|
{{/if}}
|
|
|
|
<form method="post" action="">
|
|
<fieldset>
|
|
{{:input type="checkbox" value=1 name="unhide" checked="%s"|args:$checked label="Afficher les écritures ignorées"}}
|
|
</fieldset>
|
|
</form>
|
|
|
|
{{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"}}
|
|
{{: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>{{$line.trans_label}}
|
|
{{if $line.line_label != null && $line.line_label != $line.trans_label}} - {{$line.line_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 à rattacher</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>
|