Généralisation comptes immobilisation
This commit is contained in:
parent
92622fb9a0
commit
33ad15dbfc
4 changed files with 38 additions and 19 deletions
21
index.html
21
index.html
|
|
@ -29,7 +29,6 @@
|
|||
{{/select}}
|
||||
{{/load}}
|
||||
|
||||
{{* lister les immobilisations *}}
|
||||
<section class="immobilisation">
|
||||
<h2 class="ruler">Liste des immobilisations</h2>
|
||||
|
||||
|
|
@ -48,9 +47,17 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{*
|
||||
TODO améliorer cette requête : voir si assez général
|
||||
*}}
|
||||
|
||||
{{* lister les immobilisations *}}
|
||||
{{:read file="./defaut.json" assign="config_json"}}
|
||||
{{:assign config_defaut=$config_json|json_decode}}
|
||||
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
||||
{{:assign quote="'"}}
|
||||
{{:assign condition="("}}
|
||||
{{#foreach from=$prefix_array item="code"}}
|
||||
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$quote|cat:$code|cat:"%"|cat:$quote|cat:" OR "}}
|
||||
{{/foreach}}
|
||||
{{:assign condition=$condition|cat:"0)"}}
|
||||
|
||||
{{#select
|
||||
trans.id as trans_id,
|
||||
|
|
@ -68,9 +75,9 @@
|
|||
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
|
||||
(account.code LIKE '21%' OR account.code LIKE '22%' OR account.code LIKE '27%')
|
||||
ORDER BY trans.date DESC
|
||||
WHERE !condition
|
||||
ORDER BY trans.date DESC;
|
||||
!condition=$condition
|
||||
}}
|
||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
|
||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$account_id:$trans_id_year}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue