From c852fecb69c86b2c9b0fbdf929f587edd64b68d6 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Fri, 5 Jun 2026 11:23:56 +0200 Subject: [PATCH 1/7] Correction oubli --- delete_infos.html | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/delete_infos.html b/delete_infos.html index 6ec1875..8af819c 100644 --- a/delete_infos.html +++ b/delete_infos.html @@ -20,10 +20,9 @@ {{#select trans.id FROM acc_transactions_lines AS line - INNER JOIN !table ON $$.credit_line_id = line.id + INNER JOIN !table AS credit_link ON $$.credit_line_id = line.id INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id - WHERE $$.type = - "credit_link" AND $$.immo_doc_id = :immo_doc_id + WHERE $$.type = "credit_link" AND $$.immo_doc_id = :immo_doc_id ; !table = $module.table :immo_doc_id = $_GET.immo_doc_id|intval @@ -60,8 +59,7 @@ }} {{* supprimer les docs de liaison *}} - {{:delete type="immo_link" where="$$.immo_doc_id = :immo_doc_id" :immo_doc_id = $_GET.immo_doc_id|intval}} - + {{:delete type="credit_link" where="$$.immo_doc_id = :immo_doc_id" :immo_doc_id = $_GET.immo_doc_id|intval}} {{/if}} {{* supprimer les infos de l'immobilisation *}} From 023a2b81bddb9b7b82f24ae69541ffbf9f74a04c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Fri, 5 Jun 2026 11:24:57 +0200 Subject: [PATCH 2/7] =?UTF-8?q?Am=C3=A9lioration=20pr=C3=A9sentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _get_credit_lines.html | 13 +++++++++---- _immobilisations_autres.html | 2 +- add_infos.html | 18 ++++++++++-------- attach_amort.html | 4 ++-- attach_credit.html | 4 ++-- detach_amort.html | 4 ++-- detach_credit.html | 4 ++-- exit_step1.html | 23 +++++++++++++++++++---- exit_step2.html | 11 ++++++++++- exit_step3.html | 2 +- 10 files changed, 58 insertions(+), 27 deletions(-) diff --git a/_get_credit_lines.html b/_get_credit_lines.html index 2bef7fb..c06adc5 100644 --- a/_get_credit_lines.html +++ b/_get_credit_lines.html @@ -3,8 +3,8 @@ {{* chercher des écritures liées à l'immo paramètre au crédit du même compte @param immo_doc_id : id du doc associé à l'immobilisation - @param linked_immos : liste des écritures liées - @param total_credits : montant total des écritures + @result linked_immos : liste des écritures liées + @result total_credits : montant total des écritures *}} {{:assign linked_immos=null}} {{:assign total_credits=0}} @@ -14,14 +14,19 @@ line.id as line_id, trans.id as trans_id, trans.label, - trans.date + trans.date, + trans.id_year as year, + account.id as account_id, + account.code as account_code, + account.label as account_label FROM acc_transactions_lines AS line INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id + INNER join acc_accounts AS account on line.id_account = account.id WHERE line.id = :credit_line_id; :credit_line_id=$credit_line_id }} {{:assign credit=$credit}} - {{:assign var="linked_immos." doc=$id trans_id=$trans_id credit_line_id=$line_id label=$label amount=$credit date=$date}} + {{:assign var="linked_immos." doc=$id trans_id=$trans_id credit_line_id=$line_id label=$label amount=$credit date=$date account_id=$account_id account_code=$account_code account_label=$account_label year=$year}} {{/select}} {{if $amount == null}} {{:assign total_credits="%d+%d"|math:$total_credits:$credit}} diff --git a/_immobilisations_autres.html b/_immobilisations_autres.html index 992e20c..bacef59 100644 --- a/_immobilisations_autres.html +++ b/_immobilisations_autres.html @@ -172,8 +172,8 @@ label="Paramètres" href="add_infos.html?immo_line_id=%s"|args:$immo_line_id shape="settings" + target="_dialog" }} -{{* target="_dialog"*}} {{/foreach}} diff --git a/add_infos.html b/add_infos.html index 382025b..914c022 100644 --- a/add_infos.html +++ b/add_infos.html @@ -1,21 +1,22 @@ {{* -*- brindille -*- *}} {{* + Classer une immobilisation non prise en charge @param immo_line_id - - TODO ? : - - séparer les cas des immo simples et complexes (BOI) - par exemple pour la durée d'amort par défaut {{:input ...}} - - prise en charge immo => param = immo_line_id - - modif param immo => param = immo_doc_id *}} -{{* cas de la prise en charge *}} {{* données de l'immobilisation *}} {{:assign montant_affecte=0}} {{#load type="immo" where="$$.line = :line_id" :line_id=$_GET.immo_line_id|intval assign="info_immo"}} {{:assign montant_affecte="%d+%d"|math:$montant_affecte:$amount}} {{/load}} +{{if $info_immo != null}} + {{:assign date_defaut=$info_immo.date}} + {{:assign duree_defaut=$info_immo.duration}} + {{:assign choix_defaut=$info_immo.status}} +{{else}} + {{:assign duree_defaut=null}} +{{/if}} {{#select trans.id as immo_trans_id, @@ -139,7 +140,7 @@ status=$status }} - {{if $_POST.amortir}} + {{if $_POST.classify == "managed"}} {{:assign type_immo="managed"}} {{else}} {{:assign type_immo="other"}} @@ -219,6 +220,7 @@ function toggleInputs(event) { const managed = classement_immo.querySelector('input[type=radio][value=managed]'); if (managed.checked) { g.toggle('.masquable', true); + document.getElementById('f_duree').focus(); } else { g.toggle('.masquable', false); } diff --git a/attach_amort.html b/attach_amort.html index 755ff70..adf9e5c 100644 --- a/attach_amort.html +++ b/attach_amort.html @@ -144,9 +144,9 @@ {{/if}} {{if $_GET.from == "exit"}} - {{:redirect to="exit_step2.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}} + {{:redirect force="exit_step2.html?immo_doc_id=%s&ok=1&msg=attach_amort"|args:$_GET.immo_doc_id}} {{else}} - {{:redirect to="amortization.html?immo_doc_id=%s&type_immo=%s&ok=1&msg=attach_amort"|args:$_GET.immo_doc_id:$status}} + {{:redirect force="amortization.html?immo_doc_id=%s&type_immo=%s&ok=1&msg=attach_amort"|args:$_GET.immo_doc_id:$status}} {{/if}} {{/form}} diff --git a/attach_credit.html b/attach_credit.html index 7cd7b16..aed0bae 100644 --- a/attach_credit.html +++ b/attach_credit.html @@ -125,9 +125,9 @@ {{/if}} {{if $_GET.from == "exit"}} - {{:redirect force="exit_step1.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}} + {{:redirect force="exit_step1.html?immo_doc_id=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id}} {{else}} - {{:redirect to="amortization.html?immo_doc_id=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id}} + {{:redirect force="amortization.html?immo_doc_id=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id}} {{/if}} {{*:redirect to="details_immo.html?immo_doc_id=%s&ok=1&msg=attach_credit"|args:$_GET.immo_doc_id*}} {{/form}} diff --git a/detach_amort.html b/detach_amort.html index 14be3bc..eba97ee 100644 --- a/detach_amort.html +++ b/detach_amort.html @@ -26,7 +26,7 @@ }} {{if $_GET.from == "exit"}} - {{:redirect to="exit_step2.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}} + {{:redirect force="exit_step2.html?immo_doc_id=%s&ok=1&msg=detach_amort"|args:$_GET.immo_doc_id}} {{else}} - {{:redirect to="amortization.html?immo_doc_id=%s&ok=1&msg=detach_amort"|args:$_GET.immo_doc_id:}} + {{:redirect force="amortization.html?immo_doc_id=%s&ok=1&msg=detach_amort"|args:$_GET.immo_doc_id:}} {{/if}} diff --git a/detach_credit.html b/detach_credit.html index fb13fcc..f2adb62 100644 --- a/detach_credit.html +++ b/detach_credit.html @@ -25,8 +25,8 @@ }} {{if $_GET.from == "exit"}} - {{:redirect to="exit_step1.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}} + {{:redirect force="exit_step1.html?immo_doc_id=%s&ok=1&msg=detach_avoir"|args:$_GET.immo_doc_id}} {{else}} - {{:redirect to="amortization.html?immo_doc_id=%s&ok=1&msg=detach_avoir&"|args:$_GET.immo_doc_id}} + {{:redirect force="amortization.html?immo_doc_id=%s&ok=1&msg=detach_avoir"|args:$_GET.immo_doc_id}} {{/if}} {{*:redirect to="details_immo.html?immo_doc_id=%s&ok=1&msg=detach&"|args:$_GET.immo_doc_id*}} diff --git a/exit_step1.html b/exit_step1.html index c736e67..f6e105c 100644 --- a/exit_step1.html +++ b/exit_step1.html @@ -122,6 +122,15 @@ {{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}} +{{if $_GET.ok}} + {{if $_GET.msg|match:"attach_avoir"}} + {{:assign msg="Écriture d'avoir attachée"}} + {{elseif $_GET.msg|match:"detach_avoir"}} + {{:assign msg="Écriture d'avoir détachée"}} + {{/if}} +

{{$msg}}

+{{/if}} +
Immobilisation
@@ -147,25 +156,27 @@ {{if $linked_immos != null}}

Écritures d'avoir attachées à l'immobilisation

-{{/if}} - -{{if $linked_immos != null}} + + {{#foreach from=$linked_immos item="line"}} {{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}} + {{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}} + + @@ -173,10 +184,14 @@ {{/foreach}}
Date Libellé MontantN° compteCompte
#{{$line.trans_id}} {{$line.date|date_short}} {{$line.label}} {{"%f"|math:$line.amount|money_currency_html:false|raw}}{{$line.account_code}}{{$line.account_label}} {{:linkbutton label="Détacher" href="detach_credit.html?immo_doc_id=%s&credit_line_id=%s&from=exit"|args:$_GET.immo_doc_id:$line.credit_line_id shape="minus"}}
-{{else}} +{{elseif $credit_lines}}

Vous pouvez attacher une ou plusieurs écritures d'avoir à votre immobilisation

+{{else}} +

+ Aucune écriture au crédit du compte d'immobilisation ; vous pouvez passer à la suite +

{{/if}} {{if $credit_lines}} diff --git a/exit_step2.html b/exit_step2.html index 72deafe..05e5373 100644 --- a/exit_step2.html +++ b/exit_step2.html @@ -132,6 +132,15 @@ {{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}} +{{if $_GET.ok}} + {{if $_GET.msg|match:"attach_amort"}} + {{:assign msg="Écriture d'amortissement attachée"}} + {{elseif $_GET.msg|match:"detach_amort"}} + {{:assign msg="Écriture d'amortissement détachée"}} + {{/if}} +

{{$msg}}

+{{/if}} +
Immobilisation
@@ -196,7 +205,7 @@ {{else}}

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

{{/if}} diff --git a/exit_step3.html b/exit_step3.html index 045cdc5..974a5ef 100644 --- a/exit_step3.html +++ b/exit_step3.html @@ -235,7 +235,7 @@ {{else}}

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

{{/if}} From b3aeb9b09ce2a73dbdde333214a79afc902a8e0c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Fri, 5 Jun 2026 14:10:03 +0200 Subject: [PATCH 3/7] =?UTF-8?q?Simplification=20et=20am=C3=A9lioration=20p?= =?UTF-8?q?r=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}} + From 769123236c0e7e527d811ca8d4ad0b22eee648a4 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Fri, 5 Jun 2026 14:11:10 +0200 Subject: [PATCH 4/7] =?UTF-8?q?Amortissements=20:=20Ajout=20boutons=20et?= =?UTF-8?q?=20=C3=A9critures=20avoir=20li=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amortization.html | 72 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 10 deletions(-) diff --git a/amortization.html b/amortization.html index 3efc74f..34e01b1 100644 --- a/amortization.html +++ b/amortization.html @@ -27,7 +27,7 @@ {{/if}} {{* déduire le montant des écritures liées à l'immo courante au crédit du même compte *}} -{{:include file="_get_credit_lines.html" immo_doc_id=$_GET.immo_doc_id keep="total_credits"}} +{{:include file="_get_credit_lines.html" immo_doc_id=$_GET.immo_doc_id keep="linked_immos, total_credits"}} {{:assign solde="%d-%d"|math:$ligne_immo.amount:$total_credits}} {{if $info_immo.status == "amortized"}} @@ -42,7 +42,7 @@ {{:assign valeur_residuelle="%d-%d"|math:$valeur_residuelle:$total_amort}} {{if $valeur_residuelle > 0}} - {{* lister les amortissements non rattachés à une immo *}} + {{* lister les amortissements non attachés à une immo *}} {{:include file="./_get_free_amort.html" filter_condition="1" keep="free_amort_lines"}} {{/if}} @@ -69,10 +69,14 @@ }} {{if $_GET.ok}} - {{if $_GET.msg|match:"attach"}} - {{:assign msg="Attachement amortissement %s effectué"|args:$_GET.trans_id}} - {{elseif $_GET.msg|match:"detach"}} - {{:assign msg="Détachement amortissement %s affectué"|args:$_GET.trans_id}} + {{if $_GET.msg|match:"attach_amort"}} + {{:assign msg="Attachement amortissement effectué"}} + {{elseif $_GET.msg|match:"detach_amort"}} + {{:assign msg="Détachement amortissement affectué"}} + {{elseif $_GET.msg|match:"attach_avoir"}} + {{:assign msg="Attachement avoir affectué"}} + {{elseif $_GET.msg|match:"detach_avoir"}} + {{:assign msg="Détachement avoir affectué"}} {{elseif $_GET.msg|match:"amortissement"}} {{:assign msg="Amortissement enregistré"}} {{/if}} @@ -104,6 +108,52 @@ + + +{{if $linked_immos != null}} + +{{/if}} +
Immobilisation
@@ -180,15 +230,17 @@ -{{else}} -

Aucun amortissement enregistré pour cette immobilisation

{{/if}} {{if $free_amort_lines}}

- Il y a des écritures d'amortissement qui ne sont pas rattachées à une immobilisation !
- Utilisez le bouton « Rattacher un amortissement » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation. + Il y a des écritures d'amortissement qui ne sont pas attachées à une immobilisation !
+ Utilisez le bouton « Attacher un amortissement » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation.

{{/if}} + +{{if $linked_amort == null}} +

Aucun amortissement enregistré pour cette immobilisation ; utilisez le bouton « Enregistrer un amortissement » pour enregistrer un nouvel amortissement

+{{/if}} {{:form_errors}} {{:admin_footer}} From e43c2ee3c0f495d06be613b7d7b004969655084a Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Fri, 5 Jun 2026 14:17:56 +0200 Subject: [PATCH 5/7] =?UTF-8?q?other=5Famortizations=20:=20am=C3=A9liorati?= =?UTF-8?q?on=20s=C3=A9lection=20=C3=A9critures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- other_amortizations.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/other_amortizations.html b/other_amortizations.html index 4b657a2..6838cbf 100644 --- a/other_amortizations.html +++ b/other_amortizations.html @@ -32,6 +32,12 @@ {{* lister les amortissements non rattachés à une immo *}} {{:include file="./_get_free_amort.html" filter_condition=$filter_condition keep="free_amort_lines"}} +{{* déterminer le compte d'amortissement en fonction du compte d'immobilisation *}} +{{:include + file="./_get_amort_code.html" + code_immo=$ligne_immo.account_code + keep="code_amort" +}} {{:admin_header title="Amortissements non rattachés" custom_css="./style.css" current="module_amortization"}} {{* barre de navigation *}} @@ -52,7 +58,7 @@
- {{:input type="checkbox" value=1 name="unhide" checked="%s"|args:$checked label="Afficher les écritures ignorées"}} + {{:input type="checkbox" value=1 name="unhide" checked="%s"|args:$checked label="Afficher toutes les écritures"}}
@@ -73,6 +79,9 @@ {{#foreach from=$free_amort_lines item="line"}} + {{if $_POST.unhide == null && $line.account_code != $code_amort}} + {{:continue}} + {{/if}} {{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}} {{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}} From ae63f13776de5c3dc2d4c24e3c8da83a1eb42112 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Sat, 6 Jun 2026 11:57:03 +0200 Subject: [PATCH 6/7] =?UTF-8?q?Restauration=20suppression=20erron=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- link_immo.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/link_immo.html b/link_immo.html index a05eab1..77f5cd1 100644 --- a/link_immo.html +++ b/link_immo.html @@ -10,6 +10,10 @@ {{if $message != null}} {{:error message=$message}} {{/if}} +{{:assign label_immo=$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}} +{{/if}} {{* lister les écritures au crédit du compte de l'immobilisation From c7f7ead2a55ef72e893e440a5225ee3dc0e80c5e Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Sat, 6 Jun 2026 11:59:23 +0200 Subject: [PATCH 7/7] =?UTF-8?q?R=C3=A9partition=20op=C3=A9rations=20detail?= =?UTF-8?q?s/amortization?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amortization.html | 9 +++------ attach_credit.html | 4 ++-- detach_credit.html | 4 ++-- details_immo.html | 15 ++++++--------- modify_infos.html | 4 +++- 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/amortization.html b/amortization.html index 34e01b1..2613641 100644 --- a/amortization.html +++ b/amortization.html @@ -110,11 +110,6 @@