2024-02-23 09:24:47 +01:00
|
|
|
{{* -*- brindille -*- *}}
|
2024-02-15 14:23:03 +01:00
|
|
|
{{:admin_header title="Gestion des amortissements" custom_css=$custom_css current="module_amortissement"}}
|
|
|
|
|
|
|
|
{{* barre de navigation *}}
|
|
|
|
{{:include file="_nav.html" current="index"}}
|
|
|
|
|
|
|
|
{{if $_GET.ok}}
|
2024-02-27 11:26:08 +01:00
|
|
|
{{if $_GET.msg|match:"immobilisation"}}
|
|
|
|
{{:assign msg="Immobilisation enregistrée"}}
|
|
|
|
{{elseif $_GET.msg|match:"durée"}}
|
|
|
|
{{:assign msg="Durée enregistrée"}}
|
|
|
|
{{/if}}
|
|
|
|
<p class="block confirm">{{$msg}}</p>
|
2024-02-15 14:23:03 +01:00
|
|
|
{{elseif $_GET.err}}
|
2024-02-27 11:26:08 +01:00
|
|
|
<p class="block error">Échec enregistrement immobilisation</p>
|
2024-02-15 14:23:03 +01:00
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{* lister les immobilisations *}}
|
|
|
|
<section class="immobilisation">
|
|
|
|
<h2 class="ruler">Liste des immobilisations</h2>
|
|
|
|
|
|
|
|
<table class="list">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2024-02-17 19:00:24 +01:00
|
|
|
<th>N°</th>
|
2024-02-15 14:23:03 +01:00
|
|
|
<th>Date</th>
|
2024-02-17 19:00:24 +01:00
|
|
|
<th>Libellé</th>
|
|
|
|
<th>Montant</th>
|
|
|
|
<th>Durée</th>
|
2024-02-15 14:23:03 +01:00
|
|
|
<th>N° compte</th>
|
|
|
|
<th>Compte</th>
|
2024-02-17 19:00:24 +01:00
|
|
|
<th>Projet</th>
|
2024-02-15 14:23:03 +01:00
|
|
|
<th class="actions"></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-02-23 09:24:47 +01:00
|
|
|
{{*
|
2024-02-17 19:00:24 +01:00
|
|
|
TODO améliorer cette requête : voir si assez général
|
2024-02-15 14:23:03 +01:00
|
|
|
*}}
|
|
|
|
|
|
|
|
{{#select
|
|
|
|
trans.id as trans_id,
|
|
|
|
trans.label as trans_label,
|
|
|
|
trans.date as trans_date,
|
2024-03-14 11:03:54 +01:00
|
|
|
line.id as immo_id,
|
2024-02-15 14:23:03 +01:00
|
|
|
account.code as account_code,
|
|
|
|
account.label as account_label,
|
2024-02-17 19:00:24 +01:00
|
|
|
line.debit AS debit,
|
|
|
|
project.label as project_label
|
2024-02-15 14:23:03 +01:00
|
|
|
FROM acc_transactions AS trans
|
|
|
|
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
|
|
|
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
|
|
|
INNER JOIN acc_years AS years ON trans.id_year = years.id
|
2024-02-17 19:00:24 +01:00
|
|
|
LEFT JOIN acc_projects AS project ON line.id_project = project.id
|
2024-02-15 14:23:03 +01:00
|
|
|
WHERE
|
|
|
|
(account.code LIKE '21%' OR account.code LIKE '22%')
|
|
|
|
ORDER BY trans.date DESC
|
|
|
|
}}
|
2024-02-27 11:26:08 +01:00
|
|
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
|
2024-03-14 11:03:54 +01:00
|
|
|
{{#load type="immo" where="$$.line = :line_id" :line_id=$immo_id|intval}}
|
2024-02-27 11:26:08 +01:00
|
|
|
{{*:debug info_immo=$info_immo*}}
|
|
|
|
{{:assign duration=$duration}}
|
|
|
|
{{else}}
|
|
|
|
{{:assign duration=null}}
|
|
|
|
{{/load}}
|
|
|
|
{{*:debug duration=$duration*}}
|
|
|
|
<tr>
|
|
|
|
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
|
|
|
<td>{{$trans_date|date_short}}</td>
|
|
|
|
<td>{{$trans_label}}</td>
|
|
|
|
<td class="money">{{"%f"|math:$debit|money}}</td>
|
|
|
|
<td class="num">{{if $duration != null}}{{$duration}}{{/if}}</td>
|
|
|
|
<td>{{$account_code}}</td>
|
|
|
|
<td>{{$account_label}}</td>
|
|
|
|
<td>{{$project_label}}</td>
|
|
|
|
<td class="actions">
|
|
|
|
{{if $duration == null}}
|
|
|
|
{{:linkbutton
|
|
|
|
label="Ajouter durée"
|
2024-03-14 11:03:54 +01:00
|
|
|
href="add_duration.html?immo_id=%s"|args:$immo_id
|
2024-02-27 11:26:08 +01:00
|
|
|
shape="help"
|
|
|
|
target="_dialog"
|
|
|
|
}}
|
|
|
|
{{else}}
|
|
|
|
{{:linkbutton
|
|
|
|
label="Amortissements"
|
2024-03-14 11:03:54 +01:00
|
|
|
href="amortization.html?immo_id=%s"|args:$immo_id
|
2024-02-27 11:26:08 +01:00
|
|
|
shape="table"
|
|
|
|
}}
|
|
|
|
{{/if}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
2024-02-15 14:23:03 +01:00
|
|
|
{{/select}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<form method="post" action="">
|
|
|
|
<fieldset>
|
|
|
|
<legend>Ajouter une immobilisation</legend>
|
|
|
|
<p class="submit">
|
|
|
|
{{:linkbutton
|
|
|
|
label="Ajouter une immobilisation"
|
|
|
|
shape="plus"
|
2024-02-15 21:09:50 +01:00
|
|
|
href="add_asset.html"
|
2024-03-12 17:09:40 +01:00
|
|
|
target="_dialog"
|
2024-02-15 14:23:03 +01:00
|
|
|
}}
|
|
|
|
</p>
|
|
|
|
</fieldset>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
{{:admin_footer}}
|