Compare commits
No commits in common. "9e79eb7f4278fcf94fcec1bd5f07b237165e71f8" and "c943c9d3e6969b4a0aaedc2fce6562e15ac1c3ff" have entirely different histories.
9e79eb7f42
...
c943c9d3e6
12
_nav.html
12
_nav.html
@ -1,10 +1,4 @@
|
||||
<nav class="tabs">
|
||||
{{if $current == 'index'}}
|
||||
<aside>
|
||||
{{:linkbutton label="Ajouter une immobilisation" shape="plus" href="add_asset.html" target="_dialog"}}
|
||||
</aside>
|
||||
{{/if}}
|
||||
|
||||
<ul>
|
||||
<li {{if $current == 'index'}} class="current"{{/if}}><a href="{{$module.url}}index.html">Immobilisations</a></li>
|
||||
<li {{if $current == 'aide'}} class="current"{{/if}}><a href="{{$module.url}}aide.html">Aide</a></li>
|
||||
@ -12,9 +6,9 @@
|
||||
|
||||
{{if $current == 'index'}}
|
||||
<ul class="sub">
|
||||
<li {{if $subcurrent == 'amort'}}class="current"{{/if}}><a href="index.html?amort=amort">Amortissables</a></li>
|
||||
<li {{if $subcurrent == 'fini'}}class="current"{{/if}}><a href="index.html?amort=fini">Terminées</a></li>
|
||||
<li {{if $subcurrent == 'no_amort'}}class="current"{{/if}}><a href="index.html?amort=no_amort">Non amortissables</a></li>
|
||||
<li {{if $subcurrent == 'amort'}}class="current"{{/if}}><a href="index.html?amort=1">Amortissables</a></li>
|
||||
<li {{if $subcurrent == 'fini'}}class="current"{{/if}}><a href="index.html?amort=2">Terminées</a></li>
|
||||
<li {{if $subcurrent == 'no_amort'}}class="current"{{/if}}><a href="index.html?amort=0">Non amortissables</a></li>
|
||||
</ul>
|
||||
{{if $subsubcurrent == 'amortization'}}
|
||||
<ul class="sub">
|
||||
|
128
aide.html
128
aide.html
@ -5,78 +5,69 @@
|
||||
{{* barre de navigation *}}
|
||||
{{:include file="_nav.html" current="aide"}}
|
||||
|
||||
<p class="aide">
|
||||
Ce module gère l'amortissement linéaire des immobilisations.
|
||||
</p>
|
||||
|
||||
<h2 class="aide">Immobilisations</h2>
|
||||
Elles sont classées dans 3 onglets :
|
||||
|
||||
<h3 class="aide">Amortissables</h3>
|
||||
|
||||
On y trouve les immobilisations en cours et celles pour lesquelles le
|
||||
module n'a pas d'information.
|
||||
|
||||
<p class="aide">
|
||||
Dans le deuxième cas, il faut cliquer sur le bouton « Ajouter
|
||||
infos » puis :
|
||||
<ul class="aide">
|
||||
<li>soit indiquer que l'immobilisation ne doit pas être amortie</li>
|
||||
<li>soit fournir la date de mise en service du bien (si différente de la date d'acquisition) ainsi
|
||||
que la durée en années de l'amortissement</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p class="aide">
|
||||
Tant qu'une immobilisation ne possède pas d'amortissement, il est
|
||||
possible de modifier ses informations à l'aide du bouton «
|
||||
Modifier infos ».
|
||||
</p>
|
||||
|
||||
<h3 class="aide">Terminées</h3>
|
||||
|
||||
On y trouve les immobilisations dont l'amortissement est terminé
|
||||
|
||||
<h3 class="aide">Non amortissables</h3>
|
||||
|
||||
<h3 class="aide">Ajouter une immobilisation</h3>
|
||||
|
||||
<div class="aide">
|
||||
<p class="aide">
|
||||
On peut indiquer qu'il s'agit d'une immobilisation qui ne doit pas être amortie ; dans le cas contraire, il faut renseigner les différents paramètres de l'immobilisation :
|
||||
<h2>Liste des immobilisations</h2>
|
||||
<div class="infos">
|
||||
<p>
|
||||
On y trouve les immobilisations détectées par le module,
|
||||
c'est-à-dire les écritures passées sur les comptes
|
||||
d'immobilisation <b>20xx</b> et <b>21xx</b>.
|
||||
</p>
|
||||
<ul class="aide">
|
||||
<p>
|
||||
Dans le cas d'une immobilisation qui n'est pas encore prise en
|
||||
charge par le module, il faut fournir la date de mise en
|
||||
service du bien (si différente de la date d'acquisition) ainsi
|
||||
que la durée en années de l'amortissement en cliquant sur le
|
||||
bouton « Ajouter infos ».
|
||||
</p>
|
||||
<p>
|
||||
On obtient la liste des amortissements d'une immobilisation
|
||||
en cliquant le bouton «Amortissements ».
|
||||
</p>
|
||||
<p>
|
||||
On peut enregistrer une nouvelle immobilisation en
|
||||
cliquant le bouton « Ajouter une immobilisation ».
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h3>Ajout d'immobilisation</h3>
|
||||
|
||||
<div class="help block">
|
||||
<p>
|
||||
Il faut renseigner les différents paramètres de l'immobilisation :
|
||||
<ul>
|
||||
<li>Date d'acquisition du bien</li>
|
||||
<li>Date de mise en service du bien : uniquement si différente de la précédente</li>
|
||||
<li>Désignation : c'est le libellé de l'immobilisation</li>
|
||||
<li>Montant</li>
|
||||
<li>Durée d'amortissement en années</li>
|
||||
<li>Compte de décaissement : à choisir dans la liste</li>
|
||||
<li>Compte d'immobilisation : doit débuter par <b>20</b>, <b>21</b> ou <b>27</b></li>
|
||||
<li>Compte d'immobilisation : doit débuter par <b>20</b> ou <b>21</b></li>
|
||||
<li>Projet analytique (optionnel)</li>
|
||||
</ul>
|
||||
<p>
|
||||
Après ajout, on se retrouve sur la page d'accueil des immobilisations.
|
||||
</p>
|
||||
|
||||
Après ajout, on se retrouve sur la page d'accueil (Liste des immobilisations)
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h2 class="aide">Amortissements</h2>
|
||||
<h2>Amortissements</h2>
|
||||
|
||||
<div class="infos">
|
||||
<p class="aide">
|
||||
<p>
|
||||
Le calcul de l'amortissement se fait par la <em>méthode linéaire</em>.
|
||||
</p>
|
||||
<p class="aide">
|
||||
<p>
|
||||
La date de début du calcul est par défaut la <em>date d'achat</em> ; si la
|
||||
date de mise en service est <em>postérieure</em> à la date d'achat, c'est
|
||||
celle-ci qui est prise en compte.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h3 class="aide">Liste des amortissements</h3>
|
||||
<h3>Liste des amortissements</h3>
|
||||
|
||||
<div class="aide">
|
||||
<div class="help block">
|
||||
<fieldset>
|
||||
On trouve ici de une à trois listes, selon la situation :
|
||||
<ul class="aide">
|
||||
<ul>
|
||||
<li>
|
||||
<b>Écritures d'amortissement liées à l'immobilisation courante</b>
|
||||
<p>
|
||||
@ -88,9 +79,8 @@ On y trouve les immobilisations dont l'amortissement est terminé
|
||||
<li>
|
||||
<b>Écritures d'amortissements à enregistrer</b>
|
||||
<p>
|
||||
Ce sont les écritures amortissement de
|
||||
l'immobilisation courante qui n'ont pas encore été
|
||||
enregistrées ; seules les amortissements d'un
|
||||
Ce sont les amortissements qui n'ont pas encore
|
||||
été enregistrés ; seules les amortissements d'un
|
||||
exercice ouvert peuvent être enregistrés ; les
|
||||
autres sont présents pour information et pourront
|
||||
être enregistrés quand l'exercice correspondant
|
||||
@ -107,23 +97,24 @@ On y trouve les immobilisations dont l'amortissement est terminé
|
||||
courante.
|
||||
</p>
|
||||
<p>
|
||||
Si on a rattaché par erreur une écriture
|
||||
Si on a rattaché par erreur une écritures
|
||||
d'amortissement à une immobilisation, le bouton «
|
||||
Détacher » en face de l'écriture permettra de
|
||||
défaire l'opération.
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<h3 class="aide">Créer une écriture d'amortissement</h3>
|
||||
<h3>Enregistrer un amortissement</h3>
|
||||
|
||||
<div class="aide">
|
||||
<p class=aide">
|
||||
<div class="help block">
|
||||
<p>
|
||||
Il faut renseigner les différents paramètres de l'amortissement :
|
||||
<ul class="aide">
|
||||
<ul>
|
||||
<li>Date ; par défaut, il s'agit de la date de fin d'exercice</li>
|
||||
<li>Désignation : déterminée à partir du libellé de l'immobilisation< ; elle peut être modifiée/li>
|
||||
<li>Désignation : déterminée à partir du libellé de l'immobilisation</li>
|
||||
<li>Montant : sa valeur est calculée par le module ; elle peut être modifiée</li>
|
||||
<li>
|
||||
Compte de débit : à choisir dans la liste ; par défaut c'est le compte <em>6811 : Dotation aux amortissements des immobilisations</em>
|
||||
@ -132,24 +123,7 @@ On y trouve les immobilisations dont l'amortissement est terminé
|
||||
Compte d'amortissement : à choisir dans la liste ; par défaut c'est le compte formé en intercalant un 8 après le 2 initial du compte d'immobilisation (exemple : 2183 => 28183)
|
||||
</li>
|
||||
</ul>
|
||||
<p class="aide">
|
||||
Après enregistrement, on se retrouve sur la page des amortissements
|
||||
</p>
|
||||
|
||||
Après enregistrement, on se retrouve sur la page des amortissements
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h2 class="aide">Remarques</h2>
|
||||
|
||||
<ul class="aide">
|
||||
<li>
|
||||
Les écritures d'immobilisation et d'amortissement créées en
|
||||
dehors du module ne peuvent être associées automatiquement que
|
||||
si leurs écritures ont été liées ; dans le cas contraire, il
|
||||
faudra renseigner manuellement les infos de l'immobilisation.
|
||||
</li>
|
||||
<li>
|
||||
Les écritures d'immobilisation de la balance d'ouverture ne
|
||||
peuvent être détectées automatiquement : il faudra indiquer
|
||||
manuellement qu'elles ne doivent pas être amorties.
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -3,9 +3,9 @@
|
||||
{{:admin_header title="Liste des amortissements" custom_css="./style.css" current="module_amortissement"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{if $_GET.amort == null || $_GET.amort == "amort"}}
|
||||
{{if $_GET.fini == null || $_GET.fini == 0}}
|
||||
{{:assign subcurrent="amort"}}
|
||||
{{elseif $_GET.amort == "fini"}}
|
||||
{{elseif $_GET.fini == 1}}
|
||||
{{:assign subcurrent="fini"}}
|
||||
{{else}}
|
||||
{{:assign subcurrent="no_amort"}}
|
||||
@ -31,6 +31,13 @@
|
||||
{{/if}}
|
||||
|
||||
{{* récupérer les infos de l'immobilisation *}}
|
||||
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
||||
{{else}}
|
||||
{{:error message="Pas d'info concernant l'immobilisation %s"|args:$_GET.immo_id}}
|
||||
{{/load}}
|
||||
{{:assign var="duree" from="info_immo.duration"|args:$_GET.immo_id}}
|
||||
{{:assign date_debut=$info_immo.date}}
|
||||
|
||||
{{#select
|
||||
line.id as immo_id,
|
||||
line.id_account as account_id,
|
||||
@ -49,15 +56,11 @@
|
||||
:line_id = $_GET.immo_id|intval
|
||||
assign=ligne_immo
|
||||
}}
|
||||
<h2>Amortissement de « {{$label}} » d'un montant de {{"%f"|math:$montant|money_currency}} en date du {{$date_debut|date_short}} sur {{$duree}} ans</h2>
|
||||
{{else}}
|
||||
{{:error message="Immobilisation %s non trouvée"|args:$_GET.immo_id}}
|
||||
{{/select}}
|
||||
|
||||
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
||||
{{:assign var="duree" from="info_immo.duration"|args:$_GET.immo_id}}
|
||||
{{:assign date_debut=$info_immo.date}}
|
||||
{{/load}}
|
||||
|
||||
{{* chercher des écritures d'amortissement liées à l'immobilisation *}}
|
||||
{{#select
|
||||
l_amort.credit as amort_amount,
|
||||
@ -94,32 +97,25 @@
|
||||
assign=linked_lines.
|
||||
}}
|
||||
{{:assign var="amort_years." value=$amort_year}}
|
||||
{{if $date_debut == null}}
|
||||
{{:assign date_debut=$amort_date}}
|
||||
{{/if}}
|
||||
{{/select}}
|
||||
|
||||
<h2>Amortissement de « {{$ligne_immo.label}} » d'un montant de {{"%f"|math:$ligne_immo.montant|money_currency}} en date du {{$date_debut|date_short}}{{if $duree != null}} sur {{$duree}} ans{{/if}}</h2>
|
||||
|
||||
{{if $duree != null}}
|
||||
{{* montant de l'annuité théorique *}}
|
||||
{{:assign montant="%f"|math:$ligne_immo.montant}}
|
||||
{{:assign annuite="%f/%f"|math:$montant:$duree}}
|
||||
{{* première annuité *}}
|
||||
{{:assign date_amort=$ligne_immo.date_amort}}
|
||||
{{if $date_amort|strtotime < $date_debut|strtotime}}
|
||||
{{* changer d'exercice *}}
|
||||
{{:include file="_next_year.html" date=$date_amort keep="date_amort"}}
|
||||
{{:assign date_amort=$date_amort|parse_date}}
|
||||
{{/if}}
|
||||
{{:include file="_calcul_dates.html" date_debut=$date_debut date_fin=$date_amort keep="nbjours"}}
|
||||
{{:assign annuite_1="%f/360*%d"|math:$annuite:$nbjours|intval}}
|
||||
{{:assign annuite_courante=$annuite_1}}
|
||||
{{:assign current_year=$ligne_immo.year_id}}
|
||||
{{:assign nbamort=0}}
|
||||
{{* montant de l'annuité théorique *}}
|
||||
{{:assign montant="%f"|math:$ligne_immo.montant}}
|
||||
{{:assign annuite="%f/%f"|math:$montant:$duree}}
|
||||
{{* première annuité *}}
|
||||
{{:assign date_amort=$ligne_immo.date_amort}}
|
||||
{{if $date_amort|strtotime < $date_debut|strtotime}}
|
||||
{{* changer d'exercice *}}
|
||||
{{:include file="_next_year.html" date=$date_amort keep="date_amort"}}
|
||||
{{:assign date_amort=$date_amort|parse_date}}
|
||||
{{/if}}
|
||||
|
||||
{{:include file="_calcul_dates.html" date_debut=$date_debut date_fin=$date_amort keep="nbjours"}}
|
||||
{{:assign annuite_1="%f/360*%d"|math:$annuite:$nbjours|intval}}
|
||||
{{:assign annuite_courante=$annuite_1}}
|
||||
{{:assign current_year=$ligne_immo.year_id}}
|
||||
{{:assign solde=$ligne_immo.montant}}
|
||||
{{:assign nbamort=0}}
|
||||
|
||||
{{if $linked_lines != null}}
|
||||
<section class="amortissement">
|
||||
<h3 class="ruler">
|
||||
@ -176,7 +172,7 @@
|
||||
</section>
|
||||
{{/if}}
|
||||
|
||||
{{if $duree != null && $solde > 0}}
|
||||
{{if $solde > 0}}
|
||||
{{:assign project_id=$ligne_immo.project_id}}
|
||||
{{:assign project_label=$ligne_immo.project_label}}
|
||||
{{:assign nbamort="%d-%d"|math:$duree:$nbamort}}
|
||||
@ -235,89 +231,89 @@
|
||||
</section>
|
||||
{{/if}}
|
||||
|
||||
{{if $_GET.amort == null || $_GET.amort != "fini"}}
|
||||
{{if $_GET.fini == null || $_GET.fini != 1}}
|
||||
|
||||
{{* amortissement à exclure *}}
|
||||
{{:include
|
||||
file="_amort_exclus.html"
|
||||
keep="amort_exclus"
|
||||
}}
|
||||
{{* amortissement à exclure *}}
|
||||
{{:include
|
||||
file="_amort_exclus.html"
|
||||
keep="amort_exclus"
|
||||
}}
|
||||
|
||||
{{* Autres amortissements non rattachés *}}
|
||||
{{* Autres amortissements non rattachés *}}
|
||||
{{#select
|
||||
li.id as l_id,
|
||||
li.id_transaction as t_id,
|
||||
li.credit as montant,
|
||||
li.reference,
|
||||
li.label as l_label,
|
||||
trans.date as t_date,
|
||||
trans.label as t_label,
|
||||
acc.code as a_code,
|
||||
acc.label as a_label,
|
||||
y.label as y_label
|
||||
from acc_transactions_lines as li
|
||||
inner join acc_accounts as acc on acc.id = li.id_account
|
||||
inner join acc_transactions as trans on trans.id = li.id_transaction
|
||||
inner join acc_years as y on y.id = trans.id_year
|
||||
where acc.code like "28%"
|
||||
order by trans.date, trans.label;
|
||||
assign=autre_amort
|
||||
}}
|
||||
{{#select
|
||||
li.id as l_id,
|
||||
li.id_transaction as t_id,
|
||||
li.credit as montant,
|
||||
li.reference,
|
||||
li.label as l_label,
|
||||
trans.date as t_date,
|
||||
trans.label as t_label,
|
||||
acc.code as a_code,
|
||||
acc.label as a_label,
|
||||
y.label as y_label
|
||||
from acc_transactions_lines as li
|
||||
inner join acc_accounts as acc on acc.id = li.id_account
|
||||
inner join acc_transactions as trans on trans.id = li.id_transaction
|
||||
inner join acc_years as y on y.id = trans.id_year
|
||||
where acc.code like "28%" AND credit > 0
|
||||
order by trans.date, trans.label;
|
||||
assign=autre_amort
|
||||
id_transaction,
|
||||
id_related
|
||||
from acc_transactions_links
|
||||
where id_transaction = :id_amort or id_related = :id_amort;
|
||||
:id_amort=$t_id
|
||||
}}
|
||||
{{#select
|
||||
id_transaction,
|
||||
id_related
|
||||
from acc_transactions_links
|
||||
where id_transaction = :id_amort or id_related = :id_amort;
|
||||
:id_amort=$t_id
|
||||
}}
|
||||
{{else}}
|
||||
{{if $autre_amort.t_id|in:$amort_exclus}}
|
||||
{{else}}
|
||||
{{if $autre_amort.t_id|in:$amort_exclus}}
|
||||
{{else}}
|
||||
{{:assign var="autres_amortissements." value=$autre_amort}}
|
||||
{{/if}}
|
||||
{{/select}}
|
||||
{{:assign var="autres_amortissements." value=$autre_amort}}
|
||||
{{/if}}
|
||||
{{/select}}
|
||||
{{/select}}
|
||||
|
||||
{{if $autres_amortissements != null}}
|
||||
<section class="amortissement">
|
||||
<h3 class="ruler">Autres amortissements non rattachés</h3>
|
||||
<table class="list">
|
||||
<thead>
|
||||
{{if $autres_amortissements != null}}
|
||||
<section class="amortissement">
|
||||
<h3 class="ruler">Autres amortissements non rattachés</h3>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>N°</th>
|
||||
<th>Date</th>
|
||||
<th class="nombre">Montant</th>
|
||||
<th>Libellé</th>
|
||||
<th>N° compte</th>
|
||||
<th>Compte</th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{{#foreach from=$autres_amortissements item="line"}}
|
||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.t_id}}
|
||||
<tr>
|
||||
<th>N°</th>
|
||||
<th>Date</th>
|
||||
<th class="nombre">Montant</th>
|
||||
<th>Libellé</th>
|
||||
<th>N° compte</th>
|
||||
<th>Compte</th>
|
||||
<th class="actions"></th>
|
||||
<td class="num"><a href={{$trans_url}}>#{{$line.t_id}}</a></td>
|
||||
<td>{{$line.t_date|date_short}}</td>
|
||||
<td class="money">{{"%f"|math:$line.montant|money}}</td>
|
||||
<td>{{if $line.l_label == null}}
|
||||
{{$line.t_label}}
|
||||
{{else}}
|
||||
{{$line.l_label}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td>{{$line.a_code}}</td>
|
||||
<td>{{$line.a_label}}</td>
|
||||
<td>
|
||||
{{:linkbutton label="Attacher" href="attach_amort.html?amort_id=%d&immo_id=%d"|args:$line.l_id:$ligne_immo.immo_id shape="plus"}}
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{{#foreach from=$autres_amortissements item="line"}}
|
||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.t_id}}
|
||||
<tr>
|
||||
<td class="num"><a href={{$trans_url}}>#{{$line.t_id}}</a></td>
|
||||
<td>{{$line.t_date|date_short}}</td>
|
||||
<td class="money">{{"%f"|math:$line.montant|money}}</td>
|
||||
<td>{{if $line.l_label == null}}
|
||||
{{$line.t_label}}
|
||||
{{else}}
|
||||
{{$line.l_label}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td>{{$line.a_code}}</td>
|
||||
<td>{{$line.a_label}}</td>
|
||||
<td>
|
||||
{{:linkbutton label="Attacher" href="attach_amort.html?amort_id=%d&immo_id=%d"|args:$line.l_id:$ligne_immo.immo_id shape="plus"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{:form_errors}}
|
||||
{{:admin_footer}}
|
||||
|
@ -3,11 +3,7 @@
|
||||
{{* Liste des immobilisations amortissable ou à définir *}}
|
||||
|
||||
<section class="immobilisation">
|
||||
{{if $amort == "amort"}}
|
||||
<h2 class="ruler">Immobilisations en cours</h2>
|
||||
{{else}}
|
||||
<h2 class="ruler">Immobilisations amorties</h2>
|
||||
{{/if}}
|
||||
<h2 class="ruler">Immobilisations en cours</h2>
|
||||
|
||||
<table class="list">
|
||||
<thead>
|
||||
@ -35,7 +31,6 @@
|
||||
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$quote|cat:$code|cat:"%"|cat:$quote|cat:" OR "}}
|
||||
{{/foreach}}
|
||||
{{:assign condition=$condition|cat:"0)"}}
|
||||
{{:assign condition=$condition|cat:" AND debit > 0"}}
|
||||
|
||||
{{#select
|
||||
trans.id as trans_id,
|
||||
@ -60,7 +55,6 @@
|
||||
{{: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 duration=null}}
|
||||
{{* voir si l'immo est prise en charge *}}
|
||||
{{#load type="immo" where="$$.line = :line_id" :line_id=$immo_id|intval}}
|
||||
{{:assign duration=$duration}}
|
||||
{{if $noamort}}
|
||||
@ -98,16 +92,13 @@
|
||||
}}
|
||||
{{if $amort_amount == null}}
|
||||
{{:assign exist_amort=false}}
|
||||
{{:assign amort_amount=0}}
|
||||
{{else}}
|
||||
{{:assign amort_amount=$amort_amount}}
|
||||
{{:assign exist_amort=true}}
|
||||
{{/if}}
|
||||
{{/select}}
|
||||
{{* immo amortie ? *}}
|
||||
{{if $amort == "amort" && $amort_amount >= $debit ||
|
||||
$amort == "fini" && $amort_amount < $debit
|
||||
}}
|
||||
{{if $amort_amount >= $debit}}
|
||||
{{:continue}}
|
||||
{{/if}}
|
||||
<tr>
|
||||
@ -120,7 +111,7 @@
|
||||
<td>{{$account_label}}</td>
|
||||
<td>{{$project_label}}</td>
|
||||
<td class="actions">
|
||||
{{if ! $exist_amort && $duration == null}}
|
||||
{{if $duration == null}}
|
||||
{{:linkbutton
|
||||
label="Ajouter infos"
|
||||
href="add_infos.html?immo_id=%s&amort=1"|args:$immo_id
|
||||
@ -138,7 +129,7 @@
|
||||
{{/if}}
|
||||
{{:linkbutton
|
||||
label="Amortissements"
|
||||
href="amortization.html?immo_id=%s&amort=%s"|args:$immo_id:$amort
|
||||
href="amortization.html?immo_id=%s"|args:$immo_id
|
||||
shape="table"
|
||||
}}
|
||||
{{/if}}
|
||||
@ -148,3 +139,17 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<form method="post" action="">
|
||||
<fieldset>
|
||||
<legend>Ajouter une immobilisation</legend>
|
||||
<p class="submit">
|
||||
{{:linkbutton
|
||||
label="Ajouter une immobilisation"
|
||||
shape="plus"
|
||||
href="add_asset.html"
|
||||
target="_dialog"
|
||||
}}
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
141
immobilisations_achevees.html
Normal file
141
immobilisations_achevees.html
Normal file
@ -0,0 +1,141 @@
|
||||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{* Liste des immobilisations totalement amorties *}}
|
||||
|
||||
<section class="immobilisation">
|
||||
<h2 class="ruler">Immobilisations amorties</h2>
|
||||
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>N°</th>
|
||||
<th>Date</th>
|
||||
<th>Libellé</th>
|
||||
<th class="nombre">Montant</th>
|
||||
<th class="nombre">Durée</th>
|
||||
<th>N° compte</th>
|
||||
<th>Compte</th>
|
||||
<th>Projet</th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{{* lister les immobilisations *}}
|
||||
{{:read file="./defaut.json" assign="config_json"}}
|
||||
{{:assign config_defaut=$config_json|json_decode}}
|
||||
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
||||
{{:assign quote="'"}}
|
||||
{{:assign condition="("}}
|
||||
{{#foreach from=$prefix_array item="code"}}
|
||||
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$quote|cat:$code|cat:"%"|cat:$quote|cat:" OR "}}
|
||||
{{/foreach}}
|
||||
{{:assign condition=$condition|cat:"0)"}}
|
||||
|
||||
{{#select
|
||||
trans.id as trans_id,
|
||||
trans.label as trans_label,
|
||||
trans.date as trans_date,
|
||||
line.id as immo_id,
|
||||
account.id as account_id,
|
||||
account.code as account_code,
|
||||
account.label as account_label,
|
||||
line.debit AS debit,
|
||||
project.label as project_label,
|
||||
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 acc_projects AS project ON line.id_project = project.id
|
||||
WHERE !condition
|
||||
ORDER BY trans.date DESC;
|
||||
!condition=$condition
|
||||
}}
|
||||
{{: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 duration=null}}
|
||||
{{#load type="immo" where="$$.line = :line_id" :line_id=$immo_id|intval}}
|
||||
{{:assign duration=$duration}}
|
||||
{{if $noamort}}
|
||||
{{:assign amortissable="non"}}
|
||||
{{else}}
|
||||
{{:assign amortissable="oui"}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{:assign amortissable="nsp"}}
|
||||
{{/load}}
|
||||
{{if $amortissable == "non"}}
|
||||
{{:continue}}
|
||||
{{/if}}
|
||||
{{* voir s'il existe des écritures d'amortissement associées *}}
|
||||
{{#select
|
||||
sum(l_amort.credit) as amort_amount,
|
||||
CASE links.id_related = t_immo.id
|
||||
WHEN true THEN links.id_transaction
|
||||
WHEN false THEN links.id_related
|
||||
END as amort_trans_id
|
||||
FROM acc_transactions_lines as l_immo
|
||||
INNER JOIN acc_transactions as t_immo on t_immo.id = l_immo.id_transaction
|
||||
INNER JOIN acc_transactions_links as links
|
||||
ON (
|
||||
t_immo.id = links.id_transaction
|
||||
OR
|
||||
t_immo.id = links.id_related
|
||||
)
|
||||
INNER JOIN acc_transactions_lines as l_amort on amort_trans_id = l_amort.id_transaction
|
||||
WHERE
|
||||
l_immo.id = :line_id
|
||||
AND
|
||||
l_amort.credit <> 0;
|
||||
:line_id = $immo_id|intval
|
||||
}}
|
||||
{{if $amort_amount == null}}
|
||||
{{:assign exist_amort=false}}
|
||||
{{else}}
|
||||
{{:assign amort_amount=$amort_amount}}
|
||||
{{:assign exist_amort=true}}
|
||||
{{/if}}
|
||||
{{/select}}
|
||||
{{* immo amortie ? *}}
|
||||
{{if $amort_amount < $debit}}
|
||||
{{:continue}}
|
||||
{{/if}}
|
||||
<tr>
|
||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||
<td>{{$trans_date|date_short}}</td>
|
||||
<td>{{$trans_label}}</td>
|
||||
<td class="money">{{"%f"|math:$debit|money}}</td>
|
||||
<td class="money">{{if $duration != null}}{{$duration}}{{/if}}</td>
|
||||
<td><a href={{$compte_url}}>{{$account_code}}</a></td>
|
||||
<td>{{$account_label}}</td>
|
||||
<td>{{$project_label}}</td>
|
||||
<td class="actions">
|
||||
{{if $duration == null}}
|
||||
{{:linkbutton
|
||||
label="Ajouter infos"
|
||||
href="add_infos.html?immo_id=%s&amort=1"|args:$immo_id
|
||||
shape="help"
|
||||
target="_dialog"
|
||||
}}
|
||||
{{else}}
|
||||
{{if ! $exist_amort}}
|
||||
{{:linkbutton
|
||||
label="Modifier infos"
|
||||
href="modif_infos.html?immo_id=%s&amort=1"|args:$immo_id
|
||||
shape="help"
|
||||
target="_dialog"
|
||||
}}
|
||||
{{/if}}
|
||||
{{:linkbutton
|
||||
label="Amortissements"
|
||||
href="amortization.html?immo_id=%s&fini=1"|args:$immo_id
|
||||
shape="table"
|
||||
}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/select}}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
15
index.html
15
index.html
@ -2,10 +2,12 @@
|
||||
{{:admin_header title="Gestion des amortissements" custom_css="./style.css" current="module_amortissement"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{if $_GET.amort == null}}
|
||||
{{if $_GET.amort == null || $_GET.amort == 1}}
|
||||
{{:assign amort="amort"}}
|
||||
{{elseif $_GET.amort == 2}}
|
||||
{{:assign amort="fini"}}
|
||||
{{else}}
|
||||
{{:assign amort=$_GET.amort}}
|
||||
{{:assign amort="no_amort"}}
|
||||
{{/if}}
|
||||
|
||||
{{:include file="_nav.html" current="index" subcurrent="%s"|args:$amort}}
|
||||
@ -35,10 +37,11 @@
|
||||
{{/select}}
|
||||
{{/load}}
|
||||
|
||||
{{if $amort == "no_amort"}}
|
||||
{{:include file="./immobilisations_non.html"}}
|
||||
{{else}}
|
||||
{{if $amort == "amort"}}
|
||||
{{:include file="./immobilisations.html"}}
|
||||
{{elseif $amort == "fini"}}
|
||||
{{:include file="./immobilisations_achevees.html"}}
|
||||
{{else}}
|
||||
{{:include file="./immobilisations_non.html"}}
|
||||
{{/if}}
|
||||
|
||||
{{:admin_footer}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
name="Amortissements"
|
||||
description="Gestion des amortissements pour le logiciel de comptabilité Paheko (v0.12)"
|
||||
description="Gestion des amortissements pour le logiciel de comptabilité Paheko (v0.11)"
|
||||
author="Jean-Christophe Engel"
|
||||
author_url="https://git.roflcopter.fr/lesanges"
|
||||
home_button=false
|
||||
|
Loading…
Reference in New Issue
Block a user