112 lines
3.1 KiB
HTML
112 lines
3.1 KiB
HTML
{{* -*- brindille -*- *}}
|
|
|
|
{{*
|
|
Lister les écritures d'amortissement indépendantes
|
|
et proposer des les attacher à l'immo sélectionnée
|
|
@param immo_id = id de la ligne d'immo
|
|
*}}
|
|
|
|
{{* récupérer les infos de l'immobilisation *}}
|
|
{{#select
|
|
line.id as immo_id,
|
|
line.debit as montant,
|
|
trans.id as trans_id,
|
|
trans.label as label,
|
|
trans.date
|
|
FROM acc_transactions_lines AS line
|
|
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
|
WHERE line.id = :line_id;
|
|
:line_id = $_GET.immo_id|intval
|
|
assign=ligne_immo
|
|
}}
|
|
{{else}}
|
|
{{:error message="Immobilisation %s non trouvée"|args:$_GET.immo_id}}
|
|
{{/select}}
|
|
|
|
{{#select
|
|
line.id as l_id,
|
|
line.id_transaction as t_id,
|
|
line.credit as amort_amount,
|
|
line.label as l_label,
|
|
trans.date as t_date,
|
|
trans.label as t_label,
|
|
trans.id_year as amort_year,
|
|
account.id as account_id,
|
|
account.code as account_code,
|
|
account.label as account_label
|
|
FROM acc_transactions_lines AS line
|
|
INNER JOIN acc_accounts AS account ON account.id = line.id_account
|
|
INNER JOIN acc_transactions AS trans ON trans.id = line.id_transaction
|
|
INNER JOIN acc_years AS y ON y.id = trans.id_year
|
|
WHERE account.code LIKE "28%" AND credit > 0 AND (NOT trans.status & 16)
|
|
ORDER BY trans.date, trans.label;
|
|
assign=autre_amort
|
|
}}
|
|
{{#select
|
|
id_transaction,
|
|
id_related
|
|
FROM acc_transactions_links
|
|
WHERE id_transaction = :id_amort OR id_related = :id_amort;
|
|
:id_amort=$t_id
|
|
}}
|
|
{{else}}
|
|
{{:assign var="autres_amortissements." value=$autre_amort}}
|
|
{{/select}}
|
|
{{/select}}
|
|
|
|
{{:admin_header title="Amortissements non rattachés" custom_css="./style.css" current="module_amortissement"}}
|
|
|
|
{{* barre de navigation *}}
|
|
{{if ! $dialog}}
|
|
{{:include
|
|
file="_nav.html"
|
|
current="index"
|
|
subcurrent="autres"
|
|
subsubcurrent="amortization"
|
|
type_immo="autres"
|
|
autres_amort=$autres_amortissements
|
|
}}
|
|
{{/if}}
|
|
|
|
{{if $autres_amortissements != null}}
|
|
<section class="amortissement">
|
|
<h3 class="center-block ruler">Immobilisation « {{$ligne_immo.label}} »</h3>
|
|
<table class="list">
|
|
<thead>
|
|
<tr>
|
|
<th>N°</th>
|
|
<th>Date</th>
|
|
<th class="nombre">Montant</th>
|
|
<th>Libellé</th>
|
|
<th>N° compte</th>
|
|
<th>Compte</th>
|
|
<th class="actions"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{#foreach from=$autres_amortissements item="line"}}
|
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.t_id}}
|
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.amort_year}}
|
|
<tr>
|
|
<td class="num"><a href={{$trans_url}}>#{{$line.t_id}}</a></td>
|
|
<td>{{$line.t_date|date_short}}</td>
|
|
<td class="money">{{"%f"|math:$line.amort_amount|money}}</td>
|
|
<td>{{if $line.l_label == null}}
|
|
{{$line.t_label}}
|
|
{{else}}
|
|
{{$line.l_label}}
|
|
{{/if}}
|
|
</td>
|
|
<td><a href={{$compte_url}}>{{$line.account_code}}</a></td>
|
|
<td>{{$line.account_label}}</td>
|
|
<td>
|
|
{{:linkbutton label="Attacher" href="attach_amort.html?amort_id=%d&immo_id=%d"|args:$line.l_id:$_GET.immo_id shape="plus"}}
|
|
</td>
|
|
</tr>
|
|
{{/foreach}}
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
{{/if}}
|
|
{{:form_errors}}
|
|
{{:admin_footer}}
|