Compare commits
No commits in common. "main" and "extension" have entirely different histories.
@ -1,7 +1,5 @@
|
|||||||
# Module de gestion d'amortissements pour Paheko
|
# Module de gestion d'amortissements pour Paheko
|
||||||
|
|
||||||
## Ce dépôt n'est plus mis à jour ; nouvel emplacement https://gitea.zaclys.com/lesanges/amortization
|
|
||||||
|
|
||||||
Ce module permet de gérer les écritures d'amortissements pour les immobilisations :
|
Ce module permet de gérer les écritures d'amortissements pour les immobilisations :
|
||||||
|
|
||||||
- lister les immobilisations
|
- lister les immobilisations
|
||||||
|
@ -9,4 +9,9 @@
|
|||||||
|
|
||||||
{{:assign ts_debut=$date_debut|strtotime}}
|
{{:assign ts_debut=$date_debut|strtotime}}
|
||||||
{{:assign ts_fin=$date_fin|strtotime}}
|
{{:assign ts_fin=$date_fin|strtotime}}
|
||||||
{{:assign nbjours="1+abs(%d-%d)/(60*60*24)"|math:$ts_fin:$ts_debut}}
|
|
||||||
|
{{if $ts_debut <= $ts_fin}}
|
||||||
|
{{:assign nbjours="1+(%d-%d)/(60*60*24)"|math:$ts_fin:$ts_debut}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign nbjours="1+(%d-%d)/(60*60*24)"|math:$ts_debut:$ts_fin}}
|
||||||
|
{{/if}}
|
||||||
|
@ -12,22 +12,18 @@
|
|||||||
<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>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{if $current == 'index' && $subsubcurrent != 'balance_exit'}}
|
{{if $current == 'index'}}
|
||||||
<ul class="sub">
|
<ul class="sub">
|
||||||
<li {{if $subcurrent == 'encours'}}class="current"{{/if}}><a href="index.html?amort=encours">En cours</a></li>
|
<li {{if $subcurrent == 'encours'}}class="current"{{/if}}><a href="index.html?amort=encours">En cours</a></li>
|
||||||
<li {{if $subcurrent == 'fini'}}class="current"{{/if}}><a href="index.html?amort=fini">Terminées</a></li>
|
<li {{if $subcurrent == 'fini'}}class="current"{{/if}}><a href="index.html?amort=fini">Terminées</a></li>
|
||||||
<li {{if $subcurrent == 'archive'}}class="current"{{/if}}><a href="index.html?amort=archive">Archivées</a></li>
|
<li {{if $subcurrent == 'archive'}}class="current"{{/if}}><a href="index.html?amort=archive">Archivées</a></li>
|
||||||
<li {{if $subcurrent == 'autres'}}class="current"{{/if}}><a href="index.html?amort=autres">Autres</a></li>
|
<li {{if $subcurrent == 'autres'}}class="current"{{/if}}><a href="index.html?amort=autres">Autres</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{if $subsubcurrent == 'amortization'}}
|
{{if $subsubcurrent == 'amortization'}}
|
||||||
<ul class="sub">
|
<ul class="sub">
|
||||||
<li class="title"><strong>Amortissements</strong></li>
|
<li class="title"><strong>Amortissements</strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
{{elseif $subsubcurrent == 'balance_exit'}}
|
{{/if}}
|
||||||
<ul class="sub">
|
|
||||||
<li class="title"><strong>Sortie du bilan</strong></li>
|
|
||||||
</ul>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -4,40 +4,29 @@
|
|||||||
{{:assign config_defaut=$config_json|json_decode}}
|
{{:assign config_defaut=$config_json|json_decode}}
|
||||||
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
||||||
|
|
||||||
{{#years closed=false order="start_date" assign=years.}}
|
|
||||||
{{:assign ts_debut=$start_date|strtotime}}
|
|
||||||
{{:assign ts_fin=$end_date|strtotime}}
|
|
||||||
{{:assign debut=$start_date|date_short}}
|
|
||||||
{{:assign fin=$end_date|date_short}}
|
|
||||||
{{:assign var="years_data.%d"|args:$id value=$ts_debut|cat:" "|cat:$ts_fin}}
|
|
||||||
{{:assign var="open_years.%d"|args:$id value=$label|cat:" (du "|cat:$debut|cat:" au "|cat:$fin|cat:")"}}
|
|
||||||
{{if $ts_debut <= $now && $now <= $ts_fin}}
|
|
||||||
{{:assign selected_year=$id}}
|
|
||||||
{{/if}}
|
|
||||||
{{/years}}
|
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="add"}}
|
{{#form on="add"}}
|
||||||
{{* vérifier que la date d'achat est située dans un l'exercice sélectionné *}}
|
|
||||||
{{:assign ts_date = $_POST.date_achat|parse_date|strtotime}}
|
{{* vérifier que la date est située dans un exercice ouvert *}}
|
||||||
{{:assign ok=false}}
|
{{:include
|
||||||
{{#foreach from=$years}}
|
file="_check_date.html"
|
||||||
{{if $id == $_POST.id_year}}
|
date=$_POST.date_achat
|
||||||
{{:assign selected_chart=$id_chart}}
|
keep="open_years, selected_year, selected_chart"
|
||||||
{{if $start_date|strtotime <= $ts_date && $ts_date <= $end_date|strtotime}}
|
}}
|
||||||
{{:assign ok=true}}
|
{{if $selected_year == null}}
|
||||||
{{:break}}
|
{{:assign msg_years=""}}
|
||||||
{{/if}}
|
{{#foreach from=$open_years}}
|
||||||
{{/if}}
|
{{:assign debut=$start_date|date_short}}
|
||||||
|
{{:assign fin=$end_date|date_short}}
|
||||||
|
{{:assign msg_years=$msg_years|cat:"\n"|cat:" - "|cat:$label|cat:" : "|cat:$debut|cat:" à "|cat:$fin}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{if ! $ok}}
|
{{:error message="La date choisie n'est dans aucun exercice ouvert !!\nExercices ouverts : %s"|args:$msg_years}}
|
||||||
{{:error message="La date saisie n'est pas dans l'exercice choisi !"}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if ! $_POST.amortir}}
|
{{if $_POST.no_amort}}
|
||||||
{{* ne pas amortir *}}
|
{{* ne pas amortir *}}
|
||||||
{{:assign duration=0}}
|
{{:assign duration=0}}
|
||||||
{{:assign date_debut=$_POST.date_achat|parse_date}}
|
{{:assign date_debut=$ligne_immo.date_achat|parse_date}}
|
||||||
{{:assign status="ignored"}}
|
{{:assign status="ignored"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{* vérifier que la date d'acquisition est antérieure à la date de mise en service *}}
|
{{* vérifier que la date d'acquisition est antérieure à la date de mise en service *}}
|
||||||
@ -88,7 +77,7 @@
|
|||||||
method="POST"
|
method="POST"
|
||||||
path="accounting/transaction"
|
path="accounting/transaction"
|
||||||
assign="result"
|
assign="result"
|
||||||
id_year=$_POST.id_year
|
id_year=$selected_year
|
||||||
type="revenue"
|
type="revenue"
|
||||||
date=$_POST.date_achat
|
date=$_POST.date_achat
|
||||||
label=$_POST.designation
|
label=$_POST.designation
|
||||||
@ -116,10 +105,10 @@
|
|||||||
date=$date_debut
|
date=$date_debut
|
||||||
status=$status
|
status=$status
|
||||||
}}
|
}}
|
||||||
{{if $_POST.amortir}}
|
{{if $_POST.no_amort}}
|
||||||
{{:assign amort="encours"}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign amort="autres"}}
|
{{:assign amort="autres"}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign amort="encours"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:redirect force="index.html?ok=1&msg=immobilisation&amort=%s"|args:$amort}}
|
{{:redirect force="index.html?ok=1&msg=immobilisation&amort=%s"|args:$amort}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
@ -133,6 +122,17 @@
|
|||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
|
|
||||||
{{* formulaire d'ajout d'immobilisation *}}
|
{{* formulaire d'ajout d'immobilisation *}}
|
||||||
|
{{#years closed=false order="start_date"}}
|
||||||
|
{{:assign ts_debut=$start_date|strtotime}}
|
||||||
|
{{:assign ts_fin=$end_date|strtotime}}
|
||||||
|
{{:assign debut=$start_date|date_short}}
|
||||||
|
{{:assign fin=$end_date|date_short}}
|
||||||
|
{{:assign var="years_data.%d"|args:$id value=$ts_debut|cat:" "|cat:$ts_fin}}
|
||||||
|
{{:assign var="open_years.%d"|args:$id value=$label|cat:" (du "|cat:$debut|cat:" au "|cat:$fin|cat:")"}}
|
||||||
|
{{if $ts_debut <= $now && $now <= $ts_fin}}
|
||||||
|
{{:assign selected_year=$id}}
|
||||||
|
{{/if}}
|
||||||
|
{{/years}}
|
||||||
|
|
||||||
{{:assign var="immo_account.2" value="2 — Classe 2 — Comptes d'immobilisations"}}
|
{{:assign var="immo_account.2" value="2 — Classe 2 — Comptes d'immobilisations"}}
|
||||||
|
|
||||||
@ -146,17 +146,20 @@
|
|||||||
{{:assign patterns=$pattern_array|implode:"|"}}
|
{{:assign patterns=$pattern_array|implode:"|"}}
|
||||||
|
|
||||||
<div id="erreur" class="hidden">
|
<div id="erreur" class="hidden">
|
||||||
<p class="block error">La date choisie n'est dans aucun exercice ouvert !</p>
|
<p class="block error">La date choisie n'est dans aucun exercice ouvert</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Données de l'immobilisation</legend>
|
<legend>Ajouter une immobilisation</legend>
|
||||||
<dl>
|
<dl>
|
||||||
{{:input type="select" name="id_year" label="Exercice" required=true default_empty="— Faire un choix —" options=$open_years}}
|
{{:input id="no_amort" type="checkbox" value=1 name="no_amort" label="Ne pas amortir" help="Cocher pour ne pas amortir" onclick="toggleInputs('f_no_amort_1', ['f_date_mes','f_duree'])"}}
|
||||||
{{:input type="date" name="date_achat" label="Date d'acquisition" required=true default=$now|date_short}}
|
{{:input type="date" name="date_achat" label="Date d'acquisition" required=true default=$now|date_short}}
|
||||||
|
{{:input type="select" default=$selected_year name="id_year" label="Exercice" required=true default_empty="— Faire un choix —" options=$open_years}}
|
||||||
|
{{:input type="date" name="date_mes" label="Date de mise en service" help="à renseigner uniquement si différente de la date d'acquisition"}}
|
||||||
{{:input type="text" name="designation" label="Désignation" required=true}}
|
{{:input type="text" name="designation" label="Désignation" required=true}}
|
||||||
{{:input type="money" name="montant" label="Montant" required=true}}
|
{{:input type="money" name="montant" label="Montant" required=true}}
|
||||||
|
{{:input type="number" name="duree" label="Durée d'amortissement" required=true min=0 default=1 suffix="année(s)"}}
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="credit_account"
|
name="credit_account"
|
||||||
@ -180,16 +183,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
|
||||||
<legend>Amortissement</legend>
|
|
||||||
<dl>
|
|
||||||
{{:input id="amortir" type="checkbox" value=1 name="amortir" label="Amortir cette immobilisation sur plusieurs années" checked="cheched" help="Dé-cocher pour ne pas amortir"}}
|
|
||||||
<div id="div_amort">
|
|
||||||
{{:input type="date" name="date_mes" label="Date de mise en service" help="C'est la date de première utilisation ; à renseigner uniquement si différente de la date d'acquisition"}}
|
|
||||||
{{:input type="number" name="duree" label="Durée d'amortissement" required=true min=0 default=1 suffix="année(s)"}}
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
{{:button type="submit" name="add" label="Ajouter" shape="right" class="main"}}
|
{{:button type="submit" name="add" label="Ajouter" shape="right" class="main"}}
|
||||||
@ -201,16 +194,13 @@
|
|||||||
<script type="text/javascript" src="scripts.js"></script>
|
<script type="text/javascript" src="scripts.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function changeYear(evt, f_accounts = ['credit_account', 'debit_account'], f_years_select = 'f_id_year') {
|
function setYears(evt, id_date = 'f_date_achat', id_exercices = 'f_id_year', id_years = 'f_years_data') {
|
||||||
setSelectorYear(f_accounts, f_years_select);
|
chooseYears(id_date, id_exercices, id_years);
|
||||||
}
|
|
||||||
|
|
||||||
function changeVisibility(evt, idcheck = 'f_amortir_1', fields = ['div_amort']) {
|
|
||||||
toggleVisibility(idcheck, fields);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
document.getElementById('f_id_year').onchange = changeYear;
|
chooseYears('f_date_achat', 'f_id_year', 'f_years_data');
|
||||||
document.getElementById('f_amortir_1').onclick = changeVisibility;
|
let date_field = document.getElementById('f_date_achat');
|
||||||
|
date_field.onchange = setYears;
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
<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>
|
||||||
@ -27,7 +26,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,
|
||||||
@ -50,7 +49,6 @@
|
|||||||
}}
|
}}
|
||||||
{{: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>
|
||||||
@ -65,7 +63,4 @@
|
|||||||
{{/select}}
|
{{/select}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{if $nb_immo == 0}}
|
|
||||||
<p class="block alert">Aucune immobilisation</p>
|
|
||||||
{{/if}}
|
|
||||||
</section>
|
</section>
|
||||||
|
@ -2,219 +2,246 @@
|
|||||||
|
|
||||||
{{*
|
{{*
|
||||||
Sortir une immobilisation du bilan
|
Sortir une immobilisation du bilan
|
||||||
@param immo_id : id de la ligne d'immobilisation
|
@param :
|
||||||
|
- immo_id : numéro de ligne de l'immo
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* Infos de l'immobilisation *}}
|
{{* récupérer les infos de l'immobilisation *}}
|
||||||
{{#select
|
{{#select
|
||||||
|
line.id as line_id,
|
||||||
line.debit as montant,
|
line.debit as montant,
|
||||||
trans.date as date_achat,
|
line.id_project as project_id,
|
||||||
trans.label
|
trans.id as trans_id,
|
||||||
|
trans.date as trans_date,
|
||||||
|
trans.label as trans_label,
|
||||||
|
acc.id as account_id,
|
||||||
|
y.id as year_id
|
||||||
FROM acc_transactions_lines AS line
|
FROM acc_transactions_lines AS line
|
||||||
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
||||||
|
INNER JOIN acc_accounts as acc ON line.id_account = acc.id
|
||||||
|
INNER JOIN acc_years AS y ON trans.id_year = y.id
|
||||||
WHERE line.id = :line_id;
|
WHERE line.id = :line_id;
|
||||||
:line_id = $_GET.immo_id|intval
|
:line_id = $_GET.immo_id|intval
|
||||||
assign="ligne_immo"
|
assign=ligne_immo
|
||||||
}}
|
}}
|
||||||
{{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}}
|
||||||
|
|
||||||
{{:assign date_debut=$ligne_immo.date_achat}}
|
|
||||||
{{:assign ts_mes=$ligne_immo.date_achat|strtotime}}
|
|
||||||
|
|
||||||
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
||||||
{{:assign ts_mes=$date|strtotime}}
|
|
||||||
{{:assign date_debut=$date}}
|
|
||||||
{{:assign duree_amort=$duration}}
|
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{* chercher des écritures d'amortissement liées à l'immobilisation *}}
|
{{* voir s'il existe des écritures d'amortissement associées *}}
|
||||||
{{#select
|
{{#select
|
||||||
SUM(l_amort.credit) as amort_amount,
|
sum(l_amort.credit) as amort_amount,
|
||||||
CASE
|
CASE
|
||||||
WHEN links.id_related = t_immo.id
|
WHEN links.id_related = t_immo.id THEN links.id_transaction
|
||||||
THEN links.id_transaction
|
|
||||||
ELSE links.id_related
|
ELSE links.id_related
|
||||||
END as amort_trans_id,
|
END as amort_trans_id
|
||||||
MAX(trans.date) as last_amort_date,
|
|
||||||
MIN(trans.date) as first_amort_date,
|
|
||||||
COUNT(trans.id) as amort_number
|
|
||||||
FROM acc_transactions_lines as l_immo
|
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 as t_immo on t_immo.id = l_immo.id_transaction
|
||||||
INNER JOIN acc_transactions_links as links
|
INNER JOIN acc_transactions_links as links
|
||||||
ON (t_immo.id = links.id_transaction
|
ON (
|
||||||
|
t_immo.id = links.id_transaction
|
||||||
OR
|
OR
|
||||||
t_immo.id = links.id_related)
|
t_immo.id = links.id_related
|
||||||
|
)
|
||||||
INNER JOIN acc_transactions_lines as l_amort on amort_trans_id = l_amort.id_transaction
|
INNER JOIN acc_transactions_lines as l_amort on amort_trans_id = l_amort.id_transaction
|
||||||
INNER join acc_transactions as trans on l_amort.id_transaction = trans.id
|
|
||||||
INNER JOIN acc_accounts AS account ON l_amort.id_account = account.id
|
INNER JOIN acc_accounts AS account ON l_amort.id_account = account.id
|
||||||
WHERE l_immo.id = :line_id AND account.code LIKE '28%'
|
WHERE
|
||||||
LIMIT 1;
|
l_immo.id = :line_id
|
||||||
|
AND
|
||||||
|
l_amort.credit <> 0
|
||||||
|
AND
|
||||||
|
account.code LIKE '28%';
|
||||||
:line_id = $_GET.immo_id|intval
|
:line_id = $_GET.immo_id|intval
|
||||||
assign=amort_line
|
|
||||||
}}
|
}}
|
||||||
{{/select}}
|
{{if $amort_amount == null}}
|
||||||
|
|
||||||
{{if $amort_line.amort_number == 0}}
|
|
||||||
{{:assign amort_amount=0}}
|
{{:assign amort_amount=0}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign amort_amount=$amort_line.amort_amount}}
|
{{:assign amort_amount=$amort_amount}}
|
||||||
{{:assign date_debut=$amort_line.last_amort_date|strtotime}}
|
|
||||||
{{:assign date_debut="%d+(60*60*24)"|math:$date_debut|date:"Y-m-d"}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:assign ts_debut=$date_debut|strtotime}}
|
{{/select}}
|
||||||
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.montant:$amort_amount}}
|
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.montant:$amort_amount}}
|
||||||
|
|
||||||
{{*
|
|
||||||
lister les exercices qui englobent la date de début du prochain amortissement
|
|
||||||
*}}
|
|
||||||
{{:assign default_exit_date=""}}
|
|
||||||
{{#years closed=false order="start_date" where="start_date <= :debut AND :debut <= end_date"
|
|
||||||
:debut=$date_debut assign=years.}}
|
|
||||||
{{if $start_date|strtotime <= $now && $now <= $end_date|strtotime}}
|
|
||||||
{{:assign default_exit_date=$now|date_short}}
|
|
||||||
{{/if}}
|
|
||||||
{{:assign ts_fin=$end_date|strtotime}}
|
|
||||||
{{:assign debut=$start_date|date_short}}
|
|
||||||
{{:assign fin=$end_date|date_short}}
|
|
||||||
{{:assign var="open_years.%d"|args:$id value=$label|cat:" (du "|cat:$debut|cat:" au "|cat:$fin|cat:")"}}
|
|
||||||
{{:assign var="years_data.%d"|args:$id value=$ts_debut|cat:" "|cat:$ts_fin}}
|
|
||||||
{{else}}
|
|
||||||
{{:error message="Aucun exercice ouvert pour enregistrer un amortissement"}}
|
|
||||||
{{/years}}
|
|
||||||
{{if $years|count == 1}}
|
|
||||||
{{:assign default_year=$years.0.id}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign default_year=""}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="proceed"}}
|
{{#form on="proceed"}}
|
||||||
|
|
||||||
{{if $_POST.date_sortie == null}}
|
{{*
|
||||||
{{:error message="Vous devez renseigner la date de sortie"}}
|
vérifier que la date de sortie est située après la date de mise en
|
||||||
{{/if}}
|
service ou à défaut de la date d'acquisition de l'immobilisation
|
||||||
|
*}}
|
||||||
{{* vérifier la validité de la date de mise en service *}}
|
|
||||||
{{if $_POST.date_mes != null}}
|
|
||||||
{{:assign ts_mes=$_POST.date_mes|parse_date|strtotime}}
|
|
||||||
{{if $ts_mes < $ligne_immo.date_achat|strtotime || $ts_mes > $amort_line.first_amort_date|strtotime}}
|
|
||||||
{{:assign immo_date=$ligne_immo.date_achat|date_short}}
|
|
||||||
{{:assign amort_date=$amort_line.first_amort_date|date_short}}
|
|
||||||
{{:error message="La date de mise en service doit être postérieure à la date d'acquisition de l'immobilisation (%s) et antérieure à la date du premier amortissement (%s)"|args:$immo_date:$amort_date}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* vérifier la validité de la durée d'immobilisation *}}
|
|
||||||
{{if $valeur_nette > 0}}
|
|
||||||
{{if $info_immo.duration == null}}
|
|
||||||
{{if $_POST.duree == null}}
|
|
||||||
{{:error message="Vous devez renseigner la durée de l'immobilisation"}}
|
|
||||||
{{elseif $_POST.duree < $amort_line.amort_number}}
|
|
||||||
{{:error message="La durée de l'amortissement ne peut être inférieure au nombre d'écritures d'amortissement (%d)"|args:$amort_line.amort_number}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign duree_amort=$_POST.duree}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* vérifier la validité de la date de sortie *}}
|
|
||||||
{{if $info_immo.date != null}}
|
{{if $info_immo.date != null}}
|
||||||
{{if $_POST.date_sortie|parse_date < $info_immo.date}}
|
{{if $_POST.date_sortie|parse_date < $info_immo.date}}
|
||||||
{{:assign immo_date=$info_immo.date|date_short}}
|
{{:assign immo_date=$info_immo.date|date_short}}
|
||||||
{{:error message="La date de sortie doit être postérieure à la date de mise en service de l'immobilisation (%s)"|args:$immo_date}}
|
{{:error message="La date choisie doit être postérieure à la date de mise en service de l'immobilisation (%s)"|args:$immo_date}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{elseif $_POST.date_mes != null}}
|
{{else}}
|
||||||
{{if $_POST.date_sortie|parse_date < $_POST.date_mes|parse_date}}
|
{{if $_POST.date_sortie|parse_date < $ligne_immo.trans_date}}
|
||||||
{{:error message="La date de sortie doit être postérieure à la date de mise en service de l'immobilisation (%s)"|args:$_POST.date_mes}}
|
{{:assign immo_date=$ligne_immo.trans_date|date_short}}
|
||||||
|
{{:error message="La date choisie doit être postérieure à la date d'acquisition de l'immobilisation (%s)"|args:$immo_date}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{elseif $_POST.date_sortie|parse_date < $ligne_immo.date_achat}}
|
|
||||||
{{:assign immo_date=$ligne_immo.date_achat|date_short}}
|
|
||||||
{{:error message="La date de sortie doit être postérieure à la date d'acquisition de l'immobilisation (%s)"|args:$immo_date}}
|
|
||||||
{{/if}}
|
|
||||||
{{if $amort_line.amort_number != 0 && $_POST.date_sortie|parse_date <= $amort_line.last_amort_date}}
|
|
||||||
{{:assign last_amort_date=$amort_line.last_amort_date|date_short}}
|
|
||||||
{{:error message="La date de sortie doit être postérieure à la date de la dernière immobilisation (%s)"|args:$last_amort_date}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* vérifier que la date de sortie est située dans un exercice ouvert *}}
|
{{* vérifier que la date est située dans un exercice ouvert *}}
|
||||||
{{:assign ts_exit = $_POST.date_sortie|parse_date|strtotime}}
|
{{:include
|
||||||
{{:assign ok=false}}
|
file="_check_date.html"
|
||||||
{{#foreach from=$years}}
|
date=$_POST.date_sortie
|
||||||
{{if $id == $_POST.id_year}}
|
keep="open_years, selected_year, selected_chart"
|
||||||
{{:assign selected_year=$id}}
|
}}
|
||||||
{{if $start_date|strtotime <= $ts_exit && $ts_exit <= $end_date|strtotime}}
|
{{if $selected_year == null}}
|
||||||
{{:assign ok=true}}
|
{{:assign msg_years=""}}
|
||||||
{{:break}}
|
{{#foreach from=$open_years}}
|
||||||
{{/if}}
|
{{:assign debut=$start_date|date_short}}
|
||||||
{{/if}}
|
{{:assign fin=$end_date|date_short}}
|
||||||
|
{{:assign msg_years=$msg_years|cat:"\n"|cat:" - "|cat:$label|cat:" : "|cat:$debut|cat:" à "|cat:$fin}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{if ! $ok}}
|
{{:error message="La date choisie n'est dans aucun exercice ouvert !!\nExercices ouverts : %s"|args:$msg_years}}
|
||||||
{{:error message="La date choisie n'est pas dans l'exercice sélectionné !"}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:redirect to="compute_exit_data.html?immo_id=%s&amort_amount=%s&year=%s&date_mes=%s&date_debut=%s&exit_date=%s&duree_amort=%s"|args:$_GET.immo_id:$amort_amount:$selected_year:$ts_mes:$ts_debut:$ts_exit:$duree_amort}}
|
{{if $valeur_nette > 0}}
|
||||||
|
{{if $info_immo.duration == null}}
|
||||||
|
{{if $_POST.duree == null}}
|
||||||
|
{{:error message="Vous devez renseigner la durée de l'amortissement"}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign var=info_immo.duration value=$_POST.duree}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{* Cession de l'immobilisation
|
||||||
|
{{if $_POST.cession}}
|
||||||
|
{{if $_POST.montant_cession == ""}}
|
||||||
|
{{:error message="Le montant de la cession doit être renseigné"}}
|
||||||
|
{{/if}}
|
||||||
|
{{if $_POST.montant_cession <= 0}}
|
||||||
|
{{:error message="Le montant de la cession doit être strictement positif"}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
*}}
|
||||||
|
{{:redirect to="compute_exit_data.html?immo_id=%s&amort_amount=%s&year=%s&exit_date=%s&duree_amort=%s"|args:$_GET.immo_id:$amort_amount:$selected_year:$_POST.date_sortie:$_POST.duree}}
|
||||||
|
{{*
|
||||||
|
{{:redirect to="write_exit.html?immo_id=%s&amort_amount=%s&year=%s&exit_date=%s&cession=%s&duree_amort=%s"|args:$_GET.immo_id:$amort_amount:$selected_year:$_POST.date_sortie:$_POST.montant_cession:$_POST.duree}}
|
||||||
|
*}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:admin_header title="Sortie de bilan" custom_css="./style.css" current="module_amortissement"}}
|
{{:admin_header title="Sortie de bilan" custom_css="./style.css" current="module_amortissement"}}
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{if ! $dialog}}
|
{{if ! $dialog}}
|
||||||
{{:include file="_nav.html" current="index" subsubcurrent="balance_exit"}}
|
{{:include file="_nav.html" current="index"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
|
|
||||||
|
{{*:debug ligne_immo=$ligne_immo amort_amount=$amort_amount*}}
|
||||||
|
|
||||||
{{* formulaire de sortie du bilan *}}
|
{{* formulaire de sortie du bilan *}}
|
||||||
<h3>Sortir l'immobilisation « {{$ligne_immo.label}} » du bilan</h3>
|
<h3>Sortir l'immobilisation « {{$ligne_immo.trans_label}} » du bilan</h3>
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
|
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<legend>Données de l'imobilisation</legend>
|
<legend>Données de l'imobilisation</legend>
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Montant</dt>
|
<dt><label>Montant</label></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:false}}</dd>
|
||||||
<dt>Date d'acquisition</dt>
|
<dt><label>Date d'acquisition</label></dt>
|
||||||
<dd >{{$ligne_immo.date_achat|date_short}}</dd>
|
<dd >{{$ligne_immo.trans_date|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.trans_date}}
|
||||||
<dt>Date de mise en service</dt>
|
<dt><label>Date de mise en service</label></dt>
|
||||||
<dd>{{$info_immo.date|date_short}}</dd>
|
<dd>{{$info_immo.date|date_short}}</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $info_immo.duration != null}}
|
{{if $info_immo.duration != null}}
|
||||||
<dt>Durée de l'amortissement</dt>
|
<dt>Durée de l'amortissement</dt>
|
||||||
<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><label>Montant des amortissements</label></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:false}} <span class="help">(à la date de début de l'exercice)</span></dd>
|
||||||
<dt>Valeur nette résiduelle</dt>
|
<dt><label>Valeur nette résiduelle</label></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:false}} <span class="help">(à la date de début de l'exercice)</span></dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
{{if $valeur_nette > 0}}
|
|
||||||
{{if $info_immo.date == null || $info_immo.duration == null}}
|
|
||||||
<fieldset>
|
|
||||||
<legend>Informations sur l'immobilisation</legend>
|
|
||||||
<dl>
|
|
||||||
{{if $info_immo.date == null}}
|
|
||||||
{{:input type="date" name="date_mes" label="Date de mise en service" help="C'est la date de première utilisation ; à renseigner uniquement si différente de la date d'acquisition"}}
|
|
||||||
{{/if}}
|
|
||||||
{{if $info_immo.duration == null}}
|
|
||||||
{{:input type="number" name="duree" label="Durée d'amortissement" required=true min=1 help="La durée est nécessaire pour calculer l'amortissement complémentaire"}}
|
|
||||||
{{/if}}
|
|
||||||
</dl>
|
|
||||||
</fieldset>
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Informations de sortie</legend>
|
<legend>Informations de sortie</legend>
|
||||||
<dl>
|
<dl>
|
||||||
{{:input type="select" default=$default_year name="id_year" label="Exercice" required=true default_empty="— Faire un choix —" options=$open_years}}
|
{{:input type="date" name="date_sortie" label="Date de sortie du bilan" required=true default=$now|date_short}}
|
||||||
{{:input type="date" name="date_sortie" label="Date de sortie du bilan" required=true default=$default_exit_date}}
|
{{if $info_immo.date == null && $valeur_nette > 0}}
|
||||||
|
{{:input type="date" name="date_mes" label="Date de mise en service" help="à renseigner uniquement si différente de la date d'acquisition"}}
|
||||||
|
{{/if}}
|
||||||
|
{{if $info_immo.duration == null && $valeur_nette > 0}}
|
||||||
|
{{:input type="number" name="duree" label="Durée d'amortissement" required=true min=1 onchange="computeAmort()" help="La durée est nécessaire pour calculer l'amortissement résiduel"}}
|
||||||
|
{{/if}}
|
||||||
|
{{*
|
||||||
|
{{:input type="checkbox" value=1 name="cession" label="Cession" help="Cocher si la sortie est due à une cession" onclick="toggleHiddenAndFocus('f_cession_1', ['infos_cession'], 'f_montant_cession')"}}
|
||||||
|
<div id="infos_cession" class="hidden">
|
||||||
|
{{:input type="money" name="montant_cession" label="Montant de la cession" required=true}}
|
||||||
|
</div>
|
||||||
|
*}}
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
{{:button type="submit" name="proceed" label="Poursuivre" shape="right" class="main"}}
|
{{:button type="submit" name="proceed" label="Poursuivre" shape="right" class="main"}}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
/*
|
||||||
|
- activer/désactiver les champs passés en paramètres
|
||||||
|
- donner le focus au champ de saisie du montant
|
||||||
|
*/
|
||||||
|
function toggleHiddenAndFocus(idcb, idfields, idinput) {
|
||||||
|
const cession = document.getElementById(idcb);
|
||||||
|
for (let id of idfields) {
|
||||||
|
const field = document.getElementById(id);
|
||||||
|
if (cession.checked) {
|
||||||
|
field.setAttribute("class", "");
|
||||||
|
document.getElementById(idinput).focus();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
field.setAttribute("class","hidden")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDate(name) {
|
||||||
|
const elem = document.getElementsByName(name)[0].value;
|
||||||
|
const jma = elem.split('/');
|
||||||
|
const dd = new Date(jma[2], jma[1]-1, jma[0]);
|
||||||
|
return dd;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNumber(text) {
|
||||||
|
return num = Number(text.replace(/ /g, '').replace(/,/, '.').replace(/€/, ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
function computeAmort() {
|
||||||
|
const exitDate = getDate('date_sortie');
|
||||||
|
// console.log('exit = ' + exitDate);
|
||||||
|
const year = exitDate.getFullYear();
|
||||||
|
const yearStart = new Date(year, 0);
|
||||||
|
const oneDay = 24 * 60 * 60 * 1000;
|
||||||
|
const nbDays = Math.round((exitDate - yearStart) / oneDay);
|
||||||
|
console.log("nb jours = " + nbDays);
|
||||||
|
const montantImmo = getNumber(document.getElementById('montant_immo').innerText);
|
||||||
|
// console.log('montant_immo= ' + montantImmo);
|
||||||
|
// durée d'amortissement
|
||||||
|
let elem = document.getElementById('duree_amort');
|
||||||
|
let duree_amort;
|
||||||
|
if (elem == null) {
|
||||||
|
duree_amort = document.getElementById('f_duree').value;
|
||||||
|
} else {
|
||||||
|
duree_amort = Number(elem.innerText.replace(/ .*/, ''));
|
||||||
|
}
|
||||||
|
const annuite = montantImmo / duree_amort;
|
||||||
|
const amort_comp = annuite / 365 * nbDays;
|
||||||
|
console.log("durée amort = " + duree_amort + ", annuité=" + annuite + ", amort comp = " + amort_comp);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
(function () {
|
||||||
|
toggleHiddenAndFocus('f_cession_1', ['infos_cession'], 'f_montant_cession');
|
||||||
|
})();
|
||||||
|
*/
|
||||||
|
</script>
|
||||||
|
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
@ -1,133 +0,0 @@
|
|||||||
{{* -*- brindille -*- *}}
|
|
||||||
|
|
||||||
{{*
|
|
||||||
Calculer les valeurs de la sortie et saisir le montant de la cession (optionnel)
|
|
||||||
paramètres :
|
|
||||||
- immo_id : numéro de ligne de l'écriture d'immobilisation
|
|
||||||
- amort_amount : montant des amortissements
|
|
||||||
- year : exercice de la date de sortie de l'immobilisation
|
|
||||||
- date_mes : datede mise en service de l'immobilisation
|
|
||||||
- date_debut : date de début de la période d'amortissement complémentaire
|
|
||||||
- exit_date : date de sortie de l'immobilisation
|
|
||||||
- duree_amort : durée de l'amortiseement (optionnel)
|
|
||||||
*}}
|
|
||||||
|
|
||||||
{{#select
|
|
||||||
line.debit as montant,
|
|
||||||
trans.date as date_achat,
|
|
||||||
trans.label
|
|
||||||
FROM acc_transactions_lines AS line
|
|
||||||
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
|
||||||
WHERE line.id = :line_id;
|
|
||||||
:line_id = $_GET.immo_id|intval
|
|
||||||
assign="ligne_immo"
|
|
||||||
}}
|
|
||||||
{{else}}
|
|
||||||
{{:error message="Immobilisation %s non trouvée"|args:$_GET.immo_id}}
|
|
||||||
{{/select}}
|
|
||||||
|
|
||||||
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.montant:$_GET.amort_amount}}
|
|
||||||
{{:assign amort_comp=0}} {{* amortissement complémentaire jqà date sortie *}}
|
|
||||||
{{if $valeur_nette > 0}}
|
|
||||||
{{:assign nbjours="1+(%d-%d)/(60*60*24)"|math:$_GET.exit_date:$_GET.date_debut}}
|
|
||||||
{{:assign annuite="%f/%f"|math:$ligne_immo.montant:$_GET.duree_amort}}
|
|
||||||
{{:assign amort_comp="round(%f/365*%f, 0)"|math:$annuite:$nbjours}}
|
|
||||||
{{:assign amort_comp="min(%f, %f)"|math:$valeur_nette:$amort_comp}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
|
||||||
{{#form on="proceed"}}
|
|
||||||
{{:debug post=$_POST}}
|
|
||||||
{{if $_POST.cession != null}}
|
|
||||||
{{if $_POST.montant_cession == null}}
|
|
||||||
{{:error message="Vous devez saisir le montant de la cession"}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{:redirect to="write_exit.html?immo_id=%s&amort_amount=%s&year=%s&date_mes=%s&date_debut=%s&exit_date=%s&duree_amort=%s&cession=%s"|args:$_GET.immo_id:$_GET.amort_amount:$_GET.year:$_GET.date_mes:$_GET.date_debut:$_GET.exit_date:$_GET.duree_amort:$_POST.montant_cession}}
|
|
||||||
|
|
||||||
{{/form}}
|
|
||||||
{{:admin_header title="Sortie du bilan" custom_css="./style.css" current="module_amortissement"}}
|
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
|
||||||
{{if ! $dialog}}
|
|
||||||
{{:include file="_nav.html" current="index" subsubcurrent="balance_exit"}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{:form_errors}}
|
|
||||||
|
|
||||||
<h3>Sortir l'immobilisation « {{$ligne_immo.label}} » du bilan</h3>
|
|
||||||
<form method="post" action="">
|
|
||||||
|
|
||||||
<div class="informations">
|
|
||||||
<legend>Données de l'imobilisation</legend>
|
|
||||||
<dl class="describe">
|
|
||||||
<dt>Montant</dt>
|
|
||||||
<dd id="montant_immo" class="money">{{$ligne_immo.montant|money_currency:false}}</dd>
|
|
||||||
<dt>Date d'acquisition</dt>
|
|
||||||
<dd >{{$ligne_immo.date_achat|date_short}}</dd>
|
|
||||||
{{if $_GET.date_mes != $ligne_immo.date_achat|strtotime}}
|
|
||||||
<dt>Date de mise en service</dt>
|
|
||||||
<dd>{{$_GET.date_mes|date:"d/m/Y"}}</dd>
|
|
||||||
{{/if}}
|
|
||||||
{{if $_GET.duree_amort != null}}
|
|
||||||
<dt>Durée de l'amortissement</dt>
|
|
||||||
<dd id="duree_amort" class="num">{{$_GET.duree_amort}} ans</dd>
|
|
||||||
{{/if}}
|
|
||||||
<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>
|
|
||||||
<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>
|
|
||||||
<dt>Date de sortie</dt>
|
|
||||||
<dd>{{$_GET.exit_date|date:"d/m/Y"}}</dd>
|
|
||||||
{{if $amort_comp > 0}}
|
|
||||||
<dt>Amortissement complémentaire</dt>
|
|
||||||
<dd class="money">{{$amort_comp|money_currency:false}} <span class="help">(jusqu'à la date de sortie)</span></dd>
|
|
||||||
<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>
|
|
||||||
<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>
|
|
||||||
{{/if}}
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
<fieldset>
|
|
||||||
<legend>Informations de sortie</legend>
|
|
||||||
<dl>
|
|
||||||
{{:input type="checkbox" value=1 name="cession" label="Cession" help="Cocher si la sortie est due à une cession" onclick="toggleHiddenAndFocus('f_cession_1', ['infos_cession'], 'f_montant_cession')"}}
|
|
||||||
<div id="infos_cession" class="hidden">
|
|
||||||
{{:input type="money" name="montant_cession" label="Montant de la cession" required=true}}
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<p class="submit">
|
|
||||||
{{:button type="submit" name="proceed" label="Poursuivre" shape="right" class="main"}}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
/*
|
|
||||||
- activer/désactiver les champs passés en paramètres
|
|
||||||
- donner le focus au champ de saisie du montant
|
|
||||||
*/
|
|
||||||
function toggleHiddenAndFocus(idcb, idfields, idinput) {
|
|
||||||
const cession = document.getElementById(idcb);
|
|
||||||
for (let id of idfields) {
|
|
||||||
const field = document.getElementById(id);
|
|
||||||
if (cession.checked) {
|
|
||||||
field.setAttribute("class", "");
|
|
||||||
document.getElementById(idinput).focus();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
field.setAttribute("class","hidden")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(function () {
|
|
||||||
toggleHiddenAndFocus('f_cession_1', ['infos_cession'], 'f_montant_cession');
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{{:admin_footer}}
|
|
@ -8,7 +8,6 @@
|
|||||||
{{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>
|
||||||
@ -139,7 +138,6 @@
|
|||||||
}}
|
}}
|
||||||
{{: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>
|
||||||
@ -181,7 +179,4 @@
|
|||||||
{{/select}}
|
{{/select}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{if $nb_immo == 0}}
|
|
||||||
<p class="block alert">Aucune immobilisation</p>
|
|
||||||
{{/if}}
|
|
||||||
</section>
|
</section>
|
||||||
|
@ -20,13 +20,12 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
{{#load type="immo" where="$$.status = 'ignored'"}}
|
{{#load type="immo" where="$$.noamort = true"}}
|
||||||
{{: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,5 +1,5 @@
|
|||||||
name="Amortissements"
|
name="Amortissements"
|
||||||
description="Gestion des amortissements pour le logiciel de comptabilité Paheko (v0.16)"
|
description="Gestion des amortissements pour le logiciel de comptabilité Paheko (v0.14)"
|
||||||
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
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
Créer une écriture d'amortissement
|
créer une écriture d'amortissement
|
||||||
@param immo_id : id de la ligne d'immobilisation
|
paramètres
|
||||||
|
- immo_id : id de la ligne d'immobilisation
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* Infos de l'immobilisation *}}
|
{{* Infos de l'immobilisation *}}
|
||||||
@ -48,7 +49,6 @@
|
|||||||
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,8 +70,9 @@
|
|||||||
}}
|
}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{if $amort_line.amort_number == 0}}
|
{{if $amort_line.amort_amount == null}}
|
||||||
{{* 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}}
|
||||||
@ -84,6 +85,7 @@
|
|||||||
{{: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}}
|
||||||
@ -96,9 +98,8 @@
|
|||||||
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"
|
{{#years closed=false order="start_date" where="start_date <= :debut AND :debut <= end_date" :debut=$date_debut assign=years.}}
|
||||||
:debut=$date_debut assign=years.}}
|
{{if $premier_amort}}
|
||||||
{{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}}
|
||||||
@ -128,7 +129,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
|
||||||
@ -232,7 +233,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="">
|
||||||
|
72
scripts.js
72
scripts.js
@ -1,25 +1,13 @@
|
|||||||
// 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 elem = document.getElementById(idcb);
|
const noamort = document.getElementById(idcb);
|
||||||
for (let id of idfields) {
|
for (let id of idfields) {
|
||||||
const field = document.getElementById(id);
|
const field = document.getElementById(id);
|
||||||
if (elem.checked) {
|
if (noamort.checked) {
|
||||||
field.removeAttribute("disabled");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
field.setAttribute("disabled","disabled");
|
field.setAttribute("disabled","disabled");
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
}
|
field.removeAttribute("disabled");
|
||||||
|
|
||||||
function toggleVisibility(idcheck, fields) {
|
|
||||||
const elem = document.getElementById(idcheck);
|
|
||||||
for (let id of fields) {
|
|
||||||
const field = document.getElementById(id);
|
|
||||||
if (elem.checked) {
|
|
||||||
field.setAttribute('class', '');
|
|
||||||
} else {
|
|
||||||
field.setAttribute('class', 'hidden');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -49,7 +37,7 @@ function getDate(idelem) {
|
|||||||
return str2sec(document.getElementById(idelem).value);
|
return str2sec(document.getElementById(idelem).value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// (unused) désactiver les options du sélecteur qui ne sont pas dans un tableau de valeurs
|
// désactiver les options du sélecteur qui ne sont pas dans un tableau de valeurs
|
||||||
function disableOptions(idSelect, init, values) {
|
function disableOptions(idSelect, init, values) {
|
||||||
for (let i = init; i < idSelect.options.length; ++i) {
|
for (let i = init; i < idSelect.options.length; ++i) {
|
||||||
const choix = idSelect.options[i];
|
const choix = idSelect.options[i];
|
||||||
@ -60,6 +48,47 @@ function disableOptions(idSelect, init, values) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// choisir les exercices affichés selon la date paramètre
|
||||||
|
function chooseYears(id_date, id_exercices, id_years)
|
||||||
|
{
|
||||||
|
// masquer le message d'erreur
|
||||||
|
document.getElementById('erreur').setAttribute('class', 'hidden');
|
||||||
|
// activer toutes les options
|
||||||
|
const select_field = document.getElementById(id_exercices);
|
||||||
|
for (const choix of select_field.options) {
|
||||||
|
choix.removeAttribute('disabled');
|
||||||
|
choix.removeAttribute('selected');
|
||||||
|
}
|
||||||
|
|
||||||
|
// voir dans quels exercices ouverts se situe la date d'acquisition
|
||||||
|
const date_achat = getDate(id_date);
|
||||||
|
const years_data = document.getElementById(id_years);
|
||||||
|
let array_years = [];
|
||||||
|
for (const choix of years_data.options) {
|
||||||
|
if (choix.value != '') {
|
||||||
|
const epox = choix.text.split(' ');
|
||||||
|
if (epox[0] <= date_achat && date_achat <= epox[1]) {
|
||||||
|
array_years.push(choix.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_years.length == 0) {
|
||||||
|
document.getElementById('erreur').setAttribute('class', '');
|
||||||
|
disableOptions(select_field, 1, array_years);
|
||||||
|
select_field.value = '';
|
||||||
|
setAccountYear(['credit_account', 'debit_account'], 0);
|
||||||
|
} else if (array_years.length == 1) {
|
||||||
|
disableOptions(select_field, 0, array_years);
|
||||||
|
select_field.value = array_years[0];
|
||||||
|
setAccountYear(['credit_account', 'debit_account'], array_years[0]);
|
||||||
|
} else {
|
||||||
|
disableOptions(select_field, 1, array_years);
|
||||||
|
select_field.value = '';
|
||||||
|
setAccountYear(['credit_account', 'debit_account'], 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// afficher la date de fin de l'exercice choisi
|
// afficher la date de fin de l'exercice choisi
|
||||||
function setDateEnd(id_exercices, id_date, id_years) {
|
function setDateEnd(id_exercices, id_date, id_years) {
|
||||||
const selected_year = document.getElementById(id_exercices).value;
|
const selected_year = document.getElementById(id_exercices).value;
|
||||||
@ -78,7 +107,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 formatté en €
|
||||||
function getNumber(text) {
|
function getNumber(text) {
|
||||||
return Number(text.replace(/ /g, '').replace(/,/, '.').replace(/€/, ''));
|
return Number(text.replace(/ /g, '').replace(/,/, '.').replace(/€/, ''));
|
||||||
}
|
}
|
||||||
@ -98,9 +127,7 @@ function computeAmort(montant_immo, duree_immo, somme_amort, date_debut, date_fi
|
|||||||
// calculer et afficher le montant de l'amortissement
|
// calculer et afficher le montant de l'amortissement
|
||||||
function displayAmort(id_immo, id_duree, id_amort, id_years, id_exercices, id_montant, id_erreur, id_date=null)
|
function displayAmort(id_immo, id_duree, id_amort, id_years, id_exercices, id_montant, id_erreur, id_date=null)
|
||||||
{
|
{
|
||||||
const div_erreur = document.getElementById(id_erreur);
|
document.getElementById(id_erreur).setAttribute('class', 'hidden');
|
||||||
div_erreur.setAttribute('class', 'hidden');
|
|
||||||
// document.getElementById(id_erreur).setAttribute('class', 'hidden');
|
|
||||||
let case_montant = document.getElementById(id_montant);
|
let case_montant = document.getElementById(id_montant);
|
||||||
const selected_year = document.getElementById(id_exercices).value;
|
const selected_year = document.getElementById(id_exercices).value;
|
||||||
if (selected_year == '') {
|
if (selected_year == '') {
|
||||||
@ -123,8 +150,7 @@ function displayAmort(id_immo, id_duree, id_amort, id_years, id_exercices, id_mo
|
|||||||
if (date_debut <= date_choisie && date_choisie <= date_fin) {
|
if (date_debut <= date_choisie && date_choisie <= date_fin) {
|
||||||
date_fin = date_choisie;
|
date_fin = date_choisie;
|
||||||
} else {
|
} else {
|
||||||
div_erreur.setAttribute('class', '');
|
document.getElementById(id_erreur).setAttribute('class', '');
|
||||||
// document.getElementById(id_erreur).setAttribute('class', '');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const montant_immo = Number(document.getElementById(id_immo).value);
|
const montant_immo = Number(document.getElementById(id_immo).value);
|
||||||
|
226
write_exit.html
226
write_exit.html
@ -6,34 +6,48 @@
|
|||||||
- immo_id : numéro de ligne de l'écriture d'immobilisation
|
- immo_id : numéro de ligne de l'écriture d'immobilisation
|
||||||
- amort_amount : montant des amortissements
|
- amort_amount : montant des amortissements
|
||||||
- year : exercice de la date de sortie de l'immobilisation
|
- year : exercice de la date de sortie de l'immobilisation
|
||||||
- date_mes : date de mise en service de l'immobilisation
|
|
||||||
- date_debut : date de début de la période d'amortissement complémentaire
|
|
||||||
- exit_date : date de sortie de l'immobilisation
|
- exit_date : date de sortie de l'immobilisation
|
||||||
- duree_amort : durée de l'amortiseement (optionnel)
|
|
||||||
- cession : montant de la cession (optionnel)
|
- cession : montant de la cession (optionnel)
|
||||||
|
- duree_amort : durée de l'amortiseement (optionnel)
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
|
{{* TEMPORAIRE *}}
|
||||||
|
{{:admin_header title="Sortie du bilan" custom_css="./style.css" current="module_amortissement"}}
|
||||||
|
|
||||||
|
{{* barre de navigation *}}
|
||||||
|
{{if ! $dialog}}
|
||||||
|
{{:include file="_nav.html" current="amortization"}}
|
||||||
|
{{/if}}
|
||||||
|
{{* /TEMPORAIRE *}}
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
line.debit as montant,
|
id_transaction,
|
||||||
line.id_transaction,
|
id_account,
|
||||||
line.id_account,
|
debit,
|
||||||
trans.date as date_achat,
|
label,
|
||||||
trans.label,
|
|
||||||
id_project
|
id_project
|
||||||
FROM acc_transactions_lines AS line
|
FROM acc_transactions_lines
|
||||||
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
WHERE id = :immo_id;
|
||||||
WHERE line.id = :immo_id;
|
|
||||||
:immo_id = $_GET.immo_id|intval
|
:immo_id = $_GET.immo_id|intval
|
||||||
assign="ligne_immo"
|
assign="ligne_immo"
|
||||||
}}
|
}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
|
{{#select
|
||||||
|
label,date
|
||||||
|
FROM acc_transactions
|
||||||
|
WHERE id = :trans_id;
|
||||||
|
:trans_id = $ligne_immo.id_transaction
|
||||||
|
assign="trans_immo"
|
||||||
|
}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{* date de début de l'exercice *}}
|
{{* date de début de l'exercice *}}
|
||||||
{{#select start_date FROM acc_years WHERE id = :year_id; :year_id = $_GET.year}}
|
{{#select start_date FROM acc_years WHERE id = :year_id; :year_id = $_GET.year}}
|
||||||
{{*:assign date_debut=$start_date*}}
|
{{:assign date_debut=$start_date}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{*if $date_debut < "2025-01-01"*}}
|
{{*if $date_debut < "2025-01-01"*}}
|
||||||
@ -46,17 +60,29 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.montant:$_GET.amort_amount}}
|
{{if $info_immo.duration == null}}
|
||||||
|
{{:assign duree_amort=$_GET.duree_amort}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign duree_amort=$info_immo.duration}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.debit:$_GET.amort_amount}}
|
||||||
{{:assign amort_comp=0}} {{* amortissement complémentaire jqà date sortie *}}
|
{{:assign amort_comp=0}} {{* amortissement complémentaire jqà date sortie *}}
|
||||||
{{:assign amort_except=0}} {{* amortissement exceptionnel jqà date fin amortissement *}}
|
{{:assign amort_except=0}} {{* amortissement exceptionnel jqà date fin amortissement *}}
|
||||||
{{if $valeur_nette > 0}}
|
{{if $valeur_nette > 0}}
|
||||||
{{:assign nbjours="1+(%d-%d)/(60*60*24)"|math:$_GET.exit_date:$_GET.date_debut}}
|
{{:include
|
||||||
{{:assign annuite="%f/%f"|math:$ligne_immo.montant:$_GET.duree_amort}}
|
file="_calcul_dates.html"
|
||||||
|
date_debut=$date_debut|parse_date
|
||||||
|
date_fin=$_GET.exit_date|parse_date
|
||||||
|
keep="nbjours"
|
||||||
|
}}
|
||||||
|
{{:debug nbjours=$nbjours}}
|
||||||
|
{{:assign annuite="%f/%f"|math:$ligne_immo.debit:$duree_amort}}
|
||||||
{{:assign amort_comp="round(%f/365*%f, 0)"|math:$annuite:$nbjours}}
|
{{:assign amort_comp="round(%f/365*%f, 0)"|math:$annuite:$nbjours}}
|
||||||
{{:assign amort_comp="min(%f, %f)"|math:$valeur_nette:$amort_comp}}
|
{{:assign amort_comp="min(%f, %f)"|math:$valeur_nette:$amort_comp}}
|
||||||
|
|
||||||
{{if $_GET.cession == null}}
|
{{if $_GET.cession == null}}
|
||||||
{{:assign amort_except="%f-%f-%f"|math:$ligne_immo.montant:$_GET.amort_amount:$amort_comp}}
|
{{:assign amort_except="%f-%f-%f"|math:$ligne_immo.debit:$_GET.amort_amount:$amort_comp}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
@ -66,28 +92,17 @@
|
|||||||
{{:assign montant_cession="%f*100"|math:$_GET.cession}}
|
{{:assign montant_cession="%f*100"|math:$_GET.cession}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* TODO : faut-il forcer les 3 sélecteurs de compte d'amortissement à avoir toujours la même valeur ? *}}
|
{{*:debug
|
||||||
|
get=$_GET
|
||||||
|
montant=$ligne_immo.debit
|
||||||
|
amort_comp=$amort_comp
|
||||||
|
amort_except=$amort_except
|
||||||
|
montant_cession=$montant_cession
|
||||||
|
*}}
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="save"}}
|
{{#form on="save"}}
|
||||||
{{*
|
{{*:debug post=$_POST*}}
|
||||||
{{if $_POST.amort_comp_account != null}
|
|
||||||
{{:assign account=$_POST.amort_comp_account}}
|
|
||||||
{{elseif $_POST.amort_except_account != null}
|
|
||||||
{{:assign account=$_POST.amort_except_account}}
|
|
||||||
{{elseif $_POST.amort_sortie_account != null}
|
|
||||||
{{:assign account=$_POST.amort_sortie_account}}
|
|
||||||
{{/if}}
|
|
||||||
*}}
|
|
||||||
{{:assign account=$_POST.amort_sortie_account}}
|
|
||||||
|
|
||||||
{{:include
|
|
||||||
file="_get_codes.html"
|
|
||||||
account=$account
|
|
||||||
keep="account_code"
|
|
||||||
}}
|
|
||||||
{{:assign amort_account=$account_code|keys|key:0}}
|
|
||||||
|
|
||||||
{{if $valeur_nette > 0}}
|
{{if $valeur_nette > 0}}
|
||||||
{{* immo non totalement amortie *}}
|
{{* immo non totalement amortie *}}
|
||||||
@ -99,8 +114,16 @@
|
|||||||
keep="account_code"
|
keep="account_code"
|
||||||
}}
|
}}
|
||||||
{{:assign comp_account=$account_code|keys|key:0}}
|
{{:assign comp_account=$account_code|keys|key:0}}
|
||||||
|
{{:include
|
||||||
|
file="_get_codes.html"
|
||||||
|
account=$_POST.amort_comp_account
|
||||||
|
keep="account_code"
|
||||||
|
}}
|
||||||
|
{{:assign amort_account=$account_code|keys|key:0}}
|
||||||
|
|
||||||
{{:assign libelle="Amortissement complémentaire "|cat:$ligne_immo.label}}
|
{{* ? Faut-il vérifier la validité des comptes ? *}}
|
||||||
|
|
||||||
|
{{:assign libelle="Amortissement complémentaire "|cat:$trans_immo.label}}
|
||||||
{{:assign
|
{{:assign
|
||||||
var="lines."
|
var="lines."
|
||||||
debit="%f/100"|math:$amort_comp
|
debit="%f/100"|math:$amort_comp
|
||||||
@ -117,7 +140,7 @@
|
|||||||
}}
|
}}
|
||||||
{{:assign valeur_nette="%f-%f"|math:$valeur_nette:$amort_comp}}
|
{{:assign valeur_nette="%f-%f"|math:$valeur_nette:$amort_comp}}
|
||||||
|
|
||||||
{{if $_GET.cession == null && $amort_except > 0}}
|
{{if $_GET.cession == null}}
|
||||||
{{* lignes d'écriture de l'amortissement exceptionnel *}}
|
{{* lignes d'écriture de l'amortissement exceptionnel *}}
|
||||||
{{:include
|
{{:include
|
||||||
file="_get_codes.html"
|
file="_get_codes.html"
|
||||||
@ -125,7 +148,7 @@
|
|||||||
keep="account_code"
|
keep="account_code"
|
||||||
}}
|
}}
|
||||||
{{:assign except_account=$account_code|keys|key:0}}
|
{{:assign except_account=$account_code|keys|key:0}}
|
||||||
{{:assign libelle="Amortissement exceptionnel "|cat:$ligne_immo.label}}
|
{{:assign libelle="Amortissement exceptionnel "|cat:$trans_immo.label}}
|
||||||
{{:assign
|
{{:assign
|
||||||
var="lines."
|
var="lines."
|
||||||
debit="%f/100"|math:$amort_except
|
debit="%f/100"|math:$amort_except
|
||||||
@ -142,6 +165,7 @@
|
|||||||
}}
|
}}
|
||||||
{{:assign valeur_nette="%f-%f"|math:$valeur_nette:$amort_except}}
|
{{:assign valeur_nette="%f-%f"|math:$valeur_nette:$amort_except}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{*:debug lines=$lines*}}
|
||||||
|
|
||||||
{{:api
|
{{:api
|
||||||
method="POST"
|
method="POST"
|
||||||
@ -151,26 +175,27 @@
|
|||||||
id_year=$_GET.year
|
id_year=$_GET.year
|
||||||
type="advanced"
|
type="advanced"
|
||||||
date=$_GET.exit_date
|
date=$_GET.exit_date
|
||||||
label="Amortissement final "|cat:$ligne_immo.label
|
label="Amortissement final "|cat:$trans_immo.label
|
||||||
lines=$lines
|
lines=$lines
|
||||||
linked_transactions=$ligne_immo.id_transaction
|
linked_transactions=$ligne_immo.id_transaction
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* écriture de sortie du bilan *}}
|
{{* écriture de sortie du bilan *}}
|
||||||
{{:assign libelle="Sortie du bilan de "|cat:$ligne_immo.label}}
|
{{*:debug valeur_nette=$valeur_nette*}}
|
||||||
|
{{:assign libelle="Sortie du bilan de "|cat:$trans_immo.label}}
|
||||||
{{:assign lines=null}}
|
{{:assign lines=null}}
|
||||||
{{:assign
|
{{:assign
|
||||||
var="lines."
|
var="lines."
|
||||||
id_account=$ligne_immo.id_account
|
id_account=$ligne_immo.id_account
|
||||||
credit="%f/100"|math:$ligne_immo.montant
|
credit="%f/100"|math:$ligne_immo.debit
|
||||||
id_project=$ligne_immo.id_project
|
id_project=$ligne_immo.id_project
|
||||||
label=$libelle
|
label=$libelle
|
||||||
}}
|
}}
|
||||||
{{:assign
|
{{:assign
|
||||||
var="lines."
|
var="lines."
|
||||||
account=$amort_account
|
account=$amort_account
|
||||||
debit="(%f-%f)/100"|math:$ligne_immo.montant:$valeur_nette
|
debit="(%f-%f)/100"|math:$ligne_immo.debit:$valeur_nette
|
||||||
id_project=$ligne_immo.id_project
|
id_project=$ligne_immo.id_project
|
||||||
label=$libelle
|
label=$libelle
|
||||||
}}
|
}}
|
||||||
@ -183,7 +208,7 @@
|
|||||||
label=$libelle
|
label=$libelle
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{*:debug lines=$lines*}}
|
||||||
{{:api
|
{{:api
|
||||||
method="POST"
|
method="POST"
|
||||||
path="accounting/transaction"
|
path="accounting/transaction"
|
||||||
@ -199,7 +224,7 @@
|
|||||||
|
|
||||||
{{if $montant_cession > 0}}
|
{{if $montant_cession > 0}}
|
||||||
{{* Cession de l'immobilisation *}}
|
{{* Cession de l'immobilisation *}}
|
||||||
{{:assign libelle="Produit cession "|cat:$ligne_immo.label}}
|
{{:assign libelle="Produit cession "|cat:$trans_immo.label}}
|
||||||
{{:include
|
{{:include
|
||||||
file="_get_codes.html"
|
file="_get_codes.html"
|
||||||
account=$_POST.creance_account
|
account=$_POST.creance_account
|
||||||
@ -229,34 +254,18 @@
|
|||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $info_immo != null}}
|
|
||||||
{{* mettre à jour l'état de l'immobilisation *}}
|
{{* mettre à jour l'état de l'immobilisation *}}
|
||||||
{{:save
|
{{:save
|
||||||
key=$info_immo.key
|
key=$info_immo.key
|
||||||
status="archived"
|
status="archived"
|
||||||
}}
|
}}
|
||||||
{{else}}
|
|
||||||
{{:save
|
|
||||||
key=""|uuid
|
|
||||||
validate_schema="schema.json"
|
|
||||||
type="immo"
|
|
||||||
line=$_GET.immo_id|intval
|
|
||||||
duration=$_GET.duree_amort|intval
|
|
||||||
date=$_GET.date_mes|date:"Y-m-d"
|
|
||||||
status="archived"
|
|
||||||
}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{:redirect to="index.html?amort=archive"}}
|
{{:redirect to="index.html?amort=archive"}}
|
||||||
|
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:admin_header title="Sortie du bilan" custom_css="./style.css" current="module_amortissement"}}
|
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
|
||||||
{{if ! $dialog}}
|
|
||||||
{{:include file="_nav.html" current="index" subsubcurrent="balance_exit"}}
|
|
||||||
{{/if}}
|
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
|
{{*:debug get=$_GET*}}
|
||||||
|
|
||||||
{{* Préparer les infos pour le formulaire *}}
|
{{* Préparer les infos pour le formulaire *}}
|
||||||
|
|
||||||
@ -269,6 +278,7 @@
|
|||||||
assign=immo_account_info
|
assign=immo_account_info
|
||||||
}}
|
}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
{{*:debug immo_account_info=$immo_account_info*}}
|
||||||
|
|
||||||
{{:include
|
{{:include
|
||||||
file="./_get_amort_code.html"
|
file="./_get_amort_code.html"
|
||||||
@ -289,6 +299,20 @@
|
|||||||
value="%s — Produits des cessions d'actif"|args:$cession_code}}
|
value="%s — Produits des cessions d'actif"|args:$cession_code}}
|
||||||
{{:assign var="creance_account.462" value="462 — Créances sur cessions d'immobilisations"}}
|
{{:assign var="creance_account.462" value="462 — Créances sur cessions d'immobilisations"}}
|
||||||
|
|
||||||
|
{{*:debug
|
||||||
|
comp_account=$comp_account
|
||||||
|
except_account=$except_account
|
||||||
|
amort_account=$amort_account
|
||||||
|
immo_account=$immo_account
|
||||||
|
vnc_account=$vnc_account
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{#select * from acc_years where start_date <= :date AND :date <= end_date;
|
||||||
|
:date=$_GET.exit_date|parse_date
|
||||||
|
assign=year
|
||||||
|
}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
{{:read file="./defaut.json" assign="config_json"}}
|
{{:read file="./defaut.json" assign="config_json"}}
|
||||||
{{:assign config_defaut=$config_json|json_decode}}
|
{{:assign config_defaut=$config_json|json_decode}}
|
||||||
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
||||||
@ -298,46 +322,47 @@
|
|||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{:assign patterns=$pattern_array|implode:"|"}}
|
{{:assign patterns=$pattern_array|implode:"|"}}
|
||||||
|
|
||||||
<h3>Sortir l'immobilisation « {{$ligne_immo.label}} » du bilan</h3>
|
{{*:debug comp_account=$comp_account amort_account=$amort_account except_account=$except_account year=$year*}}
|
||||||
|
|
||||||
|
<h3>Sortir l'immobilisation « {{$trans_immo.label}} » du bilan</h3>
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
|
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<legend>Données de l'imobilisation</legend>
|
<legend>Données de l'imobilisation</legend>
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Montant</dt>
|
<dt><label>Montant</label></dt>
|
||||||
<dd class="money">{{$ligne_immo.montant|money_currency:false}}</dd>
|
<dd class="money">{{$ligne_immo.debit|money_currency:false}}</dd>
|
||||||
<dt>Date d'acquisition</dt>
|
<dt><label>Date d'acquisition</label></dt>
|
||||||
<dd >{{$ligne_immo.date_achat|date_short}}</dd>
|
<dd >{{$trans_immo.date|date_short}}</dd>
|
||||||
{{if $_GET.date_mes != $ligne_immo.date_achat|strtotime}}
|
{{if $info_immo.date != null && $info_immo.date != $trans_immo.date}}
|
||||||
<dt>Date de mise en service</dt>
|
<dt><label>Date de mise en service</label></dt>
|
||||||
<dd>{{$_GET.date_mes|date:"d/m/Y"}}</dd>
|
<dd>{{$info_immo.date|date_short}}</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $_GET.duree_amort != null}}
|
{{if $duree_amort != null}}
|
||||||
<dt>Durée de l'amortissement</dt>
|
<dt>Durée de l'amortissement</dt>
|
||||||
<dd class="num">{{$_GET.duree_amort}} ans</dd>
|
<dd class="num">{{$duree_amort}} ans</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<dt>Montant des amortissements</dt>
|
<dt><label>Montant des amortissements</label></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:false}} <span class="help">(à la date de début de l'exercice)</span></dd>
|
||||||
<dt>Valeur nette résiduelle</dt>
|
<dt><label>Valeur nette résiduelle</label></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:false}} <span class="help">(à la date de début de l'exercice)</span></dd>
|
||||||
<dt>Date de sortie</dt>
|
<dt><label>Date de sortie</label></dt>
|
||||||
<dd>{{$_GET.exit_date|date:"d/m/Y"}}</dd>
|
<dd>{{$_GET.exit_date}}</dd>
|
||||||
{{if $amort_comp > 0}}
|
{{if $amort_comp > 0}}
|
||||||
{{:assign valeur_nette="%f-%f"|math:$valeur_nette:$amort_comp}}
|
<dt><label>Montant amortissement complémentaire</label></dt>
|
||||||
<dt>Amortissement complémentaire</dt>
|
<dd class="money">{{$amort_comp|money_currency:false}}</dd>
|
||||||
<dd class="money">{{$amort_comp|money_currency:false}} <span class="help">(jusqu'à la date de sortie)</span></dd>
|
<dt><label>Montant des amortissements</label></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:false}} <span class="help">(à la date de sortie)</span></dd>
|
||||||
<dt>Valeur nette résiduelle</dt>
|
<dt><label>Valeur nette résiduelle</label></dt>
|
||||||
<dd class="money">{{$valeur_nette|money_currency:false}} <span class="help">(à la date de sortie)</span></dd>
|
<dd class="money">{{"%f-%f"|math:$valeur_nette:$amort_comp|money_currency:false}} <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><label>Montant amortissement exceptionnel</label></dt>
|
||||||
<dd class="money">{{$amort_except|money_currency:false}}</dd>
|
<dd class="money">{{$amort_except|money_currency:false}}</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<dt>Montant de la cession</dt>
|
<dt><label>Montant de la cession</label></dt>
|
||||||
<dd class="money">{{$montant_cession|money_currency:false}}</dd>
|
<dd class="money">{{$montant_cession|money_currency:false}}</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</dl>
|
</dl>
|
||||||
@ -346,7 +371,7 @@
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Écritures de sortie du bilan</legend>
|
<legend>Écritures de sortie du bilan</legend>
|
||||||
{{* Amortissement complémentaire *}}
|
{{* Amortissement complémentaire *}}
|
||||||
{{if $amort_comp > 0}}
|
{{if $valeur_nette > 0}}
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -366,7 +391,7 @@
|
|||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="comp_account"
|
name="comp_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"68*":$_GET.year
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"68*":$year.id
|
||||||
default=$comp_account
|
default=$comp_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
@ -378,7 +403,7 @@
|
|||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="amort_comp_account"
|
name="amort_comp_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$_GET.year
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$year.id
|
||||||
default=$amort_account
|
default=$amort_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
@ -387,10 +412,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* Amortissement exceptionnel *}}
|
{{* Amortissement exceptionnel *}}
|
||||||
{{if $montant_cession == 0 && $amort_except > 0}}
|
{{if $montant_cession == 0}}
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -410,7 +434,7 @@
|
|||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="except_account"
|
name="except_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"687*":$_GET.year
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"687*":$year.id
|
||||||
default=$except_account
|
default=$except_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
@ -422,7 +446,7 @@
|
|||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="amort_except_account"
|
name="amort_except_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$_GET.year
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$year.id
|
||||||
default=$amort_account
|
default=$amort_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
@ -432,6 +456,7 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{* Sortie du bilan *}}
|
{{* Sortie du bilan *}}
|
||||||
<table class="list">
|
<table class="list">
|
||||||
@ -448,29 +473,30 @@
|
|||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="amort_sortie_account"
|
name="amort_sortie_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$_GET.year
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$year.id
|
||||||
default=$amort_account
|
default=$amort_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
{{if $montant_cession == 0}}
|
{{if $montant_cession == 0}}
|
||||||
{{:assign montant=$ligne_immo.montant}}
|
{{:assign montant=$ligne_immo.debit}}
|
||||||
{{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:false}}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
{{if $montant_cession > 0 && $valeur_nette > 0}}
|
{{if $montant_cession > 0}}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="vnc_account"
|
name="vnc_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s*&year=%d"|args:$vnc_code:$_GET.year
|
target="!acc/charts/accounts/selector.php?codes=%s*&year=%d"|args:$vnc_code:$year.id
|
||||||
default=$vnc_account
|
default=$vnc_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
<td>{{$valeur_nette|money_currency:false}}</td>
|
{{:assign montant="%f-%f"|math:$valeur_nette:$amort_comp}}
|
||||||
|
<td>{{$montant|money_currency:false}}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@ -479,12 +505,12 @@
|
|||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="immo_account"
|
name="immo_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:$patterns:$_GET.year
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:$patterns:$year.id
|
||||||
default=$immo_account
|
default=$immo_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>{{$ligne_immo.montant|money_currency:false}}</td>
|
<td>{{$ligne_immo.debit|money_currency:false}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@ -505,7 +531,7 @@
|
|||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="creance_account"
|
name="creance_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"462*":$_GET.year
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"462*":$year.id
|
||||||
default=$creance_account
|
default=$creance_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
@ -517,7 +543,7 @@
|
|||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="cession_account"
|
name="cession_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s*&year=%d"|args:$cession_code:$_GET.year
|
target="!acc/charts/accounts/selector.php?codes=%s*&year=%d"|args:$cession_code:$year.id
|
||||||
default=$cession_account
|
default=$cession_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
|
Loading…
Reference in New Issue
Block a user