début réorganisation classement immobilisations

This commit is contained in:
Jean-Christophe Engel 2025-02-04 16:25:32 +01:00
parent 2c11d3e4f3
commit fb0d34a4f4
8 changed files with 202 additions and 59 deletions

View file

@ -3,9 +3,9 @@
{{* Liste des immobilisations amortissable ou à définir *}}
<section class="immobilisation">
{{if $amort == "amort"}}
{{if $amort == "encours"}}
<h2 class="ruler">Immobilisations en cours</h2>
{{else}}
{{elseif $amort == "fini"}}
<h2 class="ruler">Immobilisations amorties</h2>
{{/if}}
@ -19,7 +19,6 @@
<th class="nombre">Durée</th>
<th>N° compte</th>
<th>Compte</th>
<th>Projet</th>
<th class="actions"></th>
</tr>
</thead>
@ -46,13 +45,11 @@
account.code as account_code,
account.label as account_label,
line.debit AS debit,
project.label as project_label,
trans.id_year as trans_id_year
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 project ON line.id_project = project.id
WHERE !condition
ORDER BY trans.date DESC;
!condition=$condition
@ -98,7 +95,7 @@
AND
account.code LIKE '28%';
:line_id = $immo_id|intval
}}
}}
{{if $amort_amount == null}}
{{:assign exist_amort=false}}
{{:assign amort_amount=0}}
@ -108,8 +105,9 @@
{{/if}}
{{/select}}
{{* immo amortie ? *}}
{{if $amort == "amort" && $amort_amount >= $debit ||
$amort == "fini" && $amort_amount < $debit
{{if $amort == "encours" && $amort_amount >= $debit ||
$amort == "fini" && $amort_amount < $debit ||
$amortissable == "nsp" && ! $exist_amort
}}
{{:continue}}
{{/if}}
@ -121,30 +119,40 @@
<td class="money">{{if $duration != null}}{{$duration}}{{/if}}</td>
<td><a href={{$compte_url}}>{{$account_code}}</a></td>
<td>{{$account_label}}</td>
<td>{{$project_label}}</td>
<td class="actions">
{{if ! $exist_amort && $duration == null}}
{{if ! $exist_amort}}
{{:linkbutton
label="Ajouter infos"
href="add_infos.html?immo_id=%s&amort=1"|args:$immo_id
shape="help"
target="_dialog"
}}
{{else}}
{{if ! $exist_amort}}
{{:linkbutton
label="Modifier infos"
href="modif_infos.html?immo_id=%s&amort=1"|args:$immo_id
shape="help"
shape="settings"
target="_dialog"
}}
{{/if}}
}}
{{elseif $amortissable == "nsp"}}
{{:linkbutton
label="Amortissements"
href="amortization.html?immo_id=%s&amort=%s"|args:$immo_id:$amort
shape="table"
label="Ajouter infos"
href="add_infos.html?immo_id=%s&amort=1"|args:$immo_id
shape="settings"
target="_dialog"
}}
{{/if}}
{{if $amort == "encours"}}
{{:linkbutton
label="Cession"
href=""
shape="money"
}}
{{elseif $amort == "fini"}}
{{:linkbutton
label="Rebut"
href=""
shape="export"
}}
{{/if}}
{{:linkbutton
label="Amortissements"
href="amortization.html?immo_id=%s&amort=%s"|args:$immo_id:$amort
shape="table"
}}
</td>
</tr>
{{/select}}