From 578450da42954e43098c82e38c35887f301b7ff4 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Mon, 20 Apr 2026 11:18:44 +0200 Subject: [PATCH 01/11] Corrections syntaxiques href --- _archives.html | 4 ++-- _immobilisations.html | 4 ++-- _immobilisations_autres.html | 4 ++-- _unfinished.html | 4 ++-- add_infos.html | 2 +- amortization.html | 6 +++--- ignore.html | 2 +- other_amortizations.html | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/_archives.html b/_archives.html index 56f6b14..9f06778 100644 --- a/_archives.html +++ b/_archives.html @@ -149,12 +149,12 @@ {{/select}} - #{{$trans_id}} + #{{$trans_id}} {{$trans_date|date_short}} {{$exit_date|date_short}} {{$trans_label}}{{if $line_label != null && $line_label != $trans_label}} — {{$line_label}}{{/if}} {{"%f"|math:$montant_immo|money_html:false|raw}} - {{$account_code}} + {{$account_code}} {{$account_label}} {{$project_label}} diff --git a/_immobilisations.html b/_immobilisations.html index d287632..9c4b6e6 100644 --- a/_immobilisations.html +++ b/_immobilisations.html @@ -193,14 +193,14 @@ {{:assign var="montant" from="sommes_immo.%s"|args:$account_code}} {{:assign var="sommes_immo.%s"|args:$account_code value="%d+%d"|math:$montant:$montant_immo}} - #{{$immo_trans_id}} + #{{$immo_trans_id}} {{$trans_date|date_short}} {{$trans_label}}{{if $line_label != null && $line_label != $trans_label}} — {{$line_label}}{{/if}} {{$montant_immo|money_html:false|raw}} {{if $duration != null}}{{$duration}}{{/if}} {{$amort_amount|money_html:false|raw}} {{"%d-%d"|math:$montant_immo:$amort_amount|money_html:false|raw}} - {{$account_code}} + {{$account_code}} {{if ! $exist_amort || $status == "unknown"}} {{:linkbutton diff --git a/_immobilisations_autres.html b/_immobilisations_autres.html index 1f08e9b..5327a7b 100644 --- a/_immobilisations_autres.html +++ b/_immobilisations_autres.html @@ -172,11 +172,11 @@ {{:assign nb_immo="%d+1"|math:$nb_immo}} - #{{$immo_trans_id}} + #{{$immo_trans_id}} {{$trans_date|date_short}} {{$trans_label}}{{if $line_label != null && $line_label != $trans_label}} — {{$line_label}}{{/if}} {{"%f"|math:$debit|money_html:false|raw}} - {{$account_code}} + {{$account_code}} {{$account_label}} {{:linkbutton diff --git a/_unfinished.html b/_unfinished.html index a222475..37ab4c9 100644 --- a/_unfinished.html +++ b/_unfinished.html @@ -154,11 +154,11 @@ {{:input type="checkbox" name="selected[]" value=$trans_id}} - #{{$trans_id}} + #{{$trans_id}} {{$trans_date|date_short}} {{$trans_label}} {{"%f"|math:$debit|money_html:false|raw}} - {{$account_code}} + {{$account_code}} {{$account_label}} {{:linkbutton diff --git a/add_infos.html b/add_infos.html index 1ee848b..718f8a1 100644 --- a/add_infos.html +++ b/add_infos.html @@ -172,7 +172,7 @@
Immobilisation
-
#{{$ligne_immo.immo_trans_id}} {{$ligne_immo.label}}{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $ligne_immo.label}} — {{$ligne_immo.line_label}}{{/if}}
+
#{{$ligne_immo.immo_trans_id}} {{$ligne_immo.label}}{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $ligne_immo.label}} — {{$ligne_immo.line_label}}{{/if}}
Montant
{{"%f"|math:$ligne_immo.montant|money_currency_html:false|raw}}
Date de l'écriture d'immobilisation
diff --git a/amortization.html b/amortization.html index cf162a2..12df9fa 100644 --- a/amortization.html +++ b/amortization.html @@ -238,7 +238,7 @@
Immobilisation
-
#{{$ligne_immo.immo_trans_id}} {{$ligne_immo.label}}{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $ligne_immo.label}} — {{$ligne_immo.line_label}}{{/if}}
+
#{{$ligne_immo.immo_trans_id}} {{$ligne_immo.label}}{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $ligne_immo.label}} — {{$ligne_immo.line_label}}{{/if}}
Montant
{{"%f"|math:$ligne_immo.montant|money_currency_html:false|raw}}
Début d'amortissement
@@ -283,7 +283,7 @@ {{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.amort_year}} {{:assign solde="%f-%d"|math:$solde:$line.amort_amount}} - #{{$line.amort_trans_id}} + #{{$line.amort_trans_id}} {{$line.amort_date|date_short}} {{"%f"|math:$line.amort_amount|money_html:false|raw}} {{"%f"|math:$solde|money_html:false|raw}} @@ -293,7 +293,7 @@ — {{$line.amort_line_label}} {{/if}} - {{$line.account_code}} + {{$line.account_code}} {{$line.account_label}} {{:linkbutton label="Détacher" href="detach_amort.html?amort_line_id=%d&immo_line_id=%d"|args:$line.amort_line_id:$ligne_immo.immo_line_id shape="minus"}} diff --git a/ignore.html b/ignore.html index e396a77..96254fd 100644 --- a/ignore.html +++ b/ignore.html @@ -62,7 +62,7 @@
Écriture
-
#{{$ligne_immo.trans_id}} {{$ligne_immo.label}}
+
#{{$ligne_immo.trans_id}} {{$ligne_immo.label}}
Montant
{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}
diff --git a/other_amortizations.html b/other_amortizations.html index 91b379a..632c37e 100644 --- a/other_amortizations.html +++ b/other_amortizations.html @@ -140,13 +140,13 @@ {{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.amort_trans_id}} {{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.amort_year}} - #{{$line.amort_trans_id}} + #{{$line.amort_trans_id}} {{$line.trans_date|date_short}} {{"%f"|math:$line.amort_amount|money_html:false|raw}} {{$line.trans_label}} {{if $line.line_label != null && $line.line_label != $line.trans_label}} - {{$line.line_label}}{{/if}} - {{$line.account_code}} + {{$line.account_code}} {{$line.account_label}} {{:linkbutton label="Attacher" href="attach_amort.html?amort_line_id=%d&immo_line_id=%d"|args:$line.amort_line_id:$_GET.immo_line_id shape="plus"}} From f34af9b3fdc24e713221bfb1f7613025e4923533 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Thu, 23 Apr 2026 11:32:29 +0200 Subject: [PATCH 02/11] Correction erreur sortie bilan --- balance_sheet_exit.html | 6 ++++-- write_exit.html | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/balance_sheet_exit.html b/balance_sheet_exit.html index e7d9ba7..c9a0c0d 100644 --- a/balance_sheet_exit.html +++ b/balance_sheet_exit.html @@ -77,9 +77,11 @@ WHERE l_immo.id = :line_id AND account.code LIKE '28%' ; :line_id = $_GET.immo_line_id|intval - assign="amort_line" + assign="amort_lines." }} +{{/select}} +{{#foreach from=$amort_lines item="amort_line"}} {{#load type="link" where="$$.immo_line_id = :immo_line_id AND $$.amort_trans_id = :amort_trans_id" assign="line" @@ -113,7 +115,7 @@ {{:assign last_amort_date=$amort_line.date}} {{/if}} {{/load}} -{{/select}} +{{/foreach}} {{if $total_amort == 0}} {{if $info_immo.status == "amortized"}} diff --git a/write_exit.html b/write_exit.html index a4de1cd..252a462 100644 --- a/write_exit.html +++ b/write_exit.html @@ -3,7 +3,7 @@ {{* Enregistrer les écritures de sortie du bilan paramètres : - - immo_line_id : numéro de ligne de l'écriture d'immobilisation + - immo_line_id : numéro de ligne de l'écriture d'immobilisation - amort_amount : montant des amortissements - year : exercice de la date de sortie de l'immobilisation - date_mes : date de mise en service de l'immobilisation @@ -30,6 +30,9 @@ }} {{/select}} +{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_line_id|intval}} +{{/load}} + {{* chercher des écritures liées à l'immo courante au crédit du même compte et déduire leur montant de celui de l'immo *}} From f3ce9858ef5bb1e8a145369c1a0e3d95a92173ab Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Sat, 9 May 2026 10:51:45 +0200 Subject: [PATCH 03/11] Ajout affichage montant avoir --- add_infos.html | 11 ++++++++++- amortization.html | 20 +++++++++++++------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/add_infos.html b/add_infos.html index 718f8a1..65eddda 100644 --- a/add_infos.html +++ b/add_infos.html @@ -27,11 +27,13 @@ {{/select}} {{* chercher les liaisons de l'écriture d'immobilisation *}} +{{:assign total_credits=0}} {{#select CASE links.id_related = :immo_trans_id WHEN true THEN links.id_transaction WHEN false THEN links.id_related END as linked_id, + line.credit, acc.code FROM acc_transactions_links as links INNER JOIN acc_transactions_lines AS line on line.id_transaction = linked_id @@ -41,6 +43,7 @@ ; :immo_trans_id = $ligne_immo.immo_trans_id }} + {{:assign total_credits="%d+%d"|math:$total_credits:$credit}} {{:assign var="linked_transactions.%d."|args:$code value=$linked_id}} {{/select}} {{:assign var="immo_transactions" from="linked_transactions.%d"|args:$ligne_immo.code}} @@ -173,8 +176,14 @@
Immobilisation
#{{$ligne_immo.immo_trans_id}} {{$ligne_immo.label}}{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $ligne_immo.label}} — {{$ligne_immo.line_label}}{{/if}}
-
Montant
+
Montant de l'immobilisation
{{"%f"|math:$ligne_immo.montant|money_currency_html:false|raw}}
+ {{if $total_credits > 0}} +
Montant des avoirs
+
{{"%f"|math:$total_credits|money_currency_html:false|raw}}
+
Montant à amortir
+
{{"%d-%d"|math:$ligne_immo.montant:$total_credits|money_currency_html:false|raw}}
+ {{/if}}
Date de l'écriture d'immobilisation
{{$ligne_immo.date_achat|date_short}}
diff --git a/amortization.html b/amortization.html index 12df9fa..3875a05 100644 --- a/amortization.html +++ b/amortization.html @@ -59,8 +59,8 @@ }} {{:assign total_credits="%d+%d"|math:$total_credits:$credit}} {{/select}} -{{:assign var="ligne_immo.montant" value="%d-%d"|math:$ligne_immo.montant:$total_credits}} -{{:assign solde=$ligne_immo.montant}} +{{:assign montant_amortissable="%d-%d"|math:$ligne_immo.montant:$total_credits}} +{{:assign solde=$montant_amortissable}} {{* lister les lignes des écritures d'amortissement liées à l'immobilisation *}} {{#select @@ -105,10 +105,10 @@ {{/select}} {{if $status == "amortized"}} - {{:assign amort_amount=$ligne_immo.montant}} + {{:assign amort_amount=$montant_amortissable}} {{:assign valeur_residuelle=0}} {{else}} - {{:assign valeur_residuelle=$ligne_immo.montant}} + {{:assign valeur_residuelle=$montant_amortissable}} {{#foreach from=$linked_amort}} {{:assign valeur_residuelle="%d-%d"|math:$valeur_residuelle:$amort_amount}} {{/foreach}} @@ -239,8 +239,14 @@
Immobilisation
#{{$ligne_immo.immo_trans_id}} {{$ligne_immo.label}}{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $ligne_immo.label}} — {{$ligne_immo.line_label}}{{/if}}
-
Montant
+
Montant de l'immobilisation
{{"%f"|math:$ligne_immo.montant|money_currency_html:false|raw}}
+ {{if $total_credits > 0}} +
Montant des avoirs
+
{{"%f"|math:$total_credits|money_currency_html:false|raw}}
+
Montant à amortir
+
{{"%f"|math:$montant_amortissable|money_currency_html:false|raw}}
+ {{/if}}
Début d'amortissement
{{$date_debut|date_short}}
{{if $duree != null}} @@ -249,13 +255,13 @@ {{/if}} {{if $valeur_residuelle > 0}}
Montant des amortissements
-
{{"%d-%d"|math:$ligne_immo.montant:$valeur_residuelle|money_currency_html:false|raw}}
+
{{"%d-%d"|math:$montant_amortissable:$valeur_residuelle|money_currency_html:false|raw}}
Valeur nette comptable
{{$valeur_residuelle|money_currency_html:false|raw}}
{{/if}} {{if $duree != null && $valeur_residuelle > 0}}
Annuité estimée
-
{{"min(%d, %f/%d)"|math:$valeur_residuelle:$ligne_immo.montant:$duree|money_currency_html:false|raw}}
+
{{"min(%d, %f/%d)"|math:$valeur_residuelle:$montant_amortissable:$duree|money_currency_html:false|raw}}
{{/if}}
From a89ec26574d3fa4b33e0dacd56e1521ec3dae930 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Sat, 9 May 2026 13:20:40 +0200 Subject: [PATCH 04/11] Version initiale aide --- aide.md | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 aide.md diff --git a/aide.md b/aide.md new file mode 100644 index 0000000..9f020ad --- /dev/null +++ b/aide.md @@ -0,0 +1,145 @@ +# Module de gestion d'immobilisations et amortissements pour Paheko + +## Préambule +* Ce module recense les écritures d'immobilisation et d'amortissement + présentes dans la comptabilité et offre la possibilité de saisir de + nouvelles écritures d'immobilisation, de calculer et d'enregistrer + les écritures d'amortissement. +* Les écritures d'amortissement **liées à une écriture + d'immobilisation** lui sont automatiquement associées par le module + ; par contre, les écritures d'amortissement qui ne sont **pas liées + à une écriture d'immobilisation** sont détectées mais doivent être + associées manuellement à leur immobilisation. + +### Fonctionnalités + * créer une immobilisation + * créer des écritures d'amortissement pour une immobilisation + * associer une écriture d'amortissement « orpheline » à une écriture + d'immobilisation + * sortir une immobilisation du bilan en fin de de vie ou par cession + * réunir des écritures d'immobilisation en cours de constitution + pour créer une immobilisation amortissable + * filtrer les écritures d'immobilisation et d'amortissement par + libellé + * classer manuellement une écriture d'immobilisation (utile pour les + immobilisations créées avant la mise en service du module) + +## Comment faire pour ... + +### Enregistrer une écriture d'immobilisation +Il s'agit de créer une nouvelle écriture d'immobilisation ; pour cela, +cliquer le bouton « Ajouter une immobilisation » qui est présent sur +la plupart des onglets ; dans la fenêtre de saisie qui s'affiche il +suffit de saisir les données de l'immobilisation puis de cliquer +« Ajouter » : + * Exercice : sélectionner l'exercice dans lequel enregistrer l'écriture + * Date d'acquisition : doit être située dans l'exercice sélectionné + * Libellé + * Montant + * Compte de décaissement + * Compte d'immobilisation + * Projet + * case Amortir : laisser cochée pour amortir l'immobilisation, + dé-cocher pour ne pas l'amortir + * Durée d'amortissement en années : à saisir uniquement si + l'immobilisation doit être amortie + * Date de mise en service : c'est la date de première utilisation ; + à renseigner uniquement si différente de la date d'acquisition ; + doit être postérieure ou égale à la date d'acquisition + +### Enregistrer une écriture d'amortissement + * Il n'est possible d'enregistrer une nouvelle écriture + d'amortissement pour une immobilisation que si la date + d'acquisition et la durée d'immobilisation ont été préalablement + définies. + * À partir de l'onglet « Amortissables », cliquer le bouton + « Amortissements » en face de l'immobilisation choisie ; dans la + page suivante, cliquer le bouton « Enregistrer un amortissement » + ; dans la fenêtre de saisie qui s'affiche, il faut renseigner les + informations suivantes : + * Exercice : sélectionner l'exercice dans lequel enregistrer l'écriture + * Date de l'écriture : doit être située dans l'exercice + sélectionné et postérieure à la date de mise en service + * Libellé + * Montant : caclculé par le module ; il peut être modifié si + nécessaire, par exemple pour l'arrondir à un nombre entier + * Compte de débit : par défaut c'est le compte *6811 : Dotation + aux amortissements des immobilisations* + * Compte d'amortissement : par défaut c'est le compte qui + correspond au compte de l'immobilisation + +### Attacher une écriture d'amortissement à une immobilisation +* Il se peut qu'il existe des écritures d'amortissement qui ont été + saisies à l'extérieur du module et qui ne sont pas liées à une + écriture d'immobilisation : le module ne peut donc pas les associer + automatiquement à leur écriture d'immobilisation. +* Quand on affiche la liste des amortissements d'une immobilisation en + cliquant le bouton « Amortissements », on peut voir la liste des + écritures d'amortissements qui ne sont associées à aucune + immobilisation en cliquant le bouton « Rattacher une écriture » ; on + peut alors choisir d'en attacher certaines à l'immobilisation + courante. + +### Sortir une immobilisation du bilan + +### Incorporer une écriture d'immobilisation existante dans le module + +### Transformer des immobilisations en cours en immobilisation amortissable + +### Marquer « à ignorer » des écritures + +### Ignorer des écritures selon leur libellé + + + +## Description de l'interface + +Les écritures d'immobilisation sont réparties en plusieurs onglets. + +### Amortissables +Cet onglet liste les immobilisations en cours d'amortissement. + +##### bouton Paramètres + +Ce bouton affiche une page qui permet de modifier les caractéristiques +d'une immobilisation ; + +On peut décider de son classement : + * Amortir ; c'est le choix par défaut pour les immobilisations de + cet onglet + * Amortissement terminé : cette immobilisation sera alors classée + parmi les immobilisations amorties ; c'est le choix par défaut + pour les immobilisations de l'onglet Amorties + * Ignorer l'écriture : cette écriture n'apparaîtra plus dans la + liste des immobilisations + +Pour les immobilisations à amortir, on peut préciser : + * obligatoirement la durée d'amortissement en années + * optionnellement la date de mise en service si elle est différente + de la date d'acquisition + +###### bouton Amortissements + +Ce bouton affiche la liste des amortissements déjà réalisés pour une +immobilisation ; à partir de cette page, il est possible d'enregistrer +un nouvel amortissement ou bien d'attacher une écriture +d'amortissement à l'immobilisation + +### Amorties +Cet onglet liste les immobilisations dont l'amortissement est terminé +mais toujours en service dans l'association. + +### Sorties du bilan +Cette page liste les immobilisations sorties du bilan, donc qui ne sont +plus en service dans l'association, soit parce qu'elles sont hors +d'usage, soit parce qu'elles ont été cédées. + +### En cours +Cette page liste les immobilisations en cours de constitution, donc +non amortissables ; à terme, elles sont destinées à être regroupées +pour être transformées en immobilisation amortissable. + +### Autres +Cette page liste les écritures d'immobilisation pas (encore) prises en +charge par le module et sans écriture d'amortissement associée. + From 82d42352e61cb555ad9ae98327d90fd0a8e3f279 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Mon, 11 May 2026 09:07:13 +0200 Subject: [PATCH 05/11] =?UTF-8?q?Ajout=20Incorporer=20une=20=C3=A9criture?= =?UTF-8?q?=20d'immobilisation=20et=20modif=20Attacher=20une=20=C3=A9critu?= =?UTF-8?q?re=20d'amortissement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aide.md | 78 ++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 20 deletions(-) diff --git a/aide.md b/aide.md index 9f020ad..90849fa 100644 --- a/aide.md +++ b/aide.md @@ -14,7 +14,7 @@ ### Fonctionnalités * créer une immobilisation * créer des écritures d'amortissement pour une immobilisation - * associer une écriture d'amortissement « orpheline » à une écriture + * associer une écriture d'amortissement *orpheline* à une écriture d'immobilisation * sortir une immobilisation du bilan en fin de de vie ou par cession * réunir des écritures d'immobilisation en cours de constitution @@ -26,12 +26,63 @@ ## Comment faire pour ... +### Incorporer une écriture d'immobilisation existante dans le module +Si on a créé des immobilisations et éventuellement des amortissements +avec Paheko *avant* la mise en service du module *Amortissements*, +il est possible de les prendre en charge avec le module. Les +immobilisations concernées sont regroupées dans l'onglet Autres. + +- cliquer le bouton *Paramètres* en face de l'immobilisation à prendre + en charge +- cocher *Immobilisation à amortir* pour spécifier qu'on veut amortir + l'immobilisation ; plusieurs champs d'informations s'affichennt : + - Durée d'amortissement : renseigner la durée (obligatoire) + - Écritures liées au crédit du compte d'immobilisation : lorsqu'on + acquiert une immobilisation, il se peut que par la suite on + obtienne une ristourne ou un avoir ; cet avoir est enregistré + dans Paheko par une écriture dont le montant est au crédit du + compte d'immobilisation ; le module offre la possibilité + d'associer cette écriture d'avoir à l'écriture + d'immobilisation. En effet, le montant amortissable est égal au + montant d'acquisition de l'immobilisation moins la somme des + avoirs. Pour cela, cliquer le bouton *Ajouter* puis sélectionner + une écriture : cette écriture sera associée à l'écriture + d'immobilisation et son montant déduit du montant de + l'immobilisation pour donner le montant à amortir + - Date de mise en service : c'est la date à laquelle + l'immobilisation est en état de fonctionner, qui peut être + postérieure à la date d'acquisition ; c'est cette date qui est + prise en compte dans le calcul des amortissements ; si elle + coïncide avec la date d'acquisition, inutile de la renseigner. +- L'immobilisation apparait ensuite dans l'onglet *Amortissables* ; on + peut vérifier et éventuellement modifier ses paramètres grâce au + bouton Paramètres + +### Attacher une écriture d'amortissement à une immobilisation +Si des écritures d'amortissement ont été saisies avec Paheko *avant* +la mise en service du module *Amortissements*, on peut les associer à +leur immobilisation : + +- cliquer le bouton *Amortissements* en face de l'immobilisation concernée ; si la mention + +> « Il existe des écritures d'amortissement qui ne sont pas rattachées à une immobilisation ! +> Utilisez le bouton « Rattacher une écriture » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation. » + +est présente, c'est qu'il existe des écritures d'amortissement saisies avec Paheko *avant* +la mise en service du module. + +- cliquer le bouton *Rattacher une écriture* pour en afficher la liste +- le cas échéant, cliquer *Attacher* en face de l'écriture à rattacher + +De retour sur la page des amortissements, on constate la présence de l'écriture d'amortissement qu'on vient d'attacher ; on peut répéter le processus plusieurs fois si nécessaire. On peut aussi détacher une écriture si on s'est trompé. + + ### Enregistrer une écriture d'immobilisation Il s'agit de créer une nouvelle écriture d'immobilisation ; pour cela, -cliquer le bouton « Ajouter une immobilisation » qui est présent sur +cliquer le bouton *Ajouter une immobilisation* qui est présent sur la plupart des onglets ; dans la fenêtre de saisie qui s'affiche il suffit de saisir les données de l'immobilisation puis de cliquer -« Ajouter » : +*Ajouter* : * Exercice : sélectionner l'exercice dans lequel enregistrer l'écriture * Date d'acquisition : doit être située dans l'exercice sélectionné * Libellé @@ -52,9 +103,9 @@ suffit de saisir les données de l'immobilisation puis de cliquer d'amortissement pour une immobilisation que si la date d'acquisition et la durée d'immobilisation ont été préalablement définies. - * À partir de l'onglet « Amortissables », cliquer le bouton - « Amortissements » en face de l'immobilisation choisie ; dans la - page suivante, cliquer le bouton « Enregistrer un amortissement » + * À partir de l'onglet *Amortissables*, cliquer le bouton + *Amortissements* en face de l'immobilisation choisie ; dans la + page suivante, cliquer le bouton *Enregistrer un amortissement* ; dans la fenêtre de saisie qui s'affiche, il faut renseigner les informations suivantes : * Exercice : sélectionner l'exercice dans lequel enregistrer l'écriture @@ -68,25 +119,12 @@ suffit de saisir les données de l'immobilisation puis de cliquer * Compte d'amortissement : par défaut c'est le compte qui correspond au compte de l'immobilisation -### Attacher une écriture d'amortissement à une immobilisation -* Il se peut qu'il existe des écritures d'amortissement qui ont été - saisies à l'extérieur du module et qui ne sont pas liées à une - écriture d'immobilisation : le module ne peut donc pas les associer - automatiquement à leur écriture d'immobilisation. -* Quand on affiche la liste des amortissements d'une immobilisation en - cliquant le bouton « Amortissements », on peut voir la liste des - écritures d'amortissements qui ne sont associées à aucune - immobilisation en cliquant le bouton « Rattacher une écriture » ; on - peut alors choisir d'en attacher certaines à l'immobilisation - courante. ### Sortir une immobilisation du bilan -### Incorporer une écriture d'immobilisation existante dans le module - ### Transformer des immobilisations en cours en immobilisation amortissable -### Marquer « à ignorer » des écritures +### Marquer *à ignorer* des écritures ### Ignorer des écritures selon leur libellé From 243441f4fa9d5c479bee93dd3d05a8ca604c2e14 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Tue, 12 May 2026 17:21:15 +0200 Subject: [PATCH 06/11] =?UTF-8?q?Am=C3=A9lioration=20pr=C3=A9sentation=20e?= =?UTF-8?q?t=20correction=20erreur=20libell=C3=A9=20nouvel=20amortissement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amortization.html | 16 ++++++++-------- save_amort.html | 3 +-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/amortization.html b/amortization.html index 3875a05..747ff8f 100644 --- a/amortization.html +++ b/amortization.html @@ -239,20 +239,20 @@
Immobilisation
#{{$ligne_immo.immo_trans_id}} {{$ligne_immo.label}}{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $ligne_immo.label}} — {{$ligne_immo.line_label}}{{/if}}
-
Montant de l'immobilisation
-
{{"%f"|math:$ligne_immo.montant|money_currency_html:false|raw}}
- {{if $total_credits > 0}} -
Montant des avoirs
-
{{"%f"|math:$total_credits|money_currency_html:false|raw}}
-
Montant à amortir
-
{{"%f"|math:$montant_amortissable|money_currency_html:false|raw}}
- {{/if}}
Début d'amortissement
{{$date_debut|date_short}}
{{if $duree != null}}
Durée
{{$duree}} ans
{{/if}} +
Montant de l'immobilisation
+
{{"%f"|math:$ligne_immo.montant|money_currency_html:false|raw}}
+ {{if $total_credits > 0}} +
Montant des avoirs
+
{{"%f"|math:$total_credits|money_currency_html:false|raw}}
+
Montant à amortir
+
{{"%f"|math:$montant_amortissable|money_currency_html:false|raw}}
+ {{/if}} {{if $valeur_residuelle > 0}}
Montant des amortissements
{{"%d-%d"|math:$montant_amortissable:$valeur_residuelle|money_currency_html:false|raw}}
diff --git a/save_amort.html b/save_amort.html index 4aa8e64..3be761c 100644 --- a/save_amort.html +++ b/save_amort.html @@ -111,7 +111,6 @@ {{/load}} {{/select}} - {{:assign total_amort=0}} {{:assign valeur_residuelle=$ligne_immo.montant}} {{#foreach from=$linked_amort}} @@ -120,7 +119,7 @@ {{:assign date_debut=$amort_date}} {{:assign code_amort=$account_code}} {{:assign amort_account_label=$account_label}} - {{:assign amort_label=$amort_label}} + {{:assign amort_label=$trans_label}} {{/foreach}} {{if $valeur_residuelle == 0}} From 8c9893f9e4bbf993a4c15c2034a924744fd09a59 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Wed, 13 May 2026 09:16:17 +0200 Subject: [PATCH 07/11] =?UTF-8?q?Restauration=20d=C3=A9tection=20amortisse?= =?UTF-8?q?ments=20li=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _immobilisations.html | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/_immobilisations.html b/_immobilisations.html index 9c4b6e6..2bb7174 100644 --- a/_immobilisations.html +++ b/_immobilisations.html @@ -30,13 +30,18 @@ {{* vérifier l'existence de la table du module *}} - {{#load limit="1"}} - {{:assign table_presente=true}} + {{if $module.table != null}} + {{:assign columns="$$.duration as duration, $$.status as status,"}} + {{:assign table_join="LEFT JOIN !table AS info ON $$.line = line.id"}} + {{:assign doc_condition1="($$.status <> 'ignored' AND $$.status <> 'archived')"}} + {{:assign doc_condition2="$$.status IS NULL"}} {{else}} - {{:assign table_presente=false}} - {{/load}} + {{:assign columns=""}} + {{:assign table_join=""}} + {{:assign doc_condition1="0"}} + {{:assign doc_condition2="1"}} + {{/if}} - {{if $table_presente}} {{* lister les immobilisations *}} {{:assign account_condition="("}} {{#foreach from=$module.config.prefixes item="code"}} @@ -44,7 +49,7 @@ {{:assign account_condition=$account_condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}} {{/foreach}} {{:assign account_condition=$account_condition|cat:"0)"}} - {{:assign doc_condition="($$.status <> 'ignored' AND $$.status <> 'archived')"}} + {{*:assign doc_condition="($$.status <> 'ignored' AND $$.status <> 'archived')"*}} {{:assign filter_condition="NOT ("}} {{#foreach from=$module.config.filters item="filter"}} @@ -52,9 +57,9 @@ {{:assign filter_condition=$filter_condition|cat:" trans_label LIKE "|cat:$filter|cat:" OR "}} {{/foreach}} {{:assign filter_condition=$filter_condition|cat:"0)"}} - {{:assign filter_condition="($$.status IS NULL AND NOT (trans.status & 16) AND "|cat:$filter_condition|cat:")"}} + {{:assign filter_condition="("|cat:$doc_condition2|cat:" AND NOT (trans.status & 16) AND "|cat:$filter_condition|cat:")"}} - {{:assign condition=$account_condition|cat:" AND debit > 0 AND ("|cat:$filter_condition|cat:" OR "|cat:$doc_condition|cat:")"}} + {{:assign condition=$account_condition|cat:" AND debit > 0 AND ("|cat:$filter_condition|cat:" OR "|cat:$doc_condition1|cat:")"}} {{:assign nb_immo=0}} {{:assign total_immo = 0}} @@ -67,16 +72,17 @@ line.label AS line_label, account.id as account_id, account.code as account_code, - trans.id_year as trans_id_year, - $$.duration as duration, - $$.status as status + !columns + trans.id_year as trans_id_year 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 !table AS info ON $$.line = line.id + !table_join WHERE !condition ORDER BY trans.date DESC; + !columns=$columns + !table_join=$table_join !table=$module.table !condition=$condition }} @@ -250,9 +256,9 @@ {{/if}} -{{/if}} +{{*/if*}} - {{if $nb_immo == 0 || ! $table_presente}} + {{if $nb_immo == 0}}

Aucune immobilisation

{{/if}} From 7903afbd0cabd92b8b08ae1fd84b3ba093cdbee6 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Mon, 15 Jun 2026 12:13:24 +0200 Subject: [PATCH 08/11] Simplification navigation --- _nav.html | 56 ++++++++++++---------------------------- add_asset.html | 2 +- add_infos.html | 2 +- amortization.html | 37 +++++++++++--------------- attach_amort.html | 2 +- attach_credit.html | 5 ++-- balance_sheet_exit.html | 8 +++++- compute_exit_data.html | 11 ++++++-- index.html | 2 +- link_immo.html | 5 ++-- modify_infos.html | 2 +- other_amortizations.html | 5 ++-- save_amort.html | 22 +++++++++++++--- transfer.html | 2 +- write_exit.html | 7 ++++- 15 files changed, 84 insertions(+), 84 deletions(-) diff --git a/_nav.html b/_nav.html index fac14e4..c81e1f3 100644 --- a/_nav.html +++ b/_nav.html @@ -1,55 +1,31 @@ {{* -*- brindille -*- *}} {{if $linked_amort != null}} diff --git a/attach_amort.html b/attach_amort.html index 5c2951c..738a3c0 100644 --- a/attach_amort.html +++ b/attach_amort.html @@ -134,7 +134,7 @@ {{* barre de navigation *}} {{if ! $dialog}} - {{:include file="_nav.html" current="config" subcurrent="init" subsubcurrent="parameter"}} + {{:include file="_nav.html" current="managed" subcurrent="attach_amort"}} {{/if}} {{:form_errors}} diff --git a/attach_credit.html b/attach_credit.html index 6e8d22a..276dc76 100644 --- a/attach_credit.html +++ b/attach_credit.html @@ -115,9 +115,8 @@ {{if ! $dialog}} {{:include file="_nav.html" - current="config" - subcurrent="other" - subsubcurrent="immo" + current="managed" + subcurrent="attach_credit" type_immo="other" }} {{/if}} diff --git a/balance_sheet_exit.html b/balance_sheet_exit.html index 2b4cf6b..d844c91 100644 --- a/balance_sheet_exit.html +++ b/balance_sheet_exit.html @@ -10,6 +10,12 @@ {{if $message != null}} {{:error message=$message}} {{/if}} +{{* TODO VÉRIFIER SI UTILE *}} +{{* +{{if $info_immo.duration == null || $info_immo.duration == 0}} + {{:error message="Vous devez renseigner la durée d'amortissement au préalable"}} +{{/if}} +*}} {{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}} {{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}} @@ -135,7 +141,7 @@ {{:admin_header title="Sortie de bilan" custom_css="./style.css" current="module_amortization"}} {{if ! $dialog}} - {{:include file="_nav.html" current="index" subcurrent="%s"|args:$_GET.type_immo subsubcurrent="balance_exit"}} + {{:include file="_nav.html" current="%s"|args:$_GET.type_immo subcurrent="balance_exit"}} {{/if}} {{:form_errors}} diff --git a/compute_exit_data.html b/compute_exit_data.html index 7caf90b..c824af5 100644 --- a/compute_exit_data.html +++ b/compute_exit_data.html @@ -9,7 +9,9 @@ @param date_debut : date de début de la période d'amortissement complémentaire @param exit_date : date de sortie de l'immobilisation *}} -{{* TODO *}} + +{{* TODO boutons de navigation avant-arrière*}} + {{* données de l'immobilisation *}} {{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id|intval keep="info_immo, ligne_immo, message"}} {{if $message != null}} @@ -58,7 +60,12 @@ {{* barre de navigation *}} {{if ! $dialog}} - {{:include file="_nav.html" current="index" subcurrent="balance_exit"}} + {{if $valeur_nette > 0}} + {{:assign type_immo="managed"}} + {{else}} + {{:assign type_immo="amortized"}} + {{/if}} + {{:include file="_nav.html" current="%s"|args:$type_immo subcurrent="balance_exit"}} {{/if}} {{:form_errors}} diff --git a/index.html b/index.html index 5007c48..f2fab2e 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@ {{:admin_header title="Immobilisations en cours de constitution" custom_css="./style.css" current="module_amortization" subcurrent="unfinished"}} {{/if}} -{{:include file="_nav.html" current="index" subcurrent=$type_immo}} +{{:include file="_nav.html" current=$type_immo}} {{if $_GET.ok}} {{if $_GET.msg|match:"immobilisation"}} diff --git a/link_immo.html b/link_immo.html index 77f5cd1..ddee4dd 100644 --- a/link_immo.html +++ b/link_immo.html @@ -51,9 +51,8 @@ {{if ! $dialog}} {{:include file="_nav.html" - current="config" - subcurrent="other" - subsubcurrent="immo" + current="managed" + subcurrent="link_immo" type_immo="other" }} {{/if}} diff --git a/modify_infos.html b/modify_infos.html index 5b89e91..7694e83 100644 --- a/modify_infos.html +++ b/modify_infos.html @@ -153,7 +153,7 @@ {{:admin_header title="Modifier l'immobilisation" custom_css="./style.css" current="module_amortization"}} {{if ! $dialog}} - {{:include file="_nav.html" current="index" subcurrent="%s"|args:$_GET.type_immo subsubcurrent="parameter"}} + {{:include file="_nav.html" current="managed" subcurrent="modify_infos"}} {{/if}} {{:form_errors}} diff --git a/other_amortizations.html b/other_amortizations.html index bc5b2c5..8716a25 100644 --- a/other_amortizations.html +++ b/other_amortizations.html @@ -38,9 +38,8 @@ {{if ! $dialog}} {{:include file="_nav.html" - current="index" - subcurrent="managed" - subsubcurrent="amortization" + current="managed" + subcurrent="amortization" type_immo="managed" autres_amort=$free_amort_lines }} diff --git a/save_amort.html b/save_amort.html index 1705579..224d52e 100644 --- a/save_amort.html +++ b/save_amort.html @@ -65,7 +65,7 @@ *}} {{:assign msg_years=""}} {{#years closed=false order="start_date" where="start_date <= :debut AND :debut <= end_date" - :debut=$date_debut assign=years.}} + :debut=$date_debut assign="years."}} {{if $total_amort == 0}} {{:assign ts_debut=$date_debut|strtotime}} {{else}} @@ -178,6 +178,20 @@ {{* enregistrer la liaison des lignes *}} {{#foreach from=$result.lines item="line"}} {{if $line.account_code == $credit_account|keys|value:0}} + {{* TODO VOIR SI CORRECT ET UTILE *}} + {{* + vérifier la présence d'un doc avec cette ligne d'amortissement + (cas de la suppression manuelle d'un amortissement) + *}} + + {{#load type="amort_link" where="$$.amort_line_id = :amort_line_id" :amort_line_id=$line.id debug=true assign="info_amort"}} + {{:debug info_amort=$info_amort}} + {{:assign uuid=$key}} + {{:break}} + {{else}} + {{:assign uuid=""|uuid}} + {{/load}} +{{:debug uuid=$uuid}} {{:save key=""|uuid type="amort_link" @@ -205,12 +219,14 @@ {{* barre de navigation *}} {{if ! $dialog}} - {{:include file="_nav.html" current="index" subcurrent="managed" subsubcurrent="amortization"}} + {{:include file="_nav.html" current="managed" subcurrent="amortization"}} {{/if}} {{:form_errors}} -{{:assign var=selected_year value=$years.0.id}} +{{if $years|count == 1}} + {{:assign var=selected_year value=$years.0.id}} +{{/if}} {{:assign var=date_amort value=$years.0.end_date}} {{:include file="_calcul_dates.html" date_debut=$date_debut date_fin=$date_amort keep="nbjours"}} diff --git a/transfer.html b/transfer.html index a9c9f50..17d3b31 100644 --- a/transfer.html +++ b/transfer.html @@ -192,7 +192,7 @@ {{:admin_header title="Transfert d'immobilisation en cours" custom_css="./style.css" current="module_amortization"}} {{if ! $dialog}} - {{:include file="_nav.html" current="index" subcurrent="unfinished" subsubcurrent="transfer"}} + {{:include file="_nav.html" current="unfinished" subcurrent="transfer"}} {{/if}} {{:form_errors}} diff --git a/write_exit.html b/write_exit.html index 0a17d3b..beb6e68 100644 --- a/write_exit.html +++ b/write_exit.html @@ -267,7 +267,12 @@ {{:admin_header title="Sortie du bilan" custom_css="./style.css" current="module_amortization"}} {{if ! $dialog}} - {{:include file="_nav.html" current="index" subcurrent="balance_exit"}} + {{if $valeur_nette > 0}} + {{:assign type_immo="managed"}} + {{else}} + {{:assign type_immo="amortized"}} + {{/if}} + {{:include file="_nav.html" current="%s"|args:$type_immo subcurrent="balance_exit"}} {{/if}} {{* From 2af96b279673ac94703c4ff7d3bd07593eef5315 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Mon, 15 Jun 2026 12:27:16 +0200 Subject: [PATCH 09/11] =?UTF-8?q?Amortization=20:=20am=C3=A9lioration=20af?= =?UTF-8?q?fichage=20boutons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amortization.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/amortization.html b/amortization.html index 95939d4..a3378b2 100644 --- a/amortization.html +++ b/amortization.html @@ -45,11 +45,11 @@ {{:admin_header title="Détails de l'immobilisation" custom_css="./style.css" current="module_amortization"}} {{* barre de navigation *}} -{{if $_GET.type_immo == "amortized" || $valeur_residuelle == 0 }} +{{if $_GET.type_immo == "amortized" && $valeur_residuelle == 0}} {{:assign current="amortized"}} {{elseif $_GET.type_immo == "archived"}} {{:assign current="archived"}} -{{elseif $_GET.type_immo == null || $_GET.type_immo == "managed"}} +{{elseif $_GET.type_immo == null || $_GET.type_immo == "managed" || $valeur_residuelle > 0}} {{:assign current="managed"}} {{else}} {{:assign current="other"}} @@ -150,7 +150,7 @@

Avoirs

From d4743f36311ac1289668a71655d7efe0a412c685 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Tue, 16 Jun 2026 10:31:26 +0200 Subject: [PATCH 10/11] =?UTF-8?q?Harmonisation=20navigation=20et=20s=C3=A9?= =?UTF-8?q?lection=20comptes=20et=20sous-comptes=20cr=C3=A9dit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _archives.html | 2 +- exit_step1.html | 17 +++++++++-------- exit_step2.html | 2 +- exit_step3.html | 19 ++++++++++++++++++- exit_step4.html | 1 + link_immo.html | 12 ++++++++---- 6 files changed, 38 insertions(+), 15 deletions(-) diff --git a/_archives.html b/_archives.html index ce92aff..a4356d6 100644 --- a/_archives.html +++ b/_archives.html @@ -153,7 +153,7 @@ {{$account_code}} {{$account_label}} - {{:linkbutton label="Modifier" href="exit_step4.html?immo_doc_id=%s"|args:$info_immo.id shape="edit"}} + {{:linkbutton label="Modifier" href="exit_step1.html?immo_doc_id=%s"|args:$info_immo.id shape="edit"}} {{/select}} diff --git a/exit_step1.html b/exit_step1.html index 0fc2fb1..0b85eb9 100644 --- a/exit_step1.html +++ b/exit_step1.html @@ -32,6 +32,7 @@ - line.credit < ligne_immo.amount => peut-être un avoir - line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan *}} +{{:assign account_code=$ligne_immo.account_code|cat:"%"}} {{#select trans.id as trans_id, trans.label as trans_label, @@ -40,15 +41,15 @@ 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 + account.id as account_id, + account.code as account_code, + 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 acc ON line.id_account = acc.id + INNER JOIN acc_accounts AS account ON line.id_account = account.id LEFT JOIN module_data_amortization AS mda ON json_extract(mda.document, '$.amort_line_id') = line.id WHERE - acc.code = :acc_code + account.code LIKE :account_code AND line.credit > 0 AND credit_line_id NOT IN ( SELECT json_extract(credit_link.document, '$.credit_line_id') AS line_id FROM !table as credit_link @@ -58,7 +59,7 @@ WHERE json_extract(exit_link.document, '$.type') == "exit_link" ) ; - :acc_code=$ligne_immo.account_code + :account_code=$account_code !table =$module.table assign="credit_line" }} @@ -75,7 +76,6 @@ }} {{* chercher des écritures d'amortissement correspondant au compte d'une immo sans doc associé *}} -{{* TODO écritures d'amort pas entièrement affectées *}} {{#select line.id as amort_line_id, line.credit as amort_amount, @@ -105,7 +105,7 @@ {{:assign keep_amort=true}} {{#load type="amort_link" where="$$.amort_line_id = :amort_line_id" - :amort_line_id=$amort_line.amort_line_id|intval + :amort_line_id=$amort_line.amort_line_id assign="amort_link" }} {{if $amort_link.amount == null || $amort_link.amount == 0}} @@ -123,6 +123,7 @@ {{/select}} {{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}} +{{:include file="_nav.html" current="archived" subcurrent="exit"}} {{if $_GET.ok}} {{if $_GET.msg|match:"attach_avoir"}} diff --git a/exit_step2.html b/exit_step2.html index 8199426..ee740ff 100644 --- a/exit_step2.html +++ b/exit_step2.html @@ -43,7 +43,6 @@ }} {{* chercher des écritures d'amortissement correspondant au compte d'une immo sans doc associé *}} -{{* TODO écritures d'amort pas entièrement affectées *}} {{#select line.id as amort_line_id, line.credit as amort_amount, @@ -91,6 +90,7 @@ {{/select}} {{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}} +{{:include file="_nav.html" current="archived" subcurrent="exit"}} {{if $_GET.ok}} {{if $_GET.msg|match:"attach_amort"}} diff --git a/exit_step3.html b/exit_step3.html index 5d8ff0d..458357c 100644 --- a/exit_step3.html +++ b/exit_step3.html @@ -1,6 +1,5 @@ {{* -*- brindille -*- *}} -{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}} {{* Associer une écriture de cession à une immo créée et sortie du bilan avant la mise en service du module @@ -59,6 +58,21 @@ assign="line" }} {{* voir si l'écriture de cession est déjà liée à une immo *}} + {{* TODO VOIR SI TUTILE + {{#load type="cession_link" + where="$$.cession_line_id = :cession_line_id" + :cession_line_id = $line.line_id + assign="cession_link" + }} +{{:debug line=$line cession_link=$cession_link}} + {{:assign total_cession="%d+%d"|math:$total_cession:$line.amount}} + {{:assign var="line.linked_id" value=$linked_id}} + {{:assign var="linked_cessions." value=$line}} + {{else}} + {{:assign var="free_cessions." value=$line}} + {{/load}} +*}} + {{#select CASE WHEN links.id_related = :trans_id THEN links.id_transaction @@ -80,6 +94,9 @@ {{/select}} {{*:debug linked_cessions=$linked_cessions free_cessions=$free_cessions total_cession=$total_cession*}} +{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}} +{{:include file="_nav.html" current="archived" subcurrent="exit"}} + {{if $_GET.ok}} {{if $_GET.msg|match:"attach_cession"}} {{:assign msg="Écriture de cession attachée"}} diff --git a/exit_step4.html b/exit_step4.html index ccb6d7f..8a2b51e 100644 --- a/exit_step4.html +++ b/exit_step4.html @@ -164,6 +164,7 @@ {{/select}} {{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}} +{{:include file="_nav.html" current="archived" subcurrent="exit"}} {{if $_GET.ok}} {{if $_GET.msg|match:"attach_exit"}} diff --git a/link_immo.html b/link_immo.html index ddee4dd..557b0e8 100644 --- a/link_immo.html +++ b/link_immo.html @@ -18,6 +18,7 @@ {{* lister les écritures au crédit du compte de l'immobilisation *}} +{{:assign account_code=$ligne_immo.account_code|cat:"%"}} {{#select line.id as credit_line_id, line.id_transaction as credit_trans_id, @@ -34,12 +35,15 @@ INNER JOIN acc_transactions AS trans ON trans.id = line.id_transaction 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 + WHERE account.code LIKE :account_code AND credit > 0 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') == "credit_link") + WHERE json_extract(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") ORDER BY trans.date, trans.label; - :account_code = $ligne_immo.account_code + :account_code = $account_code !table =$module.table assign="other_immos." }} @@ -60,7 +64,7 @@
- Écritures au crédit du compte d'immobilisation « {{$ligne_immo.account_code}} » + Écritures au crédit du compte d'immobilisation « {{$ligne_immo.account_code}} » et sous-comptes
From 003af639ea40d085f8f550801a443763b50607d3 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Tue, 16 Jun 2026 10:33:26 +0200 Subject: [PATCH 11/11] =?UTF-8?q?Modifications=20cosm=C3=A9tiques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 ++++----- _common_detach.html | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e771e69..578af08 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,14 @@ Ce module permet de gérer les écritures d'amortissements pour les immobilisati - lister les immobilisations - ajouter une nouvelle immobilisation -- lister les amortissements d'une immobilisation : - - amortissements déjà enregistrés - - amortissements à venir -- associer une écriture d'amortissement à une immobilisation +- lister les amortissements d'une immobilisation - enregistrer un nouvel amortissement +- incorporer d'anciennes immobilisations et leurs amortisements ## Installation - télécharger [l'archive zip](https://link.infini.fr/amortissement) - cliquer « Configuration » puis « Extensions » - en bas de la page, cliquer « Importer un module » - sélectionner l'archive téléchargée ci-dessus -- activer le module qui est maintenant présent dans la liste des extensions inactives +- activer le module + diff --git a/_common_detach.html b/_common_detach.html index b4e80d0..2c730c8 100644 --- a/_common_detach.html +++ b/_common_detach.html @@ -1,10 +1,11 @@ {{* -*- brindille -*- *}} {{* - Supprimer l'association entre deux lignes + Supprimer l'association entre une ligne d'immo et une autre ligne (amort, credit, cession, sortie) @param immo_doc_id : id du doc associé à la ligne d'immobilisation @param line_id : id de la ligne à détacher *}} + {{* données de l'immobilisation *}} {{:include file="_get_immo_data.html" immo_doc_id=$immo_doc_id|intval keep="ligne_immo, message"}} {{if $message != null}}