amortization/index.html

130 lines
3.1 KiB
HTML
Raw Normal View History

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}}
<p class="block confirm">Modification effectuée</p>
{{elseif $_GET.err}}
<p class="block error">Modification refusée</p>
{{/if}}
{{* lister les immobilisations *}}
<section class="immobilisation">
<h2 class="ruler">Liste des immobilisations</h2>
<table class="list">
<thead>
<tr>
<th>Id</th>
<th>Libellé</th>
<th>Date</th>
<th>id_line</th>
<th>N° compte</th>
<th>Compte</th>
<th>Montant</th>
<th class="actions"></th>
</tr>
</thead>
<tbody>
{{*
TODO améliorer cette requête :
- ne pas mettre l'id du PC
- voir si assez général
*}}
{{#select
trans.id as trans_id,
trans.label as trans_label,
trans.date as trans_date,
line.id as line_id,
account.code as account_code,
account.label as account_label,
line.debit AS debit
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
LEFT JOIN acc_projects AS proj ON line.id_project = proj.id
WHERE
account.id_chart = "3"
AND
(account.code LIKE '21%' OR account.code LIKE '22%')
ORDER BY trans.date DESC
}}
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
<tr>
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
<td>{{$trans_label}}</td>
<td>{{$trans_date|date_short}}</td>
<td>{{$line_id}}</td>
<td>{{$account_code}}</td>
<td>{{$account_label}}</td>
<td class="money">{{"%f"|math:$debit|money}}</td>
<td class="actions">
{{:linkbutton
label="Amortissements"
href="amortization.html?line=%s"|args:$line_id
shape="table"
}}
</td>
</tr>
{{/select}}
</tbody>
</table>
</section>
<form method="post" action="">
<fieldset>
<legend>Ajouter une immobilisation</legend>
<p class="submit">
{{:linkbutton
label="Ajouter une immobilisation"
shape="plus"
href="asset.html"
}}
</p>
</fieldset>
</form>
{{* sélectionner un compte *}}
<h1>TEST</h1>
{{:assign var="ll.0.d" value="%f/100"|math:$debit}}
{{:assign var="ll.1.c" value="%f/100"|math:$debit}}
{{* :debug ll=$ll *}}
{{:assign
var="qs"
t=0
l="Amortissement de %s"|args:$trans_label
dt=$trans_date
a00=0
ll=$ll
}}
{{:assign qs=$qs|http_build_query}}
{{:linkbutton
label="Ajouter"
href="!acc/transactions/new.php?%s"|args:$qs
shape="plus"
target="_dialog"
}}
<form method="post" action="">
<fieldset>
<legend>Écriture de note de frais</legend>
{{:assign var="default_account.625" value="625 Déplacements, missions et réceptions"}}
{{:input
type="list"
name="account"
label="Compte de paiement"
required=true
target="!acc/charts/accounts/selector.php?targets=5&key=code&year=%d"|args:7
default=$default_account
}}
</fieldset>
</form>
{{:admin_footer}}