Compare commits

..

7 commits
v0.23 ... main

Author SHA1 Message Date
Jean-Christophe Engel
b8ff213645 Complément filtrage des libellés 2025-12-02 16:51:20 +01:00
Jean-Christophe Engel
b4096821e7 Mise-à-jour numéro version 2025-12-02 14:47:24 +01:00
Jean-Christophe Engel
c6e344fb80 Sortie du bilan : utilisation comptes PC 2025 2025-12-02 14:44:12 +01:00
Jean-Christophe Engel
a9fdb1a195 Modification présentation totaux (fin tableau) 2025-12-02 14:43:10 +01:00
Jean-Christophe Engel
018ee5583c Ajout colonnes Amortissements et Valeur nette dans tables des immos 2025-11-28 14:04:23 +01:00
Jean-Christophe Engel
79d5afc147 module.ini : ajout numéro version 2025-11-26 12:04:11 +01:00
Jean-Christophe Engel
3e9f215816 Ajout totaux dans les onglets Amortissables, Amorties et En cours 2025-11-26 12:03:52 +01:00
8 changed files with 139 additions and 76 deletions

View file

@ -8,13 +8,21 @@
{{* Immobilisation avec une écriture de sortie de bilan *}}
{{:include file="_get_config.html" keep="module.config"}}
{{:assign condition="("}}
{{:assign accounts_condition="("}}
{{#foreach from=$module.config.prefixes item="code"}}
{{:assign code=$code|cat:"%"|quote_sql}}
{{:assign condition=$condition|cat:"account.code LIKE "|cat:$code|cat:" OR "}}
{{:assign accounts_condition=$accounts_condition|cat:"account.code LIKE "|cat:$code|cat:" OR "}}
{{/foreach}}
{{:assign condition=$condition|cat:"0)"}}
{{:assign condition=$condition|cat:" AND acc2.code = account.code AND line.debit > 0 AND line.debit = line2.credit AND NOT (trans.status & 16)"}}
{{:assign accounts_condition=$accounts_condition|cat:"0)"}}
{{:assign condition=$accounts_condition|cat:" AND acc2.code = account.code AND line.debit > 0 AND line.debit = line2.credit AND NOT (trans.status & 16)"}}
{{:assign filter_condition=" NOT ("}}
{{#foreach from=$module.config.filters item="filter"}}
{{:assign filter="%"|cat:$filter|cat:"%"|quote_sql}}
{{:assign filter_condition=$filter_condition|cat:" trans_label LIKE "|cat:$filter|cat:" OR "}}
{{/foreach}}
{{:assign filter_condition=$filter_condition|cat:"0)"}}
{{:assign condition=$condition|cat:" AND "|cat:$filter_condition}}
{{#select
trans.id as trans_id,
@ -107,32 +115,66 @@
{{/select}}
{{/foreach}}
</tbody>
</tbody>
<tfoot>
{{if $total_immo != 0}}
{{#foreach from=$sommes_immo|ksort key="code" item="value"}}
<tr>
<td></td>
<td></td>
<td></td>
<td>Total du compte {{$code}}</td>
<td class="money">{{$value|money}}</td>
<td></td>
<td></td>
<td></td>
<td class="actions"></td>
</tr>
{{/foreach}}
<tr>
<td></td>
<td></td>
<td></td>
<td>Total des immobilisations</td>
<td class="money"><span class="strong">{{$total_immo|money}}</span></td>
<td></td>
<td></td>
<td></td>
<td class="actions"></td>
</tr>
{{/if}}
{{if $total_cessions != 0}}
<tr>
<td colspan="9">
</tr>
{{#foreach from=$montant_cessions|ksort key="code" item="value"}}
<tr>
<td></td>
<td></td>
<td></td>
<td>Cessions du compte {{$code}}</td>
<td class="money">{{$value|money}}</td>
<td></td>
<td></td>
<td></td>
<td class="actions"></td>
</tr>
{{/foreach}}
<tr>
<td></td>
<td></td>
<td></td>
<td>Total des cessions</td>
<td class="money"><span class="strong">{{$total_cessions|money}}</span></td>
<td></td>
<td></td>
<td></td>
<td class="actions"></td>
</tr>
{{/if}}
</tfoot>
</table>
{{if $nb_immo == 0}}
<p class="block alert">Aucune immobilisation</p>
{{else}}
<aside class="describe totals">
<h3 class="ruler">Totaux</h3>
{{if $total_immo != 0}}
<dl class="describe">
{{#foreach from=$sommes_immo|ksort key="code" item="value"}}
<dt>Total du compte {{$code}}</dt>
<dd>{{$value|money}}
{{/foreach}}
<dt>Montant total des immobilisations</dt>
<dd><span class="strong">{{$total_immo|money}}</span></dd>
</dl>
{{/if}}
{{if $total_cessions != 0}}
<dl class="describe">
{{#foreach from=$montant_cessions|ksort key="code" item="value"}}
<dt>Cessions du compte {{$code}}</dt>
<dd>{{$value|money}}
{{/foreach}}
<dt>Montant total des cessions</dt>
<dd><span class="strong">{{$total_cessions|money}}</span></dd>
</dl>
{{/if}}
</aside>
{{/if}}
</section>

View file

@ -15,13 +15,14 @@
<table class="list">
<thead>
<tr>
<th></th>
<th class="num"></th>
<th>Date</th>
<th>Libellé</th>
<th class="nombre">Montant</th>
<th class="nombre">Durée</th>
<th class="nombre">Amortissements</th>
<th class="nombre">Valeur nette</th>
<th>N° compte</th>
<th>Compte</th>
<th class="actions"></th>
</tr>
</thead>
@ -158,8 +159,9 @@
<td>{{$trans_label}}</td>
<td class="money">{{$debit|money}}</td>
<td class="money">{{if $duration != null}}{{$duration}}{{/if}}</td>
<td class="money">{{$amort_amount|money|or:"0,00"}}</td>
<td class="money">{{"%d-%d"|math:$debit:$amort_amount|money|or:"0,00"}}</td>
<td><a href={{$compte_url}}>{{$account_code}}</a></td>
<td>{{$account_label}}</td>
<td class="actions">
{{if ! $exist_amort}}
{{:linkbutton
@ -185,22 +187,36 @@
</tr>
{{/select}}
</tbody>
<tfoot>
{{if $total_immo != 0}}
{{#foreach from=$sommes_immo|ksort key="code" item="value"}}
<tr>
<td></td>
<td></td>
<td>Total du compte {{$code}}</td>
<td class="money">{{$value|money}}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="actions"></td>
</tr>
{{/foreach}}
<tr>
<td></td>
<td></td>
<td>Total des immobilisations</td>
<td class="money"><span class="strong">{{$total_immo|money}}</span></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="actions"></td>
</tr>
{{/if}}
</tfoot>
</table>
{{if $nb_immo == 0}}
<p class="block alert">Aucune immobilisation</p>
{{else}}
<aside class="describe totals">
<h3 class="ruler">Totaux</h3>
{{if $total_immo != 0}}
<dl class="describe">
{{#foreach from=$sommes_immo|ksort key="code" item="value"}}
<dt>Total du compte {{$code}}</dt>
<dd>{{$value|money}}
{{/foreach}}
<dt>Montant total des immobilisations</dt>
<dd><span class="strong">{{$total_immo|money}}</span></dd>
</dl>
{{/if}}
</aside>
{{/if}}
</section>

View file

@ -37,7 +37,6 @@
{{if $current == "config"}}
<ul class="sub">
<li {{if $subcurrent == null}} class="current"{{/if}}><a href="config.html">Comptes d'immobilisation</a></li>
<li {{if $subcurrent == "create_accounts"}} class="current"{{/if}}><a href="create_accounts.html">Comptes de sortie du bilan</a></li>
<li {{if $subcurrent == "filters"}} class="current"{{/if}}><a href="filters.html">Filtres de libellés</a></li>
</ul>
{{/if}}

View file

@ -43,7 +43,7 @@
<th class="num"></th>
<th>Date</th>
<th>Libellé</th>
<th class="money">Montant</th>
<th class="nombre">Montant</th>
<th>N° compte</th>
<th>Compte</th>
<th class="actions"></th>
@ -72,6 +72,7 @@
{{*:debug condition=$condition*}}
{{:assign nb_immo=0}}
{{:assign total_immo = 0}}
{{#select
trans.id as trans_id,
trans.label as trans_label,
@ -122,6 +123,9 @@
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$account_id:$trans_id_year}}
{{:assign nb_immo="%d+1"|math:$nb_immo}}
{{:assign total_immo="%d+%d"|math:$total_immo:$debit}}
{{:assign var="montant" from="sommes_immo.%s"|args:$account_code}}
{{:assign var="sommes_immo.%s"|args:$account_code value="%d+%d"|math:$montant:$debit}}
<tr>
<td class="check">{{:input type="checkbox" name="selected[]" value=$trans_id}}</td>
@ -142,6 +146,32 @@
</tr>
{{/select}}
</tbody>
<tfoot>
{{if $total_immo != 0}}
{{#foreach from=$sommes_immo|ksort key="code" item="value"}}
<tr>
<td></td>
<td></td>
<td></td>
<td>Total du compte {{$code}}</td>
<td class="money">{{$value|money}}</td>
<td></td>
<td></td>
<td class="actions"></td>
</tr>
{{/foreach}}
<tr>
<td></td>
<td></td>
<td></td>
<td>Total des immobilisations</td>
<td class="money"><span class="strong">{{$total_immo|money}}</span></td>
<td></td>
<td></td>
<td class="actions"></td>
</tr>
{{/if}}
</tfoot>
</table>
{{if $nb_immo == 0}}
<p class="block alert">Aucune immobilisation</p>

View file

@ -192,9 +192,9 @@
<dd>{{$duree}} ans</dd>
{{/if}}
{{if $valeur_residuelle > 0}}
<dt>Montant déjà amorti</dt>
<dt>Montant des amortissements</dt>
<dd>{{"%d-%d"|math:$ligne_immo.montant:$valeur_residuelle|money_currency:false}}</dd>
<dt>Valeur résiduelle</dt>
<dt>Valeur nette comptable</dt>
<dd>{{$valeur_residuelle|money_currency}}</dd>
{{/if}}
{{if $duree != null && $valeur_residuelle > 0}}

View file

@ -1,5 +1,5 @@
name="Amortissements"
description="Immobilisations et amortissements\nversion 0.23"
description="Immobilisations et amortissements\nversion 0.24"
author="Jean-Christophe Engel"
author_url="https://gitea.zaclys.com/lesanges"
home_button=false

View file

@ -55,27 +55,3 @@ fieldset.shortFormLeft div.informations {
span.strong {
font-weight: bold;
}
aside.totals {
float : left;
width : 30em;
}
aside.totals dl.describe {
display: flex;
}
aside.totals dl.describe dt {
text-align : right;
flex : 0 0 20rem;
}
aside.totals dl.describe dt::after {
content: ' : ';
}
aside.totals dl.describe dd {
flex : 0 0 calc(100% - 25rem);
text-align : right;
}

View file

@ -270,8 +270,8 @@
Utilisation des « anciens » numéros de comptes because conflit
avec les nouveaux numéros ; voir info.org
*}}
{{:assign vnc_code="675"}}
{{:assign cession_code="775"}}
{{:assign vnc_code="652"}}
{{:assign cession_code="757"}}
{{:assign var="liste_codes.6811" name="comp_account"}}
{{:assign var="liste_codes.687" name="except_account"}}