Améliorations cosmétiques
This commit is contained in:
parent
3fc96927a5
commit
0c4f39b21a
@ -5,6 +5,7 @@
|
||||
<section class="immobilisation">
|
||||
<h2 class="ruler">Immobilisations archivées</h2>
|
||||
|
||||
{{:assign nb_immo=0}}
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -26,7 +27,7 @@
|
||||
{{:assign lines=$lines|implode:","}}
|
||||
{{:assign lines="("|cat:$lines|cat:")"}}
|
||||
{{:assign condition="line.id IN %s"|args:$lines}}
|
||||
{{*:debug condition=$condition*}}
|
||||
|
||||
{{#select
|
||||
trans.id as trans_id,
|
||||
trans.label as trans_label,
|
||||
@ -49,6 +50,7 @@
|
||||
}}
|
||||
{{: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}}
|
||||
<tr>
|
||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||
<td>{{$trans_date|date_short}}</td>
|
||||
@ -63,4 +65,7 @@
|
||||
{{/select}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{if $nb_immo == 0}}
|
||||
<p class="block alert">Aucune immobilisation</p>
|
||||
{{/if}}
|
||||
</section>
|
||||
|
@ -8,6 +8,7 @@
|
||||
{{elseif $amort == "fini"}}
|
||||
<h2 class="ruler">Immobilisations amorties</h2>
|
||||
{{/if}}
|
||||
{{:assign nb_immo=0}}
|
||||
|
||||
<table class="list">
|
||||
<thead>
|
||||
@ -138,6 +139,7 @@
|
||||
}}
|
||||
{{:continue}}
|
||||
{{/if}}
|
||||
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
||||
<tr>
|
||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||
<td>{{$trans_date|date_short}}</td>
|
||||
@ -179,4 +181,7 @@
|
||||
{{/select}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{if $nb_immo == 0}}
|
||||
<p class="block alert">Aucune immobilisation</p>
|
||||
{{/if}}
|
||||
</section>
|
||||
|
@ -20,12 +20,13 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{{#load type="immo" where="$$.noamort = true"}}
|
||||
{{#load type="immo" where="$$.status = 'ignored'"}}
|
||||
{{:assign var="lines." value="'%s'"|args:$line}}
|
||||
{{/load}}
|
||||
{{:assign lines=$lines|implode:","}}
|
||||
{{:assign lines="("|cat:$lines|cat:")"}}
|
||||
{{:assign condition="line.id IN %s"|args:$lines}}
|
||||
{{:debug condition=$condition}}
|
||||
{{#select
|
||||
trans.id as trans_id,
|
||||
trans.label as trans_label,
|
||||
|
@ -1,9 +1,8 @@
|
||||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{*
|
||||
créer une écriture d'amortissement
|
||||
paramètres
|
||||
- immo_id : id de la ligne d'immobilisation
|
||||
Créer une écriture d'amortissement
|
||||
@param immo_id : id de la ligne d'immobilisation
|
||||
*}}
|
||||
|
||||
{{* Infos de l'immobilisation *}}
|
||||
@ -49,6 +48,7 @@
|
||||
ELSE links.id_related
|
||||
END as amort_trans_id,
|
||||
MAX(trans.date) as amort_date,
|
||||
COUNT(trans.id) as amort_number,
|
||||
trans.label as trans_label,
|
||||
trans.id_year as amort_year,
|
||||
account.id as account_id,
|
||||
@ -70,9 +70,8 @@
|
||||
}}
|
||||
{{/select}}
|
||||
|
||||
{{if $amort_line.amort_amount == null}}
|
||||
{{if $amort_line.amort_number == 0}}
|
||||
{{* 1er amortissement *}}
|
||||
{{:assign premier_amort=true}}
|
||||
{{* déterminer le compte d'amortissement en fonction du compte d'immobilisation *}}
|
||||
{{#select code, label from acc_accounts where id = :id; :id=$ligne_immo.account_id assign=amort_account}}
|
||||
{{/select}}
|
||||
@ -85,7 +84,6 @@
|
||||
{{:assign var=libelle value="Amortissement %s"|args:$ligne_immo.label}}
|
||||
{{else}}
|
||||
{{* amortissements suivants *}}
|
||||
{{:assign premier_amort=false}}
|
||||
{{:assign date_debut=$amort_line.amort_date|strtotime}}
|
||||
{{:assign date_debut="%d+(60*60*24)"|math:$date_debut|date:"Y-m-d"}}
|
||||
{{:assign var=code_amort value=$amort_line.account_code}}
|
||||
@ -98,8 +96,9 @@
|
||||
ou la date du dernier amortissement
|
||||
*}}
|
||||
{{:assign msg_years=""}}
|
||||
{{#years closed=false order="start_date" where="start_date <= :debut AND :debut <= end_date" :debut=$date_debut assign=years.}}
|
||||
{{if $premier_amort}}
|
||||
{{#years closed=false order="start_date" where="start_date <= :debut AND :debut <= end_date"
|
||||
:debut=$date_debut assign=years.}}
|
||||
{{if $amort_line.amort_number == 0}}
|
||||
{{:assign ts_debut=$date_debut|strtotime}}
|
||||
{{else}}
|
||||
{{:assign ts_debut=$start_date|strtotime}}
|
||||
@ -129,7 +128,7 @@
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{if ! $ok}}
|
||||
{{:error message="La date choisie n'est dans aucun exercice compatible !!\nExercices compatibles : %s"|args:$msg_years}}
|
||||
{{:error message="La date choisie n'est dans aucun exercice compatible !\nExercices compatibles : %s"|args:$msg_years}}
|
||||
{{/if}}
|
||||
{{* déterminer le numéro des comptes au cas où la clé serait un identifiant *}}
|
||||
{{:include
|
||||
@ -233,7 +232,7 @@
|
||||
{{* -------------------------------------------------------------------------------- *}}
|
||||
|
||||
<div id="f_erreur" class="hidden">
|
||||
<p class="block error">La date saisie n'est pas dans l'exercice choisi</p>
|
||||
<p class="block error">La date saisie n'est pas dans l'exercice choisi !</p>
|
||||
</div>
|
||||
|
||||
<form method="post" action="">
|
||||
|
@ -1,9 +1,9 @@
|
||||
// activer/désactiver les champs passés en paramètres
|
||||
function toggleInputs(idcb, idfields) {
|
||||
const noamort = document.getElementById(idcb);
|
||||
const elem = document.getElementById(idcb);
|
||||
for (let id of idfields) {
|
||||
const field = document.getElementById(id);
|
||||
if (noamort.checked) {
|
||||
if (elem.checked) {
|
||||
field.removeAttribute("disabled");
|
||||
}
|
||||
else {
|
||||
@ -13,10 +13,10 @@ function toggleInputs(idcb, idfields) {
|
||||
}
|
||||
|
||||
function toggleVisibility(idcheck, fields) {
|
||||
const amortcb = document.getElementById(idcheck);
|
||||
const elem = document.getElementById(idcheck);
|
||||
for (let id of fields) {
|
||||
const field = document.getElementById(id);
|
||||
if (amortcb.checked) {
|
||||
if (elem.checked) {
|
||||
field.setAttribute('class', '');
|
||||
} else {
|
||||
field.setAttribute('class', 'hidden');
|
||||
|
Loading…
Reference in New Issue
Block a user