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