Ajout projet et proprification

This commit is contained in:
Jean-Christophe Engel 2024-02-17 19:00:24 +01:00
parent f35ca35538
commit 5e081c4f23
3 changed files with 45 additions and 91 deletions

View file

@ -4,12 +4,11 @@
{{:include file="_nav.html" current="index"}}
{{if $_GET.ok}}
<p class="block confirm">Modification effectuée</p>
<p class="block confirm">Immobilisation enregistrée</p>
{{elseif $_GET.err}}
<p class="block error">Modification refusée</p>
<p class="block error">Enregistrement immobilisation refusée</p>
{{/if}}
{{* lister les immobilisations *}}
<section class="immobilisation">
<h2 class="ruler">Liste des immobilisations</h2>
@ -17,21 +16,20 @@
<table class="list">
<thead>
<tr>
<th>Id</th>
<th>Libellé</th>
<th></th>
<th>Date</th>
<th>id_line</th>
<th>Libellé</th>
<th>Montant</th>
<th>Durée</th>
<th>N° compte</th>
<th>Compte</th>
<th>Montant</th>
<th>Projet</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
TODO améliorer cette requête : voir si assez général
*}}
{{#select
@ -41,27 +39,28 @@
line.id as line_id,
account.code as account_code,
account.label as account_label,
line.debit AS debit
line.debit AS debit,
project.label as project_label
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
LEFT JOIN acc_projects AS project ON line.id_project = project.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}}
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$line_id|intval}}{{/load}}
<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>{{$trans_label}}</td>
<td class="money">{{"%f"|math:$debit|money}}</td>
<td class="num">{{$info_immo.duration}}</td>
<td>{{$account_code}}</td>
<td>{{$account_label}}</td>
<td class="money">{{"%f"|math:$debit|money}}</td>
<td>{{$project_label}}</td>
<td class="actions">
{{:linkbutton
label="Amortissements"
@ -88,42 +87,4 @@
</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}}