Compare commits
4 Commits
c943c9d3e6
...
9e79eb7f42
Author | SHA1 | Date | |
---|---|---|---|
9e79eb7f42 | |||
03488b0ab9 | |||
5fcf510b25 | |||
3ef33e15e3 |
12
_nav.html
12
_nav.html
@ -1,4 +1,10 @@
|
|||||||
<nav class="tabs">
|
<nav class="tabs">
|
||||||
|
{{if $current == 'index'}}
|
||||||
|
<aside>
|
||||||
|
{{:linkbutton label="Ajouter une immobilisation" shape="plus" href="add_asset.html" target="_dialog"}}
|
||||||
|
</aside>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li {{if $current == 'index'}} class="current"{{/if}}><a href="{{$module.url}}index.html">Immobilisations</a></li>
|
<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>
|
<li {{if $current == 'aide'}} class="current"{{/if}}><a href="{{$module.url}}aide.html">Aide</a></li>
|
||||||
@ -6,9 +12,9 @@
|
|||||||
|
|
||||||
{{if $current == 'index'}}
|
{{if $current == 'index'}}
|
||||||
<ul class="sub">
|
<ul class="sub">
|
||||||
<li {{if $subcurrent == 'amort'}}class="current"{{/if}}><a href="index.html?amort=1">Amortissables</a></li>
|
<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=2">Terminées</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=0">Non amortissables</a></li>
|
<li {{if $subcurrent == 'no_amort'}}class="current"{{/if}}><a href="index.html?amort=no_amort">Non amortissables</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
{{if $subsubcurrent == 'amortization'}}
|
{{if $subsubcurrent == 'amortization'}}
|
||||||
<ul class="sub">
|
<ul class="sub">
|
||||||
|
126
aide.html
126
aide.html
@ -5,69 +5,78 @@
|
|||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{:include file="_nav.html" current="aide"}}
|
{{:include file="_nav.html" current="aide"}}
|
||||||
|
|
||||||
<h2>Liste des immobilisations</h2>
|
<p class="aide">
|
||||||
<div class="infos">
|
Ce module gère l'amortissement linéaire des immobilisations.
|
||||||
<p>
|
</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>
|
|
||||||
<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>
|
<h2 class="aide">Immobilisations</h2>
|
||||||
|
Elles sont classées dans 3 onglets :
|
||||||
|
|
||||||
<div class="help block">
|
<h3 class="aide">Amortissables</h3>
|
||||||
<p>
|
|
||||||
Il faut renseigner les différents paramètres de l'immobilisation :
|
On y trouve les immobilisations en cours et celles pour lesquelles le
|
||||||
<ul>
|
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 :
|
||||||
|
</p>
|
||||||
|
<ul class="aide">
|
||||||
<li>Date d'acquisition du bien</li>
|
<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>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>Désignation : c'est le libellé de l'immobilisation</li>
|
||||||
<li>Montant</li>
|
<li>Montant</li>
|
||||||
<li>Durée d'amortissement en années</li>
|
<li>Durée d'amortissement en années</li>
|
||||||
<li>Compte de décaissement : à choisir dans la liste</li>
|
<li>Compte de décaissement : à choisir dans la liste</li>
|
||||||
<li>Compte d'immobilisation : doit débuter par <b>20</b> ou <b>21</b></li>
|
<li>Compte d'immobilisation : doit débuter par <b>20</b>, <b>21</b> ou <b>27</b></li>
|
||||||
<li>Projet analytique (optionnel)</li>
|
<li>Projet analytique (optionnel)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<p>
|
||||||
Après ajout, on se retrouve sur la page d'accueil (Liste des immobilisations)
|
Après ajout, on se retrouve sur la page d'accueil des immobilisations.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Amortissements</h2>
|
<h2 class="aide">Amortissements</h2>
|
||||||
|
|
||||||
<div class="infos">
|
<div class="infos">
|
||||||
<p>
|
<p class="aide">
|
||||||
Le calcul de l'amortissement se fait par la <em>méthode linéaire</em>.
|
Le calcul de l'amortissement se fait par la <em>méthode linéaire</em>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p class="aide">
|
||||||
La date de début du calcul est par défaut la <em>date d'achat</em> ; si la
|
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
|
date de mise en service est <em>postérieure</em> à la date d'achat, c'est
|
||||||
celle-ci qui est prise en compte.
|
celle-ci qui est prise en compte.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>Liste des amortissements</h3>
|
<h3 class="aide">Liste des amortissements</h3>
|
||||||
|
|
||||||
<div class="help block">
|
<div class="aide">
|
||||||
<fieldset>
|
|
||||||
On trouve ici de une à trois listes, selon la situation :
|
On trouve ici de une à trois listes, selon la situation :
|
||||||
<ul>
|
<ul class="aide">
|
||||||
<li>
|
<li>
|
||||||
<b>Écritures d'amortissement liées à l'immobilisation courante</b>
|
<b>Écritures d'amortissement liées à l'immobilisation courante</b>
|
||||||
<p>
|
<p>
|
||||||
@ -79,8 +88,9 @@
|
|||||||
<li>
|
<li>
|
||||||
<b>Écritures d'amortissements à enregistrer</b>
|
<b>Écritures d'amortissements à enregistrer</b>
|
||||||
<p>
|
<p>
|
||||||
Ce sont les amortissements qui n'ont pas encore
|
Ce sont les écritures amortissement de
|
||||||
été enregistrés ; seules les amortissements d'un
|
l'immobilisation courante qui n'ont pas encore été
|
||||||
|
enregistrées ; seules les amortissements d'un
|
||||||
exercice ouvert peuvent être enregistrés ; les
|
exercice ouvert peuvent être enregistrés ; les
|
||||||
autres sont présents pour information et pourront
|
autres sont présents pour information et pourront
|
||||||
être enregistrés quand l'exercice correspondant
|
être enregistrés quand l'exercice correspondant
|
||||||
@ -97,24 +107,23 @@
|
|||||||
courante.
|
courante.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Si on a rattaché par erreur une écritures
|
Si on a rattaché par erreur une écriture
|
||||||
d'amortissement à une immobilisation, le bouton «
|
d'amortissement à une immobilisation, le bouton «
|
||||||
Détacher » en face de l'écriture permettra de
|
Détacher » en face de l'écriture permettra de
|
||||||
défaire l'opération.
|
défaire l'opération.
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</fieldset>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>Enregistrer un amortissement</h3>
|
<h3 class="aide">Créer une écriture d'amortissement</h3>
|
||||||
|
|
||||||
<div class="help block">
|
<div class="aide">
|
||||||
<p>
|
<p class=aide">
|
||||||
Il faut renseigner les différents paramètres de l'amortissement :
|
Il faut renseigner les différents paramètres de l'amortissement :
|
||||||
<ul>
|
<ul class="aide">
|
||||||
<li>Date ; par défaut, il s'agit de la date de fin d'exercice</li>
|
<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</li>
|
<li>Désignation : déterminée à partir du libellé de l'immobilisation< ; elle peut être modifiée/li>
|
||||||
<li>Montant : sa valeur est calculée par le module ; elle peut être modifiée</li>
|
<li>Montant : sa valeur est calculée par le module ; elle peut être modifiée</li>
|
||||||
<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>
|
Compte de débit : à choisir dans la liste ; par défaut c'est le compte <em>6811 : Dotation aux amortissements des immobilisations</em>
|
||||||
@ -123,7 +132,24 @@
|
|||||||
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)
|
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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<p class="aide">
|
||||||
Après enregistrement, on se retrouve sur la page des amortissements
|
Après enregistrement, on se retrouve sur la page des amortissements
|
||||||
|
</p>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</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"}}
|
{{:admin_header title="Liste des amortissements" custom_css="./style.css" current="module_amortissement"}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{if $_GET.fini == null || $_GET.fini == 0}}
|
{{if $_GET.amort == null || $_GET.amort == "amort"}}
|
||||||
{{:assign subcurrent="amort"}}
|
{{:assign subcurrent="amort"}}
|
||||||
{{elseif $_GET.fini == 1}}
|
{{elseif $_GET.amort == "fini"}}
|
||||||
{{:assign subcurrent="fini"}}
|
{{:assign subcurrent="fini"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign subcurrent="no_amort"}}
|
{{:assign subcurrent="no_amort"}}
|
||||||
@ -31,13 +31,6 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* récupérer les infos de l'immobilisation *}}
|
{{* 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
|
{{#select
|
||||||
line.id as immo_id,
|
line.id as immo_id,
|
||||||
line.id_account as account_id,
|
line.id_account as account_id,
|
||||||
@ -56,11 +49,15 @@
|
|||||||
:line_id = $_GET.immo_id|intval
|
:line_id = $_GET.immo_id|intval
|
||||||
assign=ligne_immo
|
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}}
|
{{else}}
|
||||||
{{:error message="Immobilisation %s non trouvée"|args:$_GET.immo_id}}
|
{{:error message="Immobilisation %s non trouvée"|args:$_GET.immo_id}}
|
||||||
{{/select}}
|
{{/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 *}}
|
{{* chercher des écritures d'amortissement liées à l'immobilisation *}}
|
||||||
{{#select
|
{{#select
|
||||||
l_amort.credit as amort_amount,
|
l_amort.credit as amort_amount,
|
||||||
@ -97,25 +94,32 @@
|
|||||||
assign=linked_lines.
|
assign=linked_lines.
|
||||||
}}
|
}}
|
||||||
{{:assign var="amort_years." value=$amort_year}}
|
{{:assign var="amort_years." value=$amort_year}}
|
||||||
|
{{if $date_debut == null}}
|
||||||
|
{{:assign date_debut=$amort_date}}
|
||||||
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{* montant de l'annuité théorique *}}
|
<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>
|
||||||
{{: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 $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}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{:assign solde=$ligne_immo.montant}}
|
||||||
{{if $linked_lines != null}}
|
{{if $linked_lines != null}}
|
||||||
<section class="amortissement">
|
<section class="amortissement">
|
||||||
<h3 class="ruler">
|
<h3 class="ruler">
|
||||||
@ -172,7 +176,7 @@
|
|||||||
</section>
|
</section>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $solde > 0}}
|
{{if $duree != null && $solde > 0}}
|
||||||
{{:assign project_id=$ligne_immo.project_id}}
|
{{:assign project_id=$ligne_immo.project_id}}
|
||||||
{{:assign project_label=$ligne_immo.project_label}}
|
{{:assign project_label=$ligne_immo.project_label}}
|
||||||
{{:assign nbamort="%d-%d"|math:$duree:$nbamort}}
|
{{:assign nbamort="%d-%d"|math:$duree:$nbamort}}
|
||||||
@ -231,89 +235,89 @@
|
|||||||
</section>
|
</section>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $_GET.fini == null || $_GET.fini != 1}}
|
{{if $_GET.amort == null || $_GET.amort != "fini"}}
|
||||||
|
|
||||||
{{* amortissement à exclure *}}
|
{{* amortissement à exclure *}}
|
||||||
{{:include
|
{{:include
|
||||||
file="_amort_exclus.html"
|
file="_amort_exclus.html"
|
||||||
keep="amort_exclus"
|
keep="amort_exclus"
|
||||||
}}
|
|
||||||
|
|
||||||
{{* 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
|
|
||||||
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}}
|
{{* 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%" AND credit > 0
|
||||||
|
order by trans.date, trans.label;
|
||||||
|
assign=autre_amort
|
||||||
|
}}
|
||||||
|
{{#select
|
||||||
|
id_transaction,
|
||||||
|
id_related
|
||||||
|
from acc_transactions_links
|
||||||
|
where id_transaction = :id_amort or id_related = :id_amort;
|
||||||
|
:id_amort=$t_id
|
||||||
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign var="autres_amortissements." value=$autre_amort}}
|
{{if $autre_amort.t_id|in:$amort_exclus}}
|
||||||
{{/if}}
|
{{else}}
|
||||||
|
{{:assign var="autres_amortissements." value=$autre_amort}}
|
||||||
|
{{/if}}
|
||||||
|
{{/select}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{/select}}
|
|
||||||
|
|
||||||
{{if $autres_amortissements != null}}
|
{{if $autres_amortissements != null}}
|
||||||
<section class="amortissement">
|
<section class="amortissement">
|
||||||
<h3 class="ruler">Autres amortissements non rattachés</h3>
|
<h3 class="ruler">Autres amortissements non rattachés</h3>
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<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>
|
<tr>
|
||||||
<td class="num"><a href={{$trans_url}}>#{{$line.t_id}}</a></td>
|
<th>N°</th>
|
||||||
<td>{{$line.t_date|date_short}}</td>
|
<th>Date</th>
|
||||||
<td class="money">{{"%f"|math:$line.montant|money}}</td>
|
<th class="nombre">Montant</th>
|
||||||
<td>{{if $line.l_label == null}}
|
<th>Libellé</th>
|
||||||
{{$line.t_label}}
|
<th>N° compte</th>
|
||||||
{{else}}
|
<th>Compte</th>
|
||||||
{{$line.l_label}}
|
<th class="actions"></th>
|
||||||
{{/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>
|
</tr>
|
||||||
{{/foreach}}
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
|
||||||
</section>
|
{{#foreach from=$autres_amortissements item="line"}}
|
||||||
{{/if}}
|
{{: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}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
@ -3,7 +3,11 @@
|
|||||||
{{* Liste des immobilisations amortissable ou à définir *}}
|
{{* Liste des immobilisations amortissable ou à définir *}}
|
||||||
|
|
||||||
<section class="immobilisation">
|
<section class="immobilisation">
|
||||||
<h2 class="ruler">Immobilisations en cours</h2>
|
{{if $amort == "amort"}}
|
||||||
|
<h2 class="ruler">Immobilisations en cours</h2>
|
||||||
|
{{else}}
|
||||||
|
<h2 class="ruler">Immobilisations amorties</h2>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
@ -31,6 +35,7 @@
|
|||||||
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$quote|cat:$code|cat:"%"|cat:$quote|cat:" OR "}}
|
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$quote|cat:$code|cat:"%"|cat:$quote|cat:" OR "}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{:assign condition=$condition|cat:"0)"}}
|
{{:assign condition=$condition|cat:"0)"}}
|
||||||
|
{{:assign condition=$condition|cat:" AND debit > 0"}}
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
trans.id as trans_id,
|
trans.id as trans_id,
|
||||||
@ -55,6 +60,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 duration=null}}
|
{{:assign duration=null}}
|
||||||
|
{{* voir si l'immo est prise en charge *}}
|
||||||
{{#load type="immo" where="$$.line = :line_id" :line_id=$immo_id|intval}}
|
{{#load type="immo" where="$$.line = :line_id" :line_id=$immo_id|intval}}
|
||||||
{{:assign duration=$duration}}
|
{{:assign duration=$duration}}
|
||||||
{{if $noamort}}
|
{{if $noamort}}
|
||||||
@ -92,13 +98,16 @@
|
|||||||
}}
|
}}
|
||||||
{{if $amort_amount == null}}
|
{{if $amort_amount == null}}
|
||||||
{{:assign exist_amort=false}}
|
{{:assign exist_amort=false}}
|
||||||
|
{{:assign amort_amount=0}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign amort_amount=$amort_amount}}
|
{{:assign amort_amount=$amort_amount}}
|
||||||
{{:assign exist_amort=true}}
|
{{:assign exist_amort=true}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{* immo amortie ? *}}
|
{{* immo amortie ? *}}
|
||||||
{{if $amort_amount >= $debit}}
|
{{if $amort == "amort" && $amort_amount >= $debit ||
|
||||||
|
$amort == "fini" && $amort_amount < $debit
|
||||||
|
}}
|
||||||
{{:continue}}
|
{{:continue}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<tr>
|
<tr>
|
||||||
@ -111,7 +120,7 @@
|
|||||||
<td>{{$account_label}}</td>
|
<td>{{$account_label}}</td>
|
||||||
<td>{{$project_label}}</td>
|
<td>{{$project_label}}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{{if $duration == null}}
|
{{if ! $exist_amort && $duration == null}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Ajouter infos"
|
label="Ajouter infos"
|
||||||
href="add_infos.html?immo_id=%s&amort=1"|args:$immo_id
|
href="add_infos.html?immo_id=%s&amort=1"|args:$immo_id
|
||||||
@ -129,7 +138,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Amortissements"
|
label="Amortissements"
|
||||||
href="amortization.html?immo_id=%s"|args:$immo_id
|
href="amortization.html?immo_id=%s&amort=%s"|args:$immo_id:$amort
|
||||||
shape="table"
|
shape="table"
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@ -139,17 +148,3 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</section>
|
</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>
|
|
||||||
|
@ -1,141 +0,0 @@
|
|||||||
{{* -*- 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,12 +2,10 @@
|
|||||||
{{:admin_header title="Gestion des amortissements" custom_css="./style.css" current="module_amortissement"}}
|
{{:admin_header title="Gestion des amortissements" custom_css="./style.css" current="module_amortissement"}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{if $_GET.amort == null || $_GET.amort == 1}}
|
{{if $_GET.amort == null}}
|
||||||
{{:assign amort="amort"}}
|
{{:assign amort="amort"}}
|
||||||
{{elseif $_GET.amort == 2}}
|
|
||||||
{{:assign amort="fini"}}
|
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign amort="no_amort"}}
|
{{:assign amort=$_GET.amort}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:include file="_nav.html" current="index" subcurrent="%s"|args:$amort}}
|
{{:include file="_nav.html" current="index" subcurrent="%s"|args:$amort}}
|
||||||
@ -37,11 +35,10 @@
|
|||||||
{{/select}}
|
{{/select}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{if $amort == "amort"}}
|
{{if $amort == "no_amort"}}
|
||||||
{{:include file="./immobilisations.html"}}
|
|
||||||
{{elseif $amort == "fini"}}
|
|
||||||
{{:include file="./immobilisations_achevees.html"}}
|
|
||||||
{{else}}
|
|
||||||
{{:include file="./immobilisations_non.html"}}
|
{{:include file="./immobilisations_non.html"}}
|
||||||
|
{{else}}
|
||||||
|
{{:include file="./immobilisations.html"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name="Amortissements"
|
name="Amortissements"
|
||||||
description="Gestion des amortissements pour le logiciel de comptabilité Paheko (v0.11)"
|
description="Gestion des amortissements pour le logiciel de comptabilité Paheko (v0.12)"
|
||||||
author="Jean-Christophe Engel"
|
author="Jean-Christophe Engel"
|
||||||
author_url="https://git.roflcopter.fr/lesanges"
|
author_url="https://git.roflcopter.fr/lesanges"
|
||||||
home_button=false
|
home_button=false
|
||||||
|
Loading…
Reference in New Issue
Block a user