Immobilisations archivées : simplification et affichage date sortie
This commit is contained in:
parent
10a87b178d
commit
ab8f695e31
1 changed files with 7 additions and 40 deletions
|
|
@ -2,38 +2,6 @@
|
|||
|
||||
{{* Liste des immobilisations archivées *}}
|
||||
|
||||
{{* Immobilisation archivées prises en charge *}}
|
||||
{{#load type="immo" where="$$.status = 'archived'"}}
|
||||
{{:assign var="lines." value="'%s'"|args:$line}}
|
||||
{{/load}}
|
||||
{{:assign lines=$lines|implode:","}}
|
||||
{{:assign lines="("|cat:$lines|cat:")"}}
|
||||
{{:assign condition="line.id IN %s"|args:$lines}}
|
||||
|
||||
{{#select
|
||||
trans.id as trans_id,
|
||||
trans.label as trans_label,
|
||||
trans.date as trans_date,
|
||||
line.id as immo_id,
|
||||
account.id as account_id,
|
||||
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
|
||||
assign="immo_archivee"
|
||||
}}
|
||||
{{:assign var="immo_archivees.%s"|args:$trans_id value=$immo_archivee}}
|
||||
{{/select}}
|
||||
|
||||
{{* Immobilisation avec une écriture de sortie de bilan *}}
|
||||
{{:read file="./defaut.json" assign="config_json"}}
|
||||
{{:assign config_defaut=$config_json|json_decode}}
|
||||
|
|
@ -44,9 +12,7 @@
|
|||
{{:assign condition=$condition|cat:"account.code LIKE "|cat:$code|cat:" OR "}}
|
||||
{{/foreach}}
|
||||
{{:assign condition=$condition|cat:"0)"}}
|
||||
{{:assign cond2=$condition|replace:"account.":"acc2."}}
|
||||
{{:assign condition=$condition|cat:" AND "|cat:$cond2}}
|
||||
{{:assign condition=$condition|cat:" AND line.debit > 0 AND NOT (trans.status & 16)"}}
|
||||
{{:assign condition=$condition|cat:" AND acc2.code = account.code AND line.debit > 0 AND line.debit = line2.credit AND NOT (trans.status & 16)"}}
|
||||
|
||||
{{#select
|
||||
trans.id as trans_id,
|
||||
|
|
@ -58,7 +24,8 @@
|
|||
account.label as account_label,
|
||||
line.debit AS debit,
|
||||
project.label as project_label,
|
||||
trans.id_year as trans_id_year
|
||||
trans.id_year as trans_id_year,
|
||||
trans2.date as exit_date
|
||||
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
|
||||
|
|
@ -72,9 +39,7 @@
|
|||
!condition=$condition
|
||||
assign="immo_archivee"
|
||||
}}
|
||||
{{if ! $trans_id|key_in:$immo_archivees}}
|
||||
{{:assign var="immo_archivees.%s"|args:$trans_id value=$immo_archivee}}
|
||||
{{/if}}
|
||||
{{/select}}
|
||||
|
||||
<section class="immobilisation">
|
||||
|
|
@ -83,7 +48,8 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>N°</th>
|
||||
<th>Date</th>
|
||||
<th>Mise en service</th>
|
||||
<th>Date sortie</th>
|
||||
<th>Libellé</th>
|
||||
<th class="nombre">Montant</th>
|
||||
<th>N° compte</th>
|
||||
|
|
@ -100,6 +66,7 @@
|
|||
<tr>
|
||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||
<td>{{$trans_date|date_short}}</td>
|
||||
<td>{{$exit_date|date_short}}</td>
|
||||
<td>{{$trans_label}}</td>
|
||||
<td class="money">{{"%f"|math:$debit|money:false}}</td>
|
||||
<td><a href={{$compte_url}}>{{$account_code}}</a></td>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue