Compare commits
3 commits
e0cf555851
...
afbf036796
Author | SHA1 | Date | |
---|---|---|---|
![]() |
afbf036796 | ||
![]() |
0688ad0fec | ||
![]() |
dc823c90e2 |
3 changed files with 22 additions and 8 deletions
|
@ -24,6 +24,7 @@
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{:assign date_debut=$ligne_immo.date}}
|
{{:assign date_debut=$ligne_immo.date}}
|
||||||
{{:assign solde=$ligne_immo.montant}}
|
{{:assign solde=$ligne_immo.montant}}
|
||||||
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$ligne_immo.trans_id}}
|
||||||
|
|
||||||
{{#load type="immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
{{#load type="immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
||||||
{{:assign duree=$duration}}
|
{{:assign duree=$duration}}
|
||||||
|
@ -164,8 +165,8 @@
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Libellé</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd>{{$ligne_immo.label}}</dd>
|
<dd><span class="num"><a href={{$trans_url}}>#{{$ligne_immo.trans_id}}</a></span> {{$ligne_immo.label}}</dd>
|
||||||
<dt>Montant</dt>
|
<dt>Montant</dt>
|
||||||
<dd><strong class="money">{{"%f"|math:$ligne_immo.montant|money_currency}}</strong></dd>
|
<dd><strong class="money">{{"%f"|math:$ligne_immo.montant|money_currency}}</strong></dd>
|
||||||
<dt>Début d'amortissement</dt>
|
<dt>Début d'amortissement</dt>
|
||||||
|
|
|
@ -67,19 +67,22 @@
|
||||||
{{: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
|
lister les exercices ouverts :
|
||||||
|
- dont la date de fin est postérieure à la date du dernier amortissment
|
||||||
|
- dont la date de début est antérieure ou égale à la date du jour
|
||||||
*}}
|
*}}
|
||||||
{{:assign default_exit_date=""}}
|
{{:assign default_exit_date=""}}
|
||||||
{{#years closed=false order="start_date" where="start_date <= :debut AND :debut <= end_date"
|
{{#years closed=false order="start_date" where=":debut <= end_date" :debut=$date_debut}}
|
||||||
:debut=$date_debut assign=years.}}
|
|
||||||
{{if $start_date|strtotime <= $now && $now <= $end_date|strtotime}}
|
{{if $start_date|strtotime <= $now && $now <= $end_date|strtotime}}
|
||||||
{{:assign default_exit_date=$now|date_short}}
|
{{:assign default_exit_date=$now|date_short}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:assign ts_fin=$end_date|strtotime}}
|
{{if $start_date|strtotime > $now}}
|
||||||
|
{{:break}}
|
||||||
|
{{/if}}
|
||||||
|
{{:assign var="years." id=$id label=$label start_date=$start_date end_date=$end_date}}
|
||||||
{{:assign debut=$start_date|date_short}}
|
{{:assign debut=$start_date|date_short}}
|
||||||
{{:assign fin=$end_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="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}}
|
{{else}}
|
||||||
{{:error message="Aucun exercice ouvert pour enregistrer un amortissement"}}
|
{{:error message="Aucun exercice ouvert pour enregistrer un amortissement"}}
|
||||||
{{/years}}
|
{{/years}}
|
||||||
|
@ -141,6 +144,7 @@
|
||||||
{{* vérifier que la date de sortie est située dans un exercice ouvert *}}
|
{{* vérifier que la date de sortie est située dans un exercice ouvert *}}
|
||||||
{{:assign ts_exit = $_POST.date_sortie|parse_date|strtotime}}
|
{{:assign ts_exit = $_POST.date_sortie|parse_date|strtotime}}
|
||||||
{{:assign ok=false}}
|
{{:assign ok=false}}
|
||||||
|
{{:assign msg_amort=""}}
|
||||||
{{#foreach from=$years}}
|
{{#foreach from=$years}}
|
||||||
{{if $id == $_POST.id_year}}
|
{{if $id == $_POST.id_year}}
|
||||||
{{:assign selected_year=$id}}
|
{{:assign selected_year=$id}}
|
||||||
|
@ -149,16 +153,24 @@
|
||||||
{{:break}}
|
{{:break}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{* voir si des amortissements ont été oubliés *}}
|
||||||
|
{{if $start_date|strtotime > $amort_line.last_amort_date|strtotime && $end_date|strtotime < $now}}
|
||||||
|
{{:assign debut=$start_date|date_short}}
|
||||||
|
{{:assign fin=$end_date|date_short}}
|
||||||
|
{{:assign msg_amort=$msg_amort|cat:"\n"|cat:" - "|cat:$label|cat:" : du "|cat:$debut|cat:" au "|cat:$fin}}
|
||||||
|
{{/if}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{if ! $ok}}
|
{{if ! $ok}}
|
||||||
{{:error message="La date choisie n'est pas dans l'exercice sélectionné !"}}
|
{{:error message="La date choisie n'est pas dans l'exercice sélectionné !"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{if $msg_amort != ""}}
|
||||||
|
{{:error message="Vous devez d'abord enregistrer les amortissements des exercices suivants : %s"|args:$msg_amort}}
|
||||||
|
{{/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}}
|
{{: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}}
|
||||||
{{/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" subcurrent="%s"|args:$_GET.type_immo subsubcurrent="balance_exit"}}
|
{{:include file="_nav.html" current="index" subcurrent="%s"|args:$_GET.type_immo subsubcurrent="balance_exit"}}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
"prefixes": {
|
"prefixes": {
|
||||||
"20": "Immobilisations incorporelles",
|
"20": "Immobilisations incorporelles",
|
||||||
"21": "Immobilisations corporelles",
|
"21": "Immobilisations corporelles",
|
||||||
|
"23": "Immobilisations en cours",
|
||||||
"27": "Immobilisations financières"
|
"27": "Immobilisations financières"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue