Compare commits

...

3 commits
v0.25 ... main

Author SHA1 Message Date
Jean-Christophe Engel
846a651008 Amélioration présentation montants 2025-12-19 11:35:25 +01:00
Jean-Christophe Engel
aec5a83eef Améliorations cosmétiques 2025-12-17 10:53:26 +01:00
Jean-Christophe Engel
5c2798c734 Ajout possibilité créer immobilisation en cours de constitution 2025-12-17 10:52:47 +01:00
14 changed files with 126 additions and 101 deletions

View file

@ -82,7 +82,7 @@
<td>{{$trans_date|date_short}}</td> <td>{{$trans_date|date_short}}</td>
<td>{{$exit_date|date_short}}</td> <td>{{$exit_date|date_short}}</td>
<td>{{$trans_label}}</td> <td>{{$trans_label}}</td>
<td class="money">{{"%f"|math:$debit|money:false}}</td> <td class="money">{{"%f"|math:$debit|money_html:false|raw}}</td>
<td><a href={{$compte_url}}>{{$account_code}}</a></td> <td><a href={{$compte_url}}>{{$account_code}}</a></td>
<td>{{$account_label}}</td> <td>{{$account_label}}</td>
<td>{{$project_label}}</td> <td>{{$project_label}}</td>
@ -124,7 +124,7 @@
<td></td> <td></td>
<td></td> <td></td>
<td>Total du compte {{$code}}</td> <td>Total du compte {{$code}}</td>
<td class="money">{{$value|money}}</td> <td class="money">{{$value|money_html:false|raw}}</td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
@ -135,8 +135,8 @@
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td>Total des immobilisations</td> <td class="strong">Total des immobilisations</td>
<td class="money"><span class="strong">{{$total_immo|money}}</span></td> <td class="money strong">{{$total_immo|money_html:false|raw}}</td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
@ -153,7 +153,7 @@
<td></td> <td></td>
<td></td> <td></td>
<td>Cessions du compte {{$code}}</td> <td>Cessions du compte {{$code}}</td>
<td class="money">{{$value|money}}</td> <td class="money">{{$value|money_html:false|raw}}</td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
@ -164,8 +164,8 @@
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td>Total des cessions</td> <td class="strong">Total des cessions</td>
<td class="money"><span class="strong">{{$total_cessions|money}}</span></td> <td class="money strong">{{$total_cessions|money_html:false|raw}}</td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>

View file

@ -157,10 +157,10 @@
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td> <td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
<td>{{$trans_date|date_short}}</td> <td>{{$trans_date|date_short}}</td>
<td>{{$trans_label}}</td> <td>{{$trans_label}}</td>
<td class="money">{{$debit|money}}</td> <td class="money">{{$debit|money_html:false|raw}}</td>
<td class="money">{{if $duration != null}}{{$duration}}{{/if}}</td> <td class="money">{{if $duration != null}}{{$duration}}{{/if}}</td>
<td class="money">{{$amort_amount|money|or:"0,00"}}</td> <td class="money">{{$amort_amount|money_html:false|raw}}</td>
<td class="money">{{"%d-%d"|math:$debit:$amort_amount|money|or:"0,00"}}</td> <td class="money">{{"%d-%d"|math:$debit:$amort_amount|money_html:false|raw}}</td>
<td><a href={{$compte_url}}>{{$account_code}}</a></td> <td><a href={{$compte_url}}>{{$account_code}}</a></td>
<td class="actions"> <td class="actions">
{{if ! $exist_amort}} {{if ! $exist_amort}}
@ -194,7 +194,7 @@
<td></td> <td></td>
<td></td> <td></td>
<td>Total du compte {{$code}}</td> <td>Total du compte {{$code}}</td>
<td class="money">{{$value|money}}</td> <td class="money">{{$value|money_html:false|raw}}</td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
@ -205,8 +205,8 @@
<tr> <tr>
<td></td> <td></td>
<td></td> <td></td>
<td>Total des immobilisations</td> <td class="strong">Total des immobilisations</td>
<td class="money"><span class="strong">{{$total_immo|money}}</span></td> <td class="money strong">{{$total_immo|money_html|raw}}</td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>

View file

@ -126,7 +126,7 @@
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td> <td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
<td>{{$trans_date|date_short}}</td> <td>{{$trans_date|date_short}}</td>
<td>{{$trans_label}}</td> <td>{{$trans_label}}</td>
<td class="money">{{"%f"|math:$debit|money:false}}</td> <td class="money">{{"%f"|math:$debit|money_html:false|raw}}</td>
<td><a href={{$compte_url}}>{{$account_code}}</a></td> <td><a href={{$compte_url}}>{{$account_code}}</a></td>
<td>{{$account_label}}</td> <td>{{$account_label}}</td>
<td class="actions"> <td class="actions">

View file

@ -26,11 +26,11 @@
{{if $subsubcurrent == "amortization"}} {{if $subsubcurrent == "amortization"}}
<ul class="sub"> <ul class="sub">
<li class="title"><strong>Amortissements</strong></li> <li class="title strong">Amortissements</li>
</ul> </ul>
{{elseif $subsubcurrent == "balance_exit"}} {{elseif $subsubcurrent == "balance_exit"}}
<ul class="sub"> <ul class="sub">
<li class="title"><strong>Sortie de bilan</strong></li> <li class="title strong">Sortie de bilan</li>
</ul> </ul>
{{/if}} {{/if}}

View file

@ -42,7 +42,7 @@
<table class="list"> <table class="list">
<thead> <thead>
<tr> <tr>
<th class="check">{{*:input type="checkbox" name="all" value="all"*}}</th> <th class="check"></th>
<th class="num"></th> <th class="num"></th>
<th>Date</th> <th>Date</th>
<th>Libellé</th> <th>Libellé</th>
@ -72,7 +72,6 @@
{{/foreach}} {{/foreach}}
{{:assign filter_condition=$filter_condition|cat:"0)"}} {{:assign filter_condition=$filter_condition|cat:"0)"}}
{{:assign condition=$condition|cat:" AND "|cat:$filter_condition}} {{:assign condition=$condition|cat:" AND "|cat:$filter_condition}}
{{*:debug condition=$condition*}}
{{:assign nb_immo=0}} {{:assign nb_immo=0}}
{{:assign total_immo = 0}} {{:assign total_immo = 0}}
@ -135,7 +134,7 @@
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td> <td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
<td>{{$trans_date|date_short}}</td> <td>{{$trans_date|date_short}}</td>
<td>{{$trans_label}}</td> <td>{{$trans_label}}</td>
<td class="money">{{"%f"|math:$debit|money:false}}</td> <td class="money">{{"%f"|math:$debit|money_html:false|raw}}</td>
<td class="account_code"><a href={{$compte_url}}>{{$account_code}}</a></td> <td class="account_code"><a href={{$compte_url}}>{{$account_code}}</a></td>
<td>{{$account_label}}</td> <td>{{$account_label}}</td>
<td class="actions"> <td class="actions">
@ -157,7 +156,7 @@
<td></td> <td></td>
<td></td> <td></td>
<td>Total du compte {{$code}}</td> <td>Total du compte {{$code}}</td>
<td class="money">{{$value|money}}</td> <td class="money">{{$value|money_html|raw}}</td>
<td></td> <td></td>
<td></td> <td></td>
<td class="actions"></td> <td class="actions"></td>
@ -167,8 +166,8 @@
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td>Total des immobilisations</td> <td class="strong">Total des immobilisations</td>
<td class="money"><span class="strong">{{$total_immo|money}}</span></td> <td class="money strong">{{$total_immo|money_html|raw}}</td>
<td></td> <td></td>
<td></td> <td></td>
<td class="actions"></td> <td class="actions"></td>

View file

@ -1,6 +1,6 @@
{{* -*- brindille -*- *}} {{* -*- brindille -*- *}}
{{:include file="_get_config.html" keep="module.config.prefixes"}} {{:include file="_get_config.html" keep="module.config"}}
{{#years closed=false order="start_date" assign=years.}} {{#years closed=false order="start_date" assign=years.}}
{{:assign ts_debut=$start_date|strtotime}} {{:assign ts_debut=$start_date|strtotime}}
@ -34,23 +34,6 @@
{{:error message="La date saisie n'est pas dans l'exercice choisi !"}} {{:error message="La date saisie n'est pas dans l'exercice choisi !"}}
{{/if}} {{/if}}
{{if ! $_POST.amortir}}
{{* ne pas amortir *}}
{{:assign duration=0}}
{{:assign date_debut=$_POST.date_achat|parse_date}}
{{:assign status="ignored"}}
{{else}}
{{* vérifier que la date d'acquisition est antérieure à la date de mise en service *}}
{{:assign date_debut=$_POST.date_mes|or:$_POST.date_achat|parse_date}}
{{if $date_debut|strtotime < $_POST.date_achat|parse_date|strtotime}}
{{:assign dd=$date_debut|date_short}}
{{:assign da=$_POST.date_achat|date_short}}
{{:error message="Erreur : la date de mise en service (%s) ne peut être antérieure à la date d'acquisition (%s)"|args:$dd:$da}}
{{/if}}
{{:assign duration=$_POST.duree|intval}}
{{:assign status="managed"}}
{{/if}}
{{* déterminer le numéro des comptes au cas où la clé serait un identifiant *}} {{* déterminer le numéro des comptes au cas où la clé serait un identifiant *}}
{{:include {{:include
file="_get_codes.html" file="_get_codes.html"
@ -70,17 +53,51 @@
- est présent dans le PC de l'exercice correspondant à la date - est présent dans le PC de l'exercice correspondant à la date
*}} *}}
{{#foreach from=$module.config.prefixes item="code"}}
{{:assign var="prefix_array." value=$code}}
{{/foreach}}
{{#foreach from=$module.config.unfinished item="code"}}
{{:assign var="prefix_array." value=$code}}
{{/foreach}}
{{:include {{:include
file="_check_account.html" file="_check_account.html"
account=$debit_account account=$debit_account
chart_id=$selected_chart chart_id=$selected_chart
prefix_array=$module.config.prefixes prefix_array=$prefix_array
keep="account_ok" keep="account_ok"
}} }}
{{if $account_ok == null}} {{if $account_ok == null}}
{{:assign compte=$debit_account|implode:""}} {{:assign compte=$debit_account|implode:""}}
{{:error message="Le compte « %s » n'est pas un compte d'immobilisation ou n'est pas dans le plan comptable de l'exercice choisi"|args:$compte}} {{:redirect url="add_account.html?account=%s&chart=%s&immo_id=%s"|args:$compte:$selected_chart:$_GET.immo_id}}
{{/if}}
{{:assign debit_account=$debit_account|keys|value:0}}
{{:assign credit_account=$credit_account|keys|value:0}}
{{* déterminer si le compte d'immo est un compte d'immo en cours *}}
{{#foreach from=$module.config.unfinished item="code"}}
{{if $debit_account|strpos:$code === 0}}
{{:assign status="unfinished"}}
{{/if}}
{{/foreach}}
{{if $status != "unfinished" && ! $_POST.amortir}}
{{* ne pas amortir *}}
{{:assign duration=0}}
{{:assign date_debut=$_POST.date_achat|parse_date}}
{{:assign status="ignored"}}
{{elseif $status != "unfinished"}}
{{* vérifier que la date d'acquisition est antérieure à la date de mise en service *}}
{{:assign date_debut=$_POST.date_mes|or:$_POST.date_achat|parse_date}}
{{if $date_debut|strtotime < $_POST.date_achat|parse_date|strtotime}}
{{:assign dd=$date_debut|date_short}}
{{:assign da=$_POST.date_achat|date_short}}
{{:error message="Erreur : la date de mise en service (%s) ne peut être antérieure à la date d'acquisition (%s)"|args:$dd:$da}}
{{/if}}
{{:assign duration=$_POST.duree|intval}}
{{:assign status="managed"}}
{{/if}} {{/if}}
{{* enregistrer l'écriture *}} {{* enregistrer l'écriture *}}
@ -93,11 +110,12 @@
date=$_POST.date_achat date=$_POST.date_achat
label=$_POST.designation label=$_POST.designation
amount=$_POST.montant amount=$_POST.montant
debit=$debit_account|keys|value:0 debit=$debit_account
credit=$credit_account|keys|value:0 credit=$credit_account
id_project=$_POST.id_project id_project=$_POST.id_project
}} }}
{{if $status != "unfinished"}}
{{* vérifier s'il y a déjà un document avec le même numéro de ligne *}} {{* vérifier s'il y a déjà un document avec le même numéro de ligne *}}
{{:assign var="immo_id" value=$result.lines.1.id}} {{:assign var="immo_id" value=$result.lines.1.id}}
{{#load where="$$.line = :line_id" :line_id=$immo_id}} {{#load where="$$.line = :line_id" :line_id=$immo_id}}
@ -116,12 +134,17 @@
date=$date_debut date=$date_debut
status=$status status=$status
}} }}
{{if $_POST.amortir}} {{/if}}
{{if $status == "unfinished"}}
{{:assign type_immo="unfinished"}}
{{elseif $_POST.amortir}}
{{:assign type_immo="managed"}} {{:assign type_immo="managed"}}
{{else}} {{else}}
{{:assign type_immo="other"}} {{:assign type_immo="other"}}
{{/if}} {{/if}}
{{:redirect force="index.html?ok=1&msg=immobilisation&type_immo=%s"|args:$type_immo}} {{:redirect force="index.html?ok=1&msg=immobilisation&type_immo=%s"|args:$type_immo}}
{{/form}} {{/form}}
{{:admin_header title="Ajout immobilisation" current="module_amortissement"}} {{:admin_header title="Ajout immobilisation" current="module_amortissement"}}
@ -141,6 +164,9 @@
{{#foreach from=$module.config.prefixes item="code"}} {{#foreach from=$module.config.prefixes item="code"}}
{{:assign var="pattern_array." value="%s*"|args:$code}} {{:assign var="pattern_array." value="%s*"|args:$code}}
{{/foreach}} {{/foreach}}
{{#foreach from=$module.config.unfinished item="code"}}
{{:assign var="pattern_array." value="%s*"|args:$code}}
{{/foreach}}
{{:assign var="patterns" value=$pattern_array|implode:"|"}} {{:assign var="patterns" value=$pattern_array|implode:"|"}}
<div id="erreur" class="hidden"> <div id="erreur" class="hidden">

View file

@ -184,7 +184,7 @@
<dt>Immobilisation</dt> <dt>Immobilisation</dt>
<dd><span class="num"><a href={{$trans_url}}>#{{$ligne_immo.trans_id}}</a></span> {{$ligne_immo.label}}</dd> <dd><span class="num"><a href={{$trans_url}}>#{{$ligne_immo.trans_id}}</a></span> {{$ligne_immo.label}}</dd>
<dt>Montant</dt> <dt>Montant</dt>
<dd><strong class="money">{{"%f"|math:$ligne_immo.montant|money_currency}}</strong></dd> <dd class="money strong">{{"%f"|math:$ligne_immo.montant|money_currency_html:false|raw}}</dd>
<dt>Début d'amortissement</dt> <dt>Début d'amortissement</dt>
<dd>{{$date_debut|date_short}}</dd> <dd>{{$date_debut|date_short}}</dd>
{{if $duree != null}} {{if $duree != null}}
@ -193,13 +193,13 @@
{{/if}} {{/if}}
{{if $valeur_residuelle > 0}} {{if $valeur_residuelle > 0}}
<dt>Montant des amortissements</dt> <dt>Montant des amortissements</dt>
<dd>{{"%d-%d"|math:$ligne_immo.montant:$valeur_residuelle|money_currency:false}}</dd> <dd>{{"%d-%d"|math:$ligne_immo.montant:$valeur_residuelle|money_currency_html:false|raw}}</dd>
<dt>Valeur nette comptable</dt> <dt>Valeur nette comptable</dt>
<dd>{{$valeur_residuelle|money_currency}}</dd> <dd>{{$valeur_residuelle|money_currency_html:false|raw}}</dd>
{{/if}} {{/if}}
{{if $duree != null && $valeur_residuelle > 0}} {{if $duree != null && $valeur_residuelle > 0}}
<dt>Annuité estimée</dt> <dt>Annuité estimée</dt>
<dd>{{"%f/%d"|math:$ligne_immo.montant:$duree|money_currency}}</dd> <dd>{{"%f/%d"|math:$ligne_immo.montant:$duree|money_currency_html:false|raw}}</dd>
{{/if}} {{/if}}
</dl> </dl>
</div> </div>
@ -229,8 +229,8 @@
<tr> <tr>
<td class="num"><a href={{$trans_url}}>#{{$line.amort_trans_id}}</a></td> <td class="num"><a href={{$trans_url}}>#{{$line.amort_trans_id}}</a></td>
<td>{{$line.amort_date|date_short}}</td> <td>{{$line.amort_date|date_short}}</td>
<td class="money">{{"%f"|math:$line.amort_amount|money}}</td> <td class="money">{{"%f"|math:$line.amort_amount|money_html:false|raw}}</td>
<td class="money">{{"%f"|math:$solde|money:false}}</td> <td class="money">{{"%f"|math:$solde|money_html:false|raw}}</td>
<td> <td>
{{if $line.amort_label == null}} {{if $line.amort_label == null}}
{{$line.trans_label}} {{$line.trans_label}}

View file

@ -185,7 +185,7 @@
<legend>Données de l'imobilisation</legend> <legend>Données de l'imobilisation</legend>
<dl class="describe"> <dl class="describe">
<dt>Montant</dt> <dt>Montant</dt>
<dd id="montant_immo" class="money">{{$ligne_immo.montant|money_currency:false}}</dd> <dd id="montant_immo" class="money">{{$ligne_immo.montant|money_currency_html:false|raw}}</dd>
<dt>Date d'acquisition</dt> <dt>Date d'acquisition</dt>
<dd >{{$ligne_immo.date_achat|date_short}}</dd> <dd >{{$ligne_immo.date_achat|date_short}}</dd>
{{if $info_immo.date != null && $info_immo.date != $ligne_immo.date_achat}} {{if $info_immo.date != null && $info_immo.date != $ligne_immo.date_achat}}
@ -197,9 +197,9 @@
<dd id="duree_amort" class="num">{{$info_immo.duration}} ans</dd> <dd id="duree_amort" class="num">{{$info_immo.duration}} ans</dd>
{{/if}} {{/if}}
<dt>Montant des amortissements</dt> <dt>Montant des amortissements</dt>
<dd id="montant_amort" class="money">{{$amort_amount|money_currency:false}} <span class="help">(à la date de début de l'exercice)</span></dd> <dd id="montant_amort" class="money">{{$amort_amount|money_currency_html:false|raw}} <span class="help">(à la date de début de l'exercice)</span></dd>
<dt>Valeur nette résiduelle</dt> <dt>Valeur nette résiduelle</dt>
<dd class="money">{{$valeur_nette|money_currency:false}} <span class="help">(à la date de début de l'exercice)</span></dd> <dd class="money">{{$valeur_nette|money_currency_html:false|raw}} <span class="help">(à la date de début de l'exercice)</span></dd>
</dl> </dl>
</div> </div>
{{if $valeur_nette > 0}} {{if $valeur_nette > 0}}

View file

@ -62,7 +62,7 @@
<legend>Données de l'imobilisation</legend> <legend>Données de l'imobilisation</legend>
<dl class="describe"> <dl class="describe">
<dt>Montant</dt> <dt>Montant</dt>
<dd id="montant_immo" class="money">{{$ligne_immo.montant|money_currency:false}}</dd> <dd id="montant_immo" class="money">{{$ligne_immo.montant|money_currency_html:false|raw}}</dd>
<dt>Date d'acquisition</dt> <dt>Date d'acquisition</dt>
<dd >{{$ligne_immo.date_achat|date_short}}</dd> <dd >{{$ligne_immo.date_achat|date_short}}</dd>
{{if $_GET.date_mes != $ligne_immo.date_achat|strtotime}} {{if $_GET.date_mes != $ligne_immo.date_achat|strtotime}}
@ -74,18 +74,18 @@
<dd id="duree_amort" class="num">{{$_GET.duree_amort}} ans</dd> <dd id="duree_amort" class="num">{{$_GET.duree_amort}} ans</dd>
{{/if}} {{/if}}
<dt>Montant des amortissements</dt> <dt>Montant des amortissements</dt>
<dd id="montant_amort" class="money">{{$_GET.amort_amount|money_currency:false}} <span class="help">(à la date de début de l'exercice)</span></dd> <dd id="montant_amort" class="money">{{$_GET.amort_amount|money_currency_html:false|raw}} <span class="help">(à la date de début de l'exercice)</span></dd>
<dt>Valeur nette résiduelle</dt> <dt>Valeur nette résiduelle</dt>
<dd class="money">{{$valeur_nette|money_currency:false}} <span class="help">(à la date de début de l'exercice)</span></dd> <dd class="money">{{$valeur_nette|money_currency_html:false|raw}} <span class="help">(à la date de début de l'exercice)</span></dd>
<dt>Date de sortie</dt> <dt>Date de sortie</dt>
<dd>{{$_GET.exit_date|date:"d/m/Y"}}</dd> <dd>{{$_GET.exit_date|date:"d/m/Y"}}</dd>
{{if $amort_comp > 0}} {{if $amort_comp > 0}}
<dt>Amortissement complémentaire</dt> <dt>Amortissement complémentaire</dt>
<dd class="money">{{$amort_comp|money_currency:false}} <span class="help">(jusqu'à la date de sortie)</span></dd> <dd class="money">{{$amort_comp|money_currency_html:false|raw}} <span class="help">(jusqu'à la date de sortie)</span></dd>
<dt>Total des amortissements</dt> <dt>Total des amortissements</dt>
<dd class="money">{{"%f+%f"|math:$_GET.amort_amount:$amort_comp|money_currency:false}} <span class="help">(à la date de sortie)</span></dd> <dd class="money">{{"%f+%f"|math:$_GET.amort_amount:$amort_comp|money_currency_html:false|raw}} <span class="help">(à la date de sortie)</span></dd>
<dt>Valeur nette résiduelle</dt> <dt>Valeur nette résiduelle</dt>
<dd class="money">{{"%f-%f"|math:$valeur_nette:$amort_comp|money_currency:false}} <span class="help">(à la date de sortie)</span></dd> <dd class="money">{{"%f-%f"|math:$valeur_nette:$amort_comp|money_currency_html:false|raw}} <span class="help">(à la date de sortie)</span></dd>
{{/if}} {{/if}}
</dl> </dl>
</div> </div>

View file

@ -64,7 +64,7 @@
<dt>Écriture</dt> <dt>Écriture</dt>
<dd><span class="num"><a href={{$trans_url}}>#{{$ligne_immo.trans_id}}</a></span> {{$ligne_immo.label}}</dd> <dd><span class="num"><a href={{$trans_url}}>#{{$ligne_immo.trans_id}}</a></span> {{$ligne_immo.label}}</dd>
<dt>Montant</dt> <dt>Montant</dt>
<dd><strong class="money">{{"%f"|math:$ligne_immo.amount|money_currency}}</strong></dd> <dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
</dl> </dl>
</div> </div>
<dl> <dl>

View file

@ -99,7 +99,7 @@
<tr> <tr>
<td class="num"><a href={{$trans_url}}>#{{$line.t_id}}</a></td> <td class="num"><a href={{$trans_url}}>#{{$line.t_id}}</a></td>
<td>{{$line.t_date|date_short}}</td> <td>{{$line.t_date|date_short}}</td>
<td class="money">{{"%f"|math:$line.amort_amount|money}}</td> <td class="money">{{"%f"|math:$line.amort_amount|money_html:false|raw}}</td>
<td>{{if $line.l_label == null}} <td>{{if $line.l_label == null}}
{{$line.t_label}} {{$line.t_label}}
{{else}} {{else}}

View file

@ -80,7 +80,7 @@ function setDateEnd(id_exercices, id_date, id_years) {
// renvoyer la valeur numérique d'un montant formaté en € // renvoyer la valeur numérique d'un montant formaté en €
function getNumber(text) { function getNumber(text) {
return Number(text.replace(/ /g, '').replace(/,/, '.').replace(/€/, '')); return Number(text.replace(/[ \xa0]/g, '').replace(/,/, '.').replace(/€/, ''));
} }
// calculer le montant d'un amortissement // calculer le montant d'un amortissement
@ -196,11 +196,9 @@ function addAmountLine(amount, label, parent) {
col_compte.classList.add("label"); col_compte.classList.add("label");
const col_montant = document.createElement("td"); const col_montant = document.createElement("td");
col_montant.classList.add("money"); col_montant.classList.add("money");
const span = document.createElement("strong");
const montant = document.createTextNode(new Intl.NumberFormat("fr-FR", { style: "currency", currency: "EUR" }).format(amount / 100., )); const montant = document.createTextNode(new Intl.NumberFormat("fr-FR", { style: "currency", currency: "EUR" }).format(amount / 100., ));
span.appendChild(montant);
col_compte.appendChild(document.createTextNode(label)); col_compte.appendChild(document.createTextNode(label));
col_montant.appendChild(span); col_montant.appendChild(montant);
node.appendChild(col_compte); node.appendChild(col_compte);
node.appendChild(col_montant); node.appendChild(col_montant);
parent.appendChild(node); parent.appendChild(node);

View file

@ -35,10 +35,12 @@ h2[class="aide"], h3[class="aide"] {
} }
.informations dl.describe > dt { .informations dl.describe > dt {
flex: 0 0 15rem;
margin-right: 0; margin-right: 0;
} }
.informations dl.describe > dd { .informations dl.describe > dd {
flex: 0 0 calc(100% - 20rem);
margin-right: 0; margin-right: 0;
} }
@ -52,7 +54,7 @@ fieldset.shortFormLeft div.informations {
border-radius: .5em; border-radius: .5em;
} }
span.strong { .strong {
font-weight: bold; font-weight: bold;
} }

View file

@ -324,7 +324,7 @@
<legend>Données de l'imobilisation</legend> <legend>Données de l'imobilisation</legend>
<dl class="describe"> <dl class="describe">
<dt>Montant</dt> <dt>Montant</dt>
<dd class="money">{{$ligne_immo.montant|money_currency:false}}</dd> <dd class="money">{{$ligne_immo.montant|money_currency_html:false|raw}}</dd>
<dt>Date d'acquisition</dt> <dt>Date d'acquisition</dt>
<dd >{{$ligne_immo.date_achat|date_short}}</dd> <dd >{{$ligne_immo.date_achat|date_short}}</dd>
{{if $_GET.date_mes != $ligne_immo.date_achat|strtotime}} {{if $_GET.date_mes != $ligne_immo.date_achat|strtotime}}
@ -336,28 +336,28 @@
<dd class="num">{{$_GET.duree_amort}} ans</dd> <dd class="num">{{$_GET.duree_amort}} ans</dd>
{{/if}} {{/if}}
<dt>Montant des amortissements</dt> <dt>Montant des amortissements</dt>
<dd class="money">{{$_GET.amort_amount|money_currency:false}} <span class="help">(à la date de début de l'exercice)</span></dd> <dd class="money">{{$_GET.amort_amount|money_currency_html:false|raw}} <span class="help">(à la date de début de l'exercice)</span></dd>
<dt>Valeur nette résiduelle</dt> <dt>Valeur nette résiduelle</dt>
<dd class="money">{{$valeur_nette|money_currency:false}} <span class="help">(à la date de début de l'exercice)</span></dd> <dd class="money">{{$valeur_nette|money_currency_html:false|raw}} <span class="help">(à la date de début de l'exercice)</span></dd>
<dt>Date de sortie</dt> <dt>Date de sortie</dt>
<dd>{{$_GET.exit_date|date:"d/m/Y"}}</dd> <dd>{{$_GET.exit_date|date:"d/m/Y"}}</dd>
{{if $amort_comp > 0}} {{if $amort_comp > 0}}
{{:assign valeur_nette="%f-%f"|math:$valeur_nette:$amort_comp}} {{:assign valeur_nette="%f-%f"|math:$valeur_nette:$amort_comp}}
<dt>Amortissement complémentaire</dt> <dt>Amortissement complémentaire</dt>
<dd class="money">{{$amort_comp|money_currency:false}} <span class="help">(jusqu'à la date de sortie)</span></dd> <dd class="money">{{$amort_comp|money_currency_html:false|raw}} <span class="help">(jusqu'à la date de sortie)</span></dd>
<dt>Total des amortissements</dt> <dt>Total des amortissements</dt>
<dd class="money">{{"%f+%f"|math:$_GET.amort_amount:$amort_comp|money_currency:false}} <span class="help">(à la date de sortie)</span></dd> <dd class="money">{{"%f+%f"|math:$_GET.amort_amount:$amort_comp|money_currency_html:false|raw}} <span class="help">(à la date de sortie)</span></dd>
<dt>Valeur nette résiduelle</dt> <dt>Valeur nette résiduelle</dt>
<dd class="money">{{$valeur_nette|money_currency:false}} <span class="help">(à la date de sortie)</span></dd> <dd class="money">{{$valeur_nette|money_currency_html:false|raw}} <span class="help">(à la date de sortie)</span></dd>
{{/if}} {{/if}}
{{if $montant_cession == 0}} {{if $montant_cession == 0}}
{{if $amort_except > 0}} {{if $amort_except > 0}}
<dt>Amortissement exceptionnel</dt> <dt>Amortissement exceptionnel</dt>
<dd class="money">{{$amort_except|money_currency:false}}</dd> <dd class="money">{{$amort_except|money_currency_html:false|raw}}</dd>
{{/if}} {{/if}}
{{else}} {{else}}
<dt>Montant de la cession</dt> <dt>Montant de la cession</dt>
<dd class="money">{{$montant_cession|money_currency:false}}</dd> <dd class="money">{{$montant_cession|money_currency_html:false|raw}}</dd>
{{/if}} {{/if}}
</dl> </dl>
</div> </div>
@ -389,7 +389,7 @@
default=$comp_account default=$comp_account
}} }}
</td> </td>
<td>{{$amort_comp|money_currency:false}}</td> <td>{{$amort_comp|money_currency_html:false|raw}}</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
@ -402,7 +402,7 @@
}} }}
</td> </td>
<td></td> <td></td>
<td>{{$amort_comp|money_currency:false}}</td> <td>{{$amort_comp|money_currency_html:false|raw}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -433,7 +433,7 @@
default=$except_account default=$except_account
}} }}
</td> </td>
<td>{{$amort_except|money_currency:false}}</td> <td>{{$amort_except|money_currency_html:false|raw}}</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
@ -446,7 +446,7 @@
}} }}
</td> </td>
<td></td> <td></td>
<td>{{$amort_except|money_currency:false}}</td> <td>{{$amort_except|money_currency_html:false|raw}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -476,7 +476,7 @@
{{else}} {{else}}
{{:assign montant="%f+%f"|math:$_GET.amort_amount:$amort_comp}} {{:assign montant="%f+%f"|math:$_GET.amort_amount:$amort_comp}}
{{/if}} {{/if}}
<td>{{$montant|money_currency:false}}</td> <td>{{$montant|money_currency_html:false|raw}}</td>
<td></td> <td></td>
</tr> </tr>
{{if $montant_cession > 0 && $valeur_nette > 0}} {{if $montant_cession > 0 && $valeur_nette > 0}}
@ -489,7 +489,7 @@
default=$vnc_account default=$vnc_account
}} }}
</td> </td>
<td>{{$valeur_nette|money_currency:false}}</td> <td>{{$valeur_nette|money_currency_html:false|raw}}</td>
<td></td> <td></td>
</tr> </tr>
{{/if}} {{/if}}
@ -503,7 +503,7 @@
}} }}
</td> </td>
<td></td> <td></td>
<td>{{$ligne_immo.montant|money_currency:false}}</td> <td>{{$ligne_immo.montant|money_currency_html:false|raw}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -528,7 +528,7 @@
default=$creance_account default=$creance_account
}} }}
</td> </td>
<td>{{$montant_cession|money_currency:false}}</td> <td>{{$montant_cession|money_currency_html:false|raw}}</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
@ -541,7 +541,7 @@
}} }}
</td> </td>
<td></td> <td></td>
<td>{{$montant_cession|money_currency:false}}</td> <td>{{$montant_cession|money_currency_html:false|raw}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>