suppression _amort_exclus.html

This commit is contained in:
Jean-Christophe Engel 2025-01-28 16:53:57 +01:00
parent 5ab7d628a8
commit 022e324bea
2 changed files with 1 additions and 79 deletions

View File

@ -1,69 +0,0 @@
{{* -*- brindille -*- *}}
{{*
Trouver les lignes d'amortissement et d'immobilisation qui sont dans la même écriture
- param : aucun
- résultat : amort_exclus = tableau des amortissements à exclure
*}}
{{* lignes des immo non amorties *}}
{{#load type="immo" where="$$.noamort = true"}}
{{: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}}
{{*:debug condition=$condition*}}
{{* écritures et comptes associés *}}
{{#select
line.id as line_id,
line.id_transaction as trans_id,
account.id as account_id,
account.code as account_code,
account.id_chart as id_chart
FROM acc_transactions_lines AS line
INNER JOIN acc_transactions AS trans on trans.id = line.id_transaction
INNER JOIN acc_accounts AS account ON line.id_account = account.id
INNER JOIN acc_years AS years ON trans.id_year = years.id
WHERE !condition;
!condition=$condition
assign="ecriture"
}}
{{:assign var="ecritures." value="'%s'"|args:$trans_id}}
{{* déterminer le numéro du compte d'amortissement associé au compte d'immobilisation *}}
{{:include
file="./_get_amort_code.html"
code_immo=$account_code
keep="code_amort"
}}
{{:assign var="accounts." value="'%s'"|args:$code_amort}}
{{/select}}
{{*:debug ecritures=$ecritures accounts=$accounts*}}
{{* écritures d'amortissement avec :
- numéro d'écritures obtenus ci-dessus
- numéros de comptes d'amortissement déduits des comptes d'immo ci-dessus
*}}
{{:assign ecritures=$ecritures|implode:","}}
{{:assign ecritures="("|cat:$ecritures|cat:")"}}
{{:assign accounts=$accounts|implode:","}}
{{:assign accounts="("|cat:$accounts|cat:")"}}
{{:assign condition="line.id_transaction IN %s AND account.code IN %s"|args:$ecritures:$accounts}}
{{#select
line.id as line_id,
line.id_transaction as trans_id,
account.id as account_id,
account.code as account_code
FROM acc_transactions_lines AS line
INNER JOIN acc_transactions AS trans on trans.id = line.id_transaction
INNER JOIN acc_accounts AS account ON line.id_account = account.id
INNER JOIN acc_years AS years ON trans.id_year = years.id
WHERE !condition;
!condition=$condition
assign="amort"
}}
{{:assign var="amort_exclus." value=$trans_id}}
{{/select}}

View File

@ -237,12 +237,6 @@
{{if $_GET.amort == null || $_GET.amort != "fini"}}
{{* amortissement à exclure *}}
{{:include
file="_amort_exclus.html"
keep="amort_exclus"
}}
{{* Autres amortissements non rattachés *}}
{{#select
li.id as l_id,
@ -270,11 +264,8 @@
where id_transaction = :id_amort or id_related = :id_amort;
:id_amort=$t_id
}}
{{else}}
{{if $autre_amort.t_id|in:$amort_exclus}}
{{else}}
{{:assign var="autres_amortissements." value=$autre_amort}}
{{/if}}
{{/select}}
{{/select}}