From b3aeb9b09ce2a73dbdde333214a79afc902a8e0c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Fri, 5 Jun 2026 14:10:03 +0200 Subject: [PATCH] =?UTF-8?q?Simplification=20et=20am=C3=A9lioration=20pr?= =?UTF-8?q?=C3=A9sentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _archives.html | 7 ++-- add_infos.html | 2 +- exit_step1.html | 18 ++++++----- exit_step2.html | 70 ++++++++++++++-------------------------- exit_step3.html | 32 +++++++++--------- other_amortizations.html | 11 +++++-- transfer.html | 1 + 7 files changed, 63 insertions(+), 78 deletions(-) diff --git a/_archives.html b/_archives.html index be33053..8a8f8ad 100644 --- a/_archives.html +++ b/_archives.html @@ -34,7 +34,6 @@ Montant N° compte Compte - Projet @@ -54,13 +53,11 @@ line.debit AS debit, account.id as account_id, account.code as account_code, - account.label as account_label, - project.label as project_label + account.label as account_label 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 @@ -155,8 +152,8 @@ {{"%f"|math:$montant_immo|money_html:false|raw}} {{$account_code}} {{$account_label}} - {{$project_label}} + {{:linkbutton label="Modifier" href="exit_step3.html?immo_doc_id=%s"|args:$info_immo.id shape="edit"}} {{/select}} diff --git a/add_infos.html b/add_infos.html index 914c022..d78097c 100644 --- a/add_infos.html +++ b/add_infos.html @@ -60,7 +60,7 @@ type="immo" line=$_GET.immo_line_id|intval duration=0 - status="archived" + status="managed" assign_new_id="immo_doc_id" }} {{:redirect force="exit_step1.html?immo_doc_id=%s"|args:$immo_doc_id}} diff --git a/exit_step1.html b/exit_step1.html index f6e105c..d3cc904 100644 --- a/exit_step1.html +++ b/exit_step1.html @@ -27,11 +27,11 @@ {{* lister les amortissements liés à l'immobilisation *}} {{:include file="./_get_amort_lines.html" immo_doc_id=$_GET.immo_doc_id keep="linked_amort, total_amort"}} -{{* chercher des écritures au crédit du compte de l'immo sans doc associé *}} {{* - - line.credit < ligne_immo.amount => peut-être un avoir - - line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan - *}} + chercher des écritures au crédit du compte de l'immo sans doc associé + - line.credit < ligne_immo.amount => peut-être un avoir + - line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan +*}} {{#select trans.id as trans_id, trans.label as trans_label, @@ -51,8 +51,12 @@ acc.code = :acc_code AND line.credit > 0 AND credit_line_id NOT IN ( - SELECT json_extract(link.document, '$.credit_line_id') AS line_id FROM !table as link - WHERE json_extract(link.document, '$.type') == "credit_link") + SELECT json_extract(credit_link.document, '$.credit_line_id') AS line_id FROM !table as credit_link + WHERE json_extract(credit_link.document, '$.type') == "credit_link" + UNION + SELECT json_extract(exit_link.document, '$.exit_line_id') AS line_id FROM !table as exit_link + WHERE json_extract(exit_link.document, '$.type') == "exit_link" + ) ; :acc_code=$ligne_immo.account_code !table =$module.table @@ -60,8 +64,6 @@ }} {{if $credit_line.amount < $solde}} {{:assign var="credit_lines." value=$credit_line}} - {{elseif $credit_line.amount == $solde}} - {{:assign var="exit_lines." value=$credit_line}} {{/if}} {{/select}} diff --git a/exit_step2.html b/exit_step2.html index 05e5373..699b947 100644 --- a/exit_step2.html +++ b/exit_step2.html @@ -1,18 +1,16 @@ {{* -*- brindille -*- *}} {{* - Associer les différentes écritures à une immo créée avant la mise - en service du module et sortie du bilan + Associer les différentes écritures à une immo créée et sortie du + bilan avant la mise en service du module @param immo_doc_id : id du doc associé à l'immobilisation *}} {{* données de l'immobilisation *}} -{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id keep="ligne_immo, message"}} +{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id keep="info_immo, ligne_immo, message"}} {{if $message != null}} {{:error message=$message}} {{/if}} -{{* voir si un document a été associé à l'immo *}} -{{#load id=$ligne_immo.line_id assign="info_immo"}}{{/load}} {{#form on="backward"}} {{:redirect to="exit_step1.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}} @@ -37,44 +35,6 @@ {{* lister les amortissements liés à l'immobilisation *}} {{:include file="./_get_amort_lines.html" immo_doc_id=$_GET.immo_doc_id keep="linked_amort, total_amort"}} -{{* - chercher des écritures au crédit du compte de l'immo sans doc associé - - line.credit < ligne_immo.amount => peut-être un avoir - - line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan -*}} -{{#select - trans.id as trans_id, - trans.label as trans_label, - trans.date as date, - trans.id_year as year, - line.id as credit_line_id, - line.label as line_label, - line.credit as amount, - acc.id as account_id, - acc.code as account_code, - acc.label as account_label - FROM acc_transactions AS trans - INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id - INNER JOIN acc_accounts AS acc ON line.id_account = acc.id - LEFT JOIN module_data_amortization AS mda ON json_extract(mda.document, '$.amort_line_id') = line.id - WHERE - acc.code = :acc_code - AND line.credit > 0 - AND credit_line_id NOT IN ( - SELECT json_extract(link.document, '$.credit_line_id') AS line_id FROM !table as link - WHERE json_extract(link.document, '$.type') == "credit_link") - ; - :acc_code=$ligne_immo.account_code - !table =$module.table - assign="credit_line" - }} - {{if $credit_line.amount < $solde}} - {{:assign var="credit_lines." value=$credit_line}} - {{elseif $credit_line.amount == $solde}} - {{:assign var="exit_lines." value=$credit_line}} - {{/if}} -{{/select}} - {{* déterminer le compte d'amortissement en fonction du compte d'immobilisation *}} {{:include file="./_get_amort_code.html" @@ -189,6 +149,9 @@ {{if $line.line_label != null}} {{$line.line_label}} + {{if $line.trans_label != $line.line_label}} + — {{$line.trans_label}} + {{/if}} {{else}} {{$line.trans_label}} {{/if}} @@ -203,15 +166,19 @@ {{/foreach}} -{{else}} +{{elseif $free_amort_lines}}

Vous pouvez attacher une ou plusieurs écritures d'amortissement à l'immobilisation

+{{else}} +

+ Aucune écriture d'amortissement à rattacher ; vous pouvez passer à la suite +

{{/if}} -

Autres écritures d'amortissements

{{if $free_amort_lines}} +

Autres écritures d'amortissements

@@ -232,8 +199,19 @@ - diff --git a/exit_step3.html b/exit_step3.html index 974a5ef..671b415 100644 --- a/exit_step3.html +++ b/exit_step3.html @@ -1,15 +1,11 @@ {{* -*- brindille -*- *}} {{* - Associer les différentes écritures à une immo créée avant la mise - en service du module et sortie du bilan + Associer les différentes écritures à une immo créée et sortie du + bilan avant la mise en service du module @param immo_doc_id : id du doc associé à l'immobilisation *}} -{{* - TODO : affichage après attachement écriture sortie bilan (ligne attachée, bouton détacher) -*}} - {{* données de l'immobilisation *}} {{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id keep="info_immo, ligne_immo, message"}} {{if $message != null}} @@ -29,6 +25,10 @@ {{:redirect to="index.html?type_immo=archived"}} {{/form}} +{{#form on="finish"}} + {{:redirect to="index.html?type_immo=managed"}} +{{/form}} + {{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}} {{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}} {{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}} @@ -68,11 +68,11 @@ {{/select}} {{/if}} -{{* chercher des écritures au crédit du compte de l'immo sans doc associé *}} {{* - - line.credit < ligne_immo.amount => peut-être un avoir - - line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan - *}} + chercher des écritures au crédit du compte de l'immo sans doc associé + - line.credit < ligne_immo.amount => peut-être un avoir + - line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan +*}} {{#select trans.id as trans_id, trans.label as trans_label, @@ -103,9 +103,7 @@ !table =$module.table assign="credit_line" }} - {{if $credit_line.amount < $solde}} - {{:assign var="credit_lines." value=$credit_line}} - {{elseif $credit_line.amount == $solde}} + {{if $credit_line.amount == $solde}} {{:assign var="exit_lines." value=$credit_line}} {{/if}} {{/select}} @@ -233,7 +231,7 @@
#{{$line.amort_trans_id}} {{$line.date|date_short}}{{$line.trans_label}} + + {{if $line.line_label != null}} + {{$line.line_label}} + {{if $line.trans_label != $line.line_label}} + — {{$line.trans_label}} + {{/if}} + {{else}} + {{$line.trans_label}} + {{/if}} +{{* + {{$line.trans_label}} {{if $line.line_label != null && $line.line_label != $line.trans_label}} — {{$line.line_label}}{{/if}} +*}} {{"%f"|math:$line.amort_amount|money_html:false|raw}} {{$line.account_code}}
-{{else}} +{{elseif $exit_lines}}

Vous pouvez attacher une écriture de sortie du bilan à l'immobilisation

@@ -275,14 +273,16 @@ {{elseif $exit_line == null}} -

Aucune écriture de sortie du bilan

+

Aucune écriture de sortie du bilan. Vérifiez l'attachement d'écriture d'avoir.

{{/if}}

{{:button type="submit" name="backward" label="Revenir à l'étape précédente" shape="left" class="main"}} {{if $exit_line}} - {{:button type="submit" name="validate" label="Valider" shape="check" class="main"}} + {{:button type="submit" name="validate" label="Terminer" shape="check" class="main"}} + {{else}} + {{:button type="submit" name="finish" label="Terminer" shape="export" class="main"}} {{/if}}

diff --git a/other_amortizations.html b/other_amortizations.html index c08211b..4b657a2 100644 --- a/other_amortizations.html +++ b/other_amortizations.html @@ -78,8 +78,15 @@ #{{$line.trans_id}} {{$line.trans_date|date_short}} - {{$line.trans_label}} - {{if $line.line_label != null && $line.line_label != $line.trans_label}} - {{$line.line_label}}{{/if}} + + {{if $line.line_label != null}} + {{$line.line_label}} + {{if $line.trans_label != $line.line_label}} + — {{$line.trans_label}} + {{/if}} + {{else}} + {{$line.trans_label}} + {{/if}} {{"%f"|math:$line.amount|money_html:false|raw}} {{$line.account_code}} diff --git a/transfer.html b/transfer.html index fdcbe3e..cb6643c 100644 --- a/transfer.html +++ b/transfer.html @@ -271,6 +271,7 @@ {{/foreach}} +