From d06dd424b3726c9865104bf4387e013dc5eb4838 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Mon, 4 May 2026 08:34:39 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20recherche=20=C3=A9critures?= =?UTF-8?q?=20au=20cr=C3=A9dit=20du=20compte=20d'une=20immobilisation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- link_immo.html | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/link_immo.html b/link_immo.html index 3543ab8..2757db0 100644 --- a/link_immo.html +++ b/link_immo.html @@ -38,7 +38,6 @@ {{* lister les écritures au crédit du compte de l'immobilisation - variante : utiliser une jointure ; pas forcément plus efficace *}} {{#select line.id as credit_line_id, @@ -57,14 +56,12 @@ INNER JOIN acc_accounts AS account ON account.id = line.id_account INNER JOIN acc_years AS y ON y.id = trans.id_year WHERE account.code = :account_code AND credit > 0 - AND credit_trans_id NOT IN ( - SELECT - CASE WHEN id_transaction = credit_trans_id THEN id_transaction - ELSE id_related - END AS other_id - FROM acc_transactions_links WHERE other_id = credit_trans_id) + AND credit_line_id NOT IN ( + SELECT json_extract(link.document, '$.credit_line_id') AS credit_line_id FROM !table as link + WHERE json_extract(link.document, '$.type') == "immo_link") ORDER BY trans.date, trans.label; :account_code = $ligne_immo.account_code + !table =$module.table assign="other_immos." }} {{/select}}