Compare commits
8 commits
main
...
batch_clas
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bb7cbc9d3b | ||
![]() |
79e536a0b3 | ||
![]() |
ff4b295cf6 | ||
![]() |
19e2fed248 | ||
![]() |
0688ad0fec | ||
![]() |
dc823c90e2 | ||
![]() |
e0cf555851 | ||
![]() |
ab9b2a37ff |
15 changed files with 398 additions and 178 deletions
|
@ -1,11 +1,11 @@
|
||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{* Liste des immobilisations amortissable ou à définir *}}
|
{{* Liste des immobilisations en cours ou amorties *}}
|
||||||
|
|
||||||
<section class="immobilisation">
|
<section class="immobilisation">
|
||||||
{{if $type_immo == "encours"}}
|
{{if $type_immo == "encours"}}
|
||||||
<h2 class="ruler">Immobilisations en cours</h2>
|
<h2 class="ruler">Immobilisations en cours</h2>
|
||||||
{{elseif $type_immo == "fini"}}
|
{{elseif $type_immo == "amortie"}}
|
||||||
<h2 class="ruler">Immobilisations amorties</h2>
|
<h2 class="ruler">Immobilisations amorties</h2>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:assign nb_immo=0}}
|
{{:assign nb_immo=0}}
|
||||||
|
@ -58,18 +58,16 @@
|
||||||
{{: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 *}}
|
{{* 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 $status == "ignored"}}
|
{{:assign status=$status}}
|
||||||
{{:assign amortissable="non"}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign amortissable="oui"}}
|
|
||||||
{{/if}}
|
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign amortissable="nsp"}}
|
{{:assign amortissable="nsp"}}
|
||||||
|
{{:assign status="unknown"}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
{{if $amortissable == "non"}}
|
{{if $status == "ignored"}}
|
||||||
{{:continue}}
|
{{:continue}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -93,8 +91,9 @@
|
||||||
:line_id = $immo_id|intval
|
:line_id = $immo_id|intval
|
||||||
}}
|
}}
|
||||||
{{:assign ignore=true}}
|
{{:assign ignore=true}}
|
||||||
|
{{:assign status="archived"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{if $ignore}}
|
{{if $status == "archived"}}
|
||||||
{{:continue}}
|
{{:continue}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -132,13 +131,12 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
|
|
||||||
{{* classement par onglet *}}
|
{{* classement par onglet *}}
|
||||||
{{if $type_immo == "encours" && $amort_amount >= $debit ||
|
{{if $type_immo == "encours" && $amort_amount >= $debit}}{{:continue}}{{/if}}
|
||||||
$type_immo == "fini" && $amort_amount < $debit ||
|
{{if $type_immo == "encours" && $status == "amortized"}}{{:continue}}{{/if}}
|
||||||
$amortissable == "nsp" && ! $exist_amort
|
{{if $status == "unknown" && ! $exist_amort}}{{:continue}}{{/if}}
|
||||||
}}
|
{{if $type_immo == "amortie" && $amort_amount < $debit && $status != "amortized"}}{{:continue}}{{/if}}
|
||||||
{{:continue}}
|
|
||||||
{{/if}}
|
|
||||||
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
{{: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>
|
||||||
|
@ -156,7 +154,7 @@
|
||||||
shape="settings"
|
shape="settings"
|
||||||
target="_dialog"
|
target="_dialog"
|
||||||
}}
|
}}
|
||||||
{{elseif $amortissable == "nsp"}}
|
{{elseif $status == "unknown"}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Paramètres"
|
label="Paramètres"
|
||||||
href="add_infos.html?immo_id=%s&amort=1&op=new&type_immo=%s"|args:$immo_id:$type_immo
|
href="add_infos.html?immo_id=%s&amort=1&op=new&type_immo=%s"|args:$immo_id:$type_immo
|
||||||
|
|
|
@ -6,9 +6,14 @@
|
||||||
<h2 class="ruler">Autres immobilisations</h2>
|
<h2 class="ruler">Autres immobilisations</h2>
|
||||||
{{:assign nb_immo=0}}
|
{{:assign nb_immo=0}}
|
||||||
|
|
||||||
|
<form method="post" action="confirm_action.html?target=_dialog" target="_dialog">
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="check">
|
||||||
|
<input type="checkbox" title="Tout cocher / décocher" id="f_all" />
|
||||||
|
<label for="f_all" title="Tout cocher / décocher"></label>
|
||||||
|
</td>
|
||||||
<th>N°</th>
|
<th>N°</th>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th>Libellé</th>
|
<th>Libellé</th>
|
||||||
|
@ -52,13 +57,14 @@
|
||||||
}}
|
}}
|
||||||
{{: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}}
|
||||||
|
|
||||||
{{* voir si l'immo est prise en charge *}}
|
{{* 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 status=$status}}
|
{{:assign status=$status}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign status="nsp"}}
|
{{:assign status="unknown"}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
{{if $status != "ignored" && $status != "nsp"}}
|
{{if $status != "unknown"}}
|
||||||
{{:continue}}
|
{{:continue}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -87,7 +93,7 @@
|
||||||
account.code LIKE '28%';
|
account.code LIKE '28%';
|
||||||
:line_id = $immo_id|intval
|
:line_id = $immo_id|intval
|
||||||
}}
|
}}
|
||||||
{{if $status == "nsp" && $amort_amount != null}}
|
{{if $status == "unknown" && $amort_amount != null}}
|
||||||
{{:assign ignore=true}}
|
{{:assign ignore=true}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign ignore=false}}
|
{{:assign ignore=false}}
|
||||||
|
@ -100,6 +106,11 @@
|
||||||
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>
|
||||||
|
{{:input type="checkbox" name="check[%s]"|args:$immo_id value=$immo_id default=0}}
|
||||||
|
<input type="hidden" name="label[{{$immo_id}}]" value="{{$trans_label}}">
|
||||||
|
<input type="hidden" name="trans[{{$immo_id}}]" value="{{$trans_id}}">
|
||||||
|
</td>
|
||||||
<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>
|
||||||
<td>{{$trans_label}}</td>
|
<td>{{$trans_label}}</td>
|
||||||
|
@ -107,31 +118,54 @@
|
||||||
<td><a href={{$compte_url}}>{{$account_code}}</a></td>
|
<td><a href={{$compte_url}}>{{$account_code}}</a></td>
|
||||||
<td>{{$account_label}}</td>
|
<td>{{$account_label}}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{{if $status == "nsp"}}
|
{{if $status == "unknown"}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Paramètres"
|
label="Paramètres"
|
||||||
href="add_infos.html?immo_id=%s&amort=0&op=new&type_immo=autres"|args:$immo_id
|
href="add_infos.html?immo_id=%s&amort=0&op=new&type_immo=autre"|args:$immo_id
|
||||||
shape="settings"
|
shape="settings"
|
||||||
target="_dialog"
|
target="_dialog"
|
||||||
}}
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Paramètres"
|
label="Paramètres"
|
||||||
href="add_infos.html?immo_id=%s&amort=0&op=modif&type_immo=autres"|args:$immo_id
|
href="add_infos.html?immo_id=%s&amort=0&op=modif&type_immo=autre"|args:$immo_id
|
||||||
shape="settings"
|
shape="settings"
|
||||||
target="_dialog"
|
target="_dialog"
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Amortissements"
|
label="Amortissements"
|
||||||
href="amortization.html?immo_id=%s&type_immo=autres"|args:$immo_id
|
href="amortization.html?immo_id=%s&type_immo=autre"|args:$immo_id
|
||||||
shape="table"
|
shape="table"
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
|
{{:assign var="actions.amortize" value="Marquer l'immobilisation amortie"}}
|
||||||
|
{{:assign var="actions.ignore" value="Ignorer l'écriture"}}
|
||||||
|
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td class="check"><input type="checkbox" value="Tout cocher / décocher" id="f_all2" />
|
||||||
|
<label for="f_all2"></label>
|
||||||
|
</td>
|
||||||
|
<td class="actions" colspan="10">
|
||||||
|
<em>Pour les écritures cochées :</em>
|
||||||
|
{{*
|
||||||
|
<input type="hidden" name="from" value="{$self_url}" />
|
||||||
|
<input type="hidden" name="year" value="{$year.id}" />
|
||||||
|
{csrf_field key="projects_action"}
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{:input type="select" name="actions" options=$actions default_empty="— Choisir une action à effectuer —"}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
</form>
|
||||||
{{if $nb_immo == 0}}
|
{{if $nb_immo == 0}}
|
||||||
<p class="block alert">Aucune immobilisation</p>
|
<p class="block alert">Aucune immobilisation</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
28
_nav.html
28
_nav.html
|
@ -5,22 +5,22 @@
|
||||||
<aside>
|
<aside>
|
||||||
{{:linkbutton label="Ajouter une immobilisation" shape="plus" href="add_asset.html" target="_dialog"}}
|
{{:linkbutton label="Ajouter une immobilisation" shape="plus" href="add_asset.html" target="_dialog"}}
|
||||||
</aside>
|
</aside>
|
||||||
|
{{elseif $subsubcurrent == "amortization" && $type_immo == null || $type_immo == "encours" || $type_immo == "autre"}}
|
||||||
|
<aside>
|
||||||
|
{{if $autres_amort != null}}
|
||||||
|
{{:linkbutton label="Attacher un amortissement" href="other_amortizations.html?immo_id=%s"|args:$_GET.immo_id shape="plus" target="_dialog"}}
|
||||||
|
{{/if}}
|
||||||
|
{{:linkbutton label="Enregistrer un amortissement" shape="plus"
|
||||||
|
href="save_amort.html?immo_id=%s"|args:$_GET.immo_id target="_dialog"}}
|
||||||
|
</aside>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{*
|
{{if $current == 'index'}} {{* && $subsubcurrent != 'balance_exit' *}}
|
||||||
<ul>
|
|
||||||
<li {{if $current == 'index'}} class="current"{{/if}}><a href="{{$module.url}}index.html">Immobilisations</a></li>
|
|
||||||
<li {{if $current == 'aide'}} class="current"{{/if}}><a href="{{$module.url}}aide.html">Aide</a></li>
|
|
||||||
</ul>
|
|
||||||
*}}
|
|
||||||
|
|
||||||
{{if $current == 'index' && $subsubcurrent != 'balance_exit'}}
|
|
||||||
{{* <ul class="sub">*}}
|
|
||||||
<ul>
|
<ul>
|
||||||
<li {{if $subcurrent == 'encours'}}class="current"{{/if}}><a href="index.html?type_immo=encours">En cours</a></li>
|
<li {{if $subcurrent == 'encours'}}class="current"{{/if}}><a href="index.html?type_immo=encours">En cours</a></li>
|
||||||
<li {{if $subcurrent == 'fini'}}class="current"{{/if}}><a href="index.html?type_immo=fini">Terminées</a></li>
|
<li {{if $subcurrent == 'amortie'}}class="current"{{/if}}><a href="index.html?type_immo=amortie">Amorties</a></li>
|
||||||
<li {{if $subcurrent == 'archive'}}class="current"{{/if}}><a href="index.html?type_immo=archive">Archivées</a></li>
|
<li {{if $subcurrent == 'sortie'}}class="current"{{/if}}><a href="index.html?type_immo=sortie">Sorties du bilan</a></li>
|
||||||
<li {{if $subcurrent == 'autres'}}class="current"{{/if}}><a href="index.html?type_immo=autres">Autres</a></li>
|
<li {{if $subcurrent == 'autre'}}class="current"{{/if}}><a href="index.html?type_immo=autre">Autres</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -29,10 +29,8 @@
|
||||||
<li class="title"><strong>Amortissements</strong></li>
|
<li class="title"><strong>Amortissements</strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
{{elseif $subsubcurrent == 'balance_exit'}}
|
{{elseif $subsubcurrent == 'balance_exit'}}
|
||||||
{{*
|
|
||||||
<ul class="sub">
|
<ul class="sub">
|
||||||
<li class="title"><strong>Sortie du bilan</strong></li>
|
<li class="title"><strong>Sortie de bilan</strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
*}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -117,11 +117,11 @@
|
||||||
status=$status
|
status=$status
|
||||||
}}
|
}}
|
||||||
{{if $_POST.amortir}}
|
{{if $_POST.amortir}}
|
||||||
{{:assign amort="encours"}}
|
{{:assign type_immo="encours"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign amort="autres"}}
|
{{:assign type_immo="autre"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:redirect force="index.html?ok=1&msg=immobilisation&amort=%s"|args:$amort}}
|
{{:redirect force="index.html?ok=1&msg=immobilisation&type_immo=%s"|args:$type_immo}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:admin_header title="Ajout immobilisation" current="module_amortissement"}}
|
{{:admin_header title="Ajout immobilisation" current="module_amortissement"}}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
@param immo_id
|
@param immo_id
|
||||||
@param amort = 1 si immo amortissable, 0 si non
|
@param amort = 1 si immo amortissable, 0 si non
|
||||||
@param op = new ou modif
|
@param op = new ou modif
|
||||||
@param type_immo : encours, archive, fini, autre
|
@param type_immo : encours, amortie, sortie, autre
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{if $_GET.op == "modif"}}
|
{{if $_GET.op == "modif"}}
|
||||||
|
@ -14,6 +14,10 @@
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="save"}}
|
{{#form on="save"}}
|
||||||
|
{{:debug post=$_POST}}
|
||||||
|
{{if $_POST.classify == null}}
|
||||||
|
{{:error message="Vous devez choisir une action"}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{* chercher la date d'acquisition de l'immobilisation *}}
|
{{* chercher la date d'acquisition de l'immobilisation *}}
|
||||||
{{#select
|
{{#select
|
||||||
|
@ -26,7 +30,7 @@
|
||||||
}}
|
}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{if ! $_POST.amortir}}
|
{{if $_POST.classify == "ignored"}}
|
||||||
{{* ne pas amortir *}}
|
{{* ne pas amortir *}}
|
||||||
{{:assign duration=0}}
|
{{:assign duration=0}}
|
||||||
{{:assign date_debut=$ligne_immo.date_achat|parse_date}}
|
{{:assign date_debut=$ligne_immo.date_achat|parse_date}}
|
||||||
|
@ -39,12 +43,17 @@
|
||||||
{{:assign da=$ligne_immo.date_achat|date_short}}
|
{{:assign da=$ligne_immo.date_achat|date_short}}
|
||||||
{{:error message="Erreur : la date de mise en service (%s) ne peut être antérieure à la date d'acquisition (%s)"|args:$dd:$da}}
|
{{:error message="Erreur : la date de mise en service (%s) ne peut être antérieure à la date d'acquisition (%s)"|args:$dd:$da}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{if $_POST.classify == "amortized"}}
|
||||||
|
{{:assign duration=0}}
|
||||||
|
{{:assign status="amortized"}}
|
||||||
|
{{else}}
|
||||||
{{:assign duration=$_POST.duree|intval}}
|
{{:assign duration=$_POST.duree|intval}}
|
||||||
{{if $duration <= 0}}
|
{{if $duration <= 0}}
|
||||||
{{:error message="Erreur : la durée d'amortissement doit être strictement positive"}}
|
{{:error message="Erreur : la durée d'amortissement doit être strictement positive"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:assign status="managed"}}
|
{{:assign status="managed"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{* enregistrer les infos de l'immobilisation *}}
|
{{* enregistrer les infos de l'immobilisation *}}
|
||||||
{{if $_GET.op == "new"}}
|
{{if $_GET.op == "new"}}
|
||||||
|
@ -52,6 +61,8 @@
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign key=$info_immo.key}}
|
{{:assign key=$info_immo.key}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{:debug duree=$duration date=$date_debut classif=$_POST.classify status=$status}}
|
||||||
|
|
||||||
{{:save
|
{{:save
|
||||||
key=$key
|
key=$key
|
||||||
validate_schema="schema.json"
|
validate_schema="schema.json"
|
||||||
|
@ -62,8 +73,10 @@
|
||||||
status=$status
|
status=$status
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{if ! $_POST.amortir}}
|
{{if $_POST.classify == "managed"}}
|
||||||
{{:assign type_immo="autres"}}
|
{{:assign type_immo="encours"}}
|
||||||
|
{{elseif $_POST.classify == "amortized"}}
|
||||||
|
{{:assign type_immo="amortie"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign type_immo=$_GET.type_immo}}
|
{{:assign type_immo=$_GET.type_immo}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -81,31 +94,32 @@
|
||||||
|
|
||||||
{{* renseigner ou modifier la date de mise en service et la durée d'amortissement *}}
|
{{* renseigner ou modifier la date de mise en service et la durée d'amortissement *}}
|
||||||
{{if $_GET.amort == 0}}
|
{{if $_GET.amort == 0}}
|
||||||
{{:assign checked=0}}
|
|
||||||
{{:assign disabled=1}}
|
{{:assign disabled=1}}
|
||||||
|
{{:assign default=""}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign checked=1}}
|
|
||||||
{{:assign disabled=0}}
|
{{:assign disabled=0}}
|
||||||
|
{{:assign default="managed"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
<fieldset id="infos_immo">
|
<fieldset id="infos_immo">
|
||||||
<legend></legend>
|
<legend></legend>
|
||||||
<dl>
|
<dl>
|
||||||
{{if $checked}}
|
<dt><label>Faites un choix</label> <b>(obligatoire)</b></dt>
|
||||||
{{:assign helptext = "Dé-cocher pour ne pas amortir"}}
|
{{:input type="radio" name="classify" value="managed" label="Amortir" help="Amortir cette immobilisation" default=$default onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
||||||
{{else}}
|
{{:input type="radio" name="classify" value="amortized" label="Marquer amortie" help="Cette immobilisation sera classée parmi les immobilisations amorties" onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
||||||
{{:assign helptext = "Cocher pour amortir"}}
|
{{:input type="radio" name="classify" value="ignored" label="Ignorer l'écriture" help="Cette écriture n'apparaitra plus dans la liste des immobilisations" onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
||||||
{{/if}}
|
|
||||||
{{:input id="amortir" type="checkbox" value=1 name="amortir" label="Amortir" default=$checked help=$helptext onclick="toggleInputs('infos_immo','f_amortir_1')"}}
|
|
||||||
{{if $info_immo != null}}
|
{{if $info_immo != null}}
|
||||||
{{:assign date_defaut=$info_immo.date}}
|
{{:assign date_defaut=$info_immo.date}}
|
||||||
{{:assign duree_defaut=$info_immo.duration}}
|
{{:assign duree_defaut=$info_immo.duration}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign duree_defaut=1}}
|
{{:assign duree_defaut=null}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
<div id="div_inputs">
|
||||||
{{:input type="number" name="duree" label="Durée d'amortissement" default=$duree_defaut required=true min=1 disabled=$disabled}}
|
{{:input type="number" name="duree" label="Durée d'amortissement" default=$duree_defaut required=true min=1 disabled=$disabled}}
|
||||||
{{:input type="date" name="date_mes" label="Date de mise en service" default=$date_defaut disabled=$disabled help="à renseigner uniquement si différente de la date d'acquisition"}}
|
{{:input type="date" name="date_mes" label="Date de mise en service" default=$date_defaut disabled=$disabled help="à renseigner uniquement si différente de la date d'acquisition"}}
|
||||||
|
</div>
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
@ -117,19 +131,19 @@
|
||||||
|
|
||||||
{{* activer/désactiver les champs de saisie *}}
|
{{* activer/désactiver les champs de saisie *}}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function toggleInputs(idfs, idcb) {
|
function toggleInputs(idiv, idrb1, idrb2) {
|
||||||
const amortir = document.getElementById(idcb);
|
const rb1 = document.getElementById(idrb1);
|
||||||
const fs = document.getElementById(idfs);
|
const rb2 = document.getElementById(idrb2);
|
||||||
|
const fs = document.getElementById(idiv);
|
||||||
for (let field of fs.querySelectorAll("input")) {
|
for (let field of fs.querySelectorAll("input")) {
|
||||||
if (field == amortir) { continue }
|
if (! rb1.checked) {
|
||||||
if (! amortir.checked) {
|
|
||||||
field.setAttribute("disabled","disabled");
|
field.setAttribute("disabled","disabled");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
field.removeAttribute("disabled");
|
field.removeAttribute("disabled");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
Lister les écritures d'amortissement associées à une immobilisation
|
||||||
|
@param immo_id : id de la ligne d'immo
|
||||||
|
@param type_immo : encours, amortie, sortie, autres
|
||||||
|
*}}
|
||||||
|
|
||||||
{{* récupérer les infos de l'immobilisation *}}
|
{{* récupérer les infos de l'immobilisation *}}
|
||||||
{{#select
|
{{#select
|
||||||
line.id as immo_id,
|
line.id as immo_id,
|
||||||
|
@ -18,10 +24,12 @@
|
||||||
{{/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}}
|
||||||
{{:assign date_debut=$date}}
|
{{:assign date_debut=$date}}
|
||||||
|
{{:assign status=$status}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{* chercher des écritures d'amortissement liées à l'immobilisation *}}
|
{{* chercher des écritures d'amortissement liées à l'immobilisation *}}
|
||||||
|
@ -60,24 +68,70 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{:assign valeur_residuelle=$ligne_immo.montant}}
|
{{if $status == "amortized"}}
|
||||||
{{#foreach from=$linked_lines}}
|
{{:assign amort_amount=$ligne_immo.montant}}
|
||||||
|
{{:assign valeur_residuelle=0}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign valeur_residuelle=$ligne_immo.montant}}
|
||||||
|
{{#foreach from=$linked_lines}}
|
||||||
{{:assign valeur_residuelle="%d-%d"|math:$valeur_residuelle:$amort_amount}}
|
{{:assign valeur_residuelle="%d-%d"|math:$valeur_residuelle:$amort_amount}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{* Autres amortissements non rattachés *}}
|
||||||
|
{{#select
|
||||||
|
line.id as l_id,
|
||||||
|
line.id_transaction as t_id,
|
||||||
|
line.credit as amort_amount,
|
||||||
|
line.label as l_label,
|
||||||
|
trans.date as t_date,
|
||||||
|
trans.label as t_label,
|
||||||
|
trans.id_year as amort_year,
|
||||||
|
account.id as account_id,
|
||||||
|
account.code as account_code,
|
||||||
|
account.label as account_label
|
||||||
|
FROM acc_transactions_lines AS line
|
||||||
|
INNER JOIN acc_accounts AS account ON account.id = line.id_account
|
||||||
|
INNER JOIN acc_transactions AS trans ON trans.id = line.id_transaction
|
||||||
|
INNER JOIN acc_years AS y ON y.id = trans.id_year
|
||||||
|
WHERE account.code LIKE "28%" AND credit > 0 AND (NOT trans.status & 16)
|
||||||
|
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}}
|
||||||
|
{{:assign var="autres_amortissements." value=$autre_amort}}
|
||||||
|
{{/select}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
|
|
||||||
{{: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.type_immo == "fini" || $valeur_residuelle== 0 }}
|
{{if $_GET.type_immo == "amortie" || $valeur_residuelle== 0 }}
|
||||||
{{:assign subcurrent="fini"}}
|
{{:assign subcurrent="amortie"}}
|
||||||
{{elseif $_GET.type_immo == "archive"}}
|
{{elseif $_GET.type_immo == "sortie"}}
|
||||||
{{:assign subcurrent="archive"}}
|
{{:assign subcurrent="sortie"}}
|
||||||
{{elseif $_GET.type_immo == null || $_GET.type_immo == "encours"}}
|
{{elseif $_GET.type_immo == null || $_GET.type_immo == "encours"}}
|
||||||
{{:assign subcurrent="encours"}}
|
{{:assign subcurrent="encours"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign subcurrent="autres"}}
|
{{:assign subcurrent="autre"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:include file="_nav.html" current="index" subcurrent="%s"|args:$subcurrent subsubcurrent="amortization"}}
|
|
||||||
|
{{:include
|
||||||
|
file="_nav.html"
|
||||||
|
current="index"
|
||||||
|
subcurrent="%s"|args:$subcurrent
|
||||||
|
subsubcurrent="amortization"
|
||||||
|
type_immo=$_GET.type_immo
|
||||||
|
autres_amort=$autres_amortissements
|
||||||
|
}}
|
||||||
|
|
||||||
{{if $_GET.ok}}
|
{{if $_GET.ok}}
|
||||||
{{if $_GET.msg|match:"attach"}}
|
{{if $_GET.msg|match:"attach"}}
|
||||||
|
@ -97,21 +151,13 @@
|
||||||
<p class="block error">{{$msg}}</p>
|
<p class="block error">{{$msg}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $valeur_residuelle > 0}}
|
|
||||||
<nav class="tabs amort">
|
|
||||||
<aside>
|
|
||||||
{{:linkbutton label="Enregistrer un amortissement" shape="plus" href="save_amort.html?immo_id=%s"|args:$_GET.immo_id target="_dialog"}}
|
|
||||||
</aside>
|
|
||||||
</nav>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Sortir l'immobilisation du bilan ?</legend>
|
<legend>Sortir l'immobilisation du bilan ?</legend>
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Sortir du bilan"
|
label="Sortir du bilan"
|
||||||
href="balance_sheet_exit.html?immo_id=%s"|args:$_GET.immo_id
|
href="balance_sheet_exit.html?immo_id=%s&type_immo=%s"|args:$_GET.immo_id:$_GET.type_immo
|
||||||
shape="export"
|
shape="export"
|
||||||
class="main"
|
class="main"
|
||||||
}}
|
}}
|
||||||
|
@ -125,8 +171,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>
|
||||||
|
@ -135,6 +181,16 @@
|
||||||
<dt>Durée</dt>
|
<dt>Durée</dt>
|
||||||
<dd>{{$duree}} ans</dd>
|
<dd>{{$duree}} ans</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{if $valeur_residuelle > 0}}
|
||||||
|
<dt>Montant déjà amorti</dt>
|
||||||
|
<dd>{{"%d-%d"|math:$ligne_immo.montant:$valeur_residuelle|money_currency:false}}</dd>
|
||||||
|
<dt>Valeur résiduelle</dt>
|
||||||
|
<dd>{{$valeur_residuelle|money_currency}}</dd>
|
||||||
|
{{/if}}
|
||||||
|
{{if $duree != null && $valeur_residuelle > 0}}
|
||||||
|
<dt>Annuité estimée</dt>
|
||||||
|
<dd>{{"%f/%d"|math:$ligne_immo.montant:$duree|money_currency}}</dd>
|
||||||
|
{{/if}}
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<h3 class="center-block ruler">Amortissements enregistrés</h3>
|
<h3 class="center-block ruler">Amortissements enregistrés</h3>
|
||||||
|
@ -185,79 +241,15 @@
|
||||||
<p class="block alert">Aucun amortissement enregistré pour cette immobilisation</p>
|
<p class="block alert">Aucun amortissement enregistré pour cette immobilisation</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $_GET.type_immo == null || $_GET.type_immo != "fini"}}
|
{{if $_GET.type_immo == null || $_GET.type_immo != "amortie"}}
|
||||||
|
|
||||||
{{* Autres amortissements non rattachés *}}
|
{{* Autres amortissements non rattachés *}}
|
||||||
{{#select
|
|
||||||
line.id as l_id,
|
|
||||||
line.id_transaction as t_id,
|
|
||||||
line.credit as amort_amount,
|
|
||||||
line.label as l_label,
|
|
||||||
trans.date as t_date,
|
|
||||||
trans.label as t_label,
|
|
||||||
trans.id_year as amort_year,
|
|
||||||
account.id as account_id,
|
|
||||||
account.code as account_code,
|
|
||||||
account.label as account_label
|
|
||||||
FROM acc_transactions_lines AS line
|
|
||||||
INNER JOIN acc_accounts AS account ON account.id = line.id_account
|
|
||||||
INNER JOIN acc_transactions AS trans ON trans.id = line.id_transaction
|
|
||||||
INNER JOIN acc_years AS y ON y.id = trans.id_year
|
|
||||||
WHERE account.code LIKE "28%" AND credit > 0 AND (NOT trans.status & 16)
|
|
||||||
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}}
|
|
||||||
{{:assign var="autres_amortissements." value=$autre_amort}}
|
|
||||||
{{/select}}
|
|
||||||
{{/select}}
|
|
||||||
|
|
||||||
{{if $autres_amortissements != null}}
|
{{if $autres_amortissements != null}}
|
||||||
<section class="amortissement">
|
<p class="block alert">
|
||||||
<h3 class="center-block ruler">Amortissements non rattachés</h3>
|
Il existe des écritures d'amortissement qui ne sont pas rattachés à une immobilisation ! <br />
|
||||||
<table class="list">
|
Utilisez le bouton « Attacher un amortissement » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation.
|
||||||
<thead>
|
</p>
|
||||||
<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}}
|
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.amort_year}}
|
|
||||||
<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.amort_amount|money}}</td>
|
|
||||||
<td>{{if $line.l_label == null}}
|
|
||||||
{{$line.t_label}}
|
|
||||||
{{else}}
|
|
||||||
{{$line.l_label}}
|
|
||||||
{{/if}}
|
|
||||||
</td>
|
|
||||||
<td><a href={{$compte_url}}>{{$line.account_code}}</a></td>
|
|
||||||
<td>{{$line.account_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}}
|
{{/if}}
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
|
|
|
@ -53,4 +53,4 @@
|
||||||
assign_code="result_code"
|
assign_code="result_code"
|
||||||
transactions=$linked_transactions
|
transactions=$linked_transactions
|
||||||
}}
|
}}
|
||||||
{{:redirect to="amortization.html?immo_id=%s&ok=1&msg=attach&trans_id=%s"|args:$_GET.immo_id:$amort_id}}
|
{{:redirect force="amortization.html?immo_id=%s&ok=1&msg=attach&trans_id=%s"|args:$_GET.immo_id:$amort_id}}
|
||||||
|
|
|
@ -57,7 +57,11 @@
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{if $amort_line.amort_number == 0}}
|
{{if $amort_line.amort_number == 0}}
|
||||||
|
{{if $info_immo.status == "amortized"}}
|
||||||
|
{{:assign amort_amount=$ligne_immo.montant}}
|
||||||
|
{{else}}
|
||||||
{{:assign amort_amount=0}}
|
{{:assign amort_amount=0}}
|
||||||
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign amort_amount=$amort_line.amort_amount}}
|
{{:assign amort_amount=$amort_line.amort_amount}}
|
||||||
{{:assign date_debut=$amort_line.last_amort_date|strtotime}}
|
{{:assign date_debut=$amort_line.last_amort_date|strtotime}}
|
||||||
|
@ -67,19 +71,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 +148,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,10 +157,20 @@
|
||||||
{{:break}}
|
{{:break}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{* voir si des amortissements ont été oubliés *}}
|
||||||
|
{{if $info_immo.status != "amortized" && $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}}
|
||||||
|
@ -160,7 +178,7 @@
|
||||||
{{: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="balance_exit"}}
|
{{:include file="_nav.html" current="index" subcurrent="%s"|args:$_GET.type_immo subsubcurrent="balance_exit"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
<dt>Date de mise en service</dt>
|
<dt>Date de mise en service</dt>
|
||||||
<dd>{{$_GET.date_mes|date:"d/m/Y"}}</dd>
|
<dd>{{$_GET.date_mes|date:"d/m/Y"}}</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $_GET.duree_amort != null}}
|
{{if $_GET.duree_amort != null && $_GET.duree_amort != 0}}
|
||||||
<dt>Durée de l'amortissement</dt>
|
<dt>Durée de l'amortissement</dt>
|
||||||
<dd id="duree_amort" class="num">{{$_GET.duree_amort}} ans</dd>
|
<dd id="duree_amort" class="num">{{$_GET.duree_amort}} ans</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
50
confirm_action.html
Normal file
50
confirm_action.html
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{#form on="validate"}}
|
||||||
|
{{:debug get=$_GET post=$_POST}}
|
||||||
|
{{/form}}
|
||||||
|
|
||||||
|
{{:admin_header title="Confirmer"}}
|
||||||
|
{{:assign .="infos"}}
|
||||||
|
{{*:debug post=$_POST*}}
|
||||||
|
{{if $_POST.actions == "amortize"}}
|
||||||
|
{{:assign action="Marquer l'immobilisation amortie"}}
|
||||||
|
{{elseif $_POST.actions == "ignore"}}
|
||||||
|
{{:assign action="Ignorer l'écriture"}}
|
||||||
|
{{/if}}
|
||||||
|
{{:assign msg_titre="Appliquer l'opération « %s » sur les écritures : "|args:$action}}
|
||||||
|
|
||||||
|
{{:assign msg_lines=""}}
|
||||||
|
|
||||||
|
{{:admin_header title="Confirmer l'opération" custom_css="./style.css" current="module_amortissement"*}}
|
||||||
|
|
||||||
|
<form method="post" action="">
|
||||||
|
<div class="block alert">
|
||||||
|
<p>Appliquer l'opération « {{$action}} » sur les écritures :</p>
|
||||||
|
</div>
|
||||||
|
<table class="list">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td class="num">N°</td>
|
||||||
|
<td>Libellé</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{#foreach from=$_POST.check item="line"}}
|
||||||
|
<tr>
|
||||||
|
{{:assign var="label" from="_POST.label.%s"|args:$line}}
|
||||||
|
{{:assign var="trans_id" from="_POST.trans.%s"|args:$line}}
|
||||||
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
|
||||||
|
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||||
|
<td>{{$label}}</td>
|
||||||
|
</tr>
|
||||||
|
<input type="hidden" name="trans[{{$trans_id}}]" value="{{$line}}">
|
||||||
|
{{/foreach}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p class="submit">
|
||||||
|
{{:button type="submit" name="validate" label="Confirmer" shape="right" class="main"}}
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{{:admin_footer}}
|
|
@ -34,11 +34,11 @@
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{if $type_immo == "autres"}}
|
{{if $type_immo == "autre"}}
|
||||||
{{:include file="_immobilisations_autres.html"}}
|
{{:include file="_immobilisations_autres.html"}}
|
||||||
{{elseif $type_immo == "archive"}}
|
{{elseif $type_immo == "sortie"}}
|
||||||
{{:include file="_archives.html"}}
|
{{:include file="_archives.html"}}
|
||||||
{{elseif $type_immo == "encours" || $type_immo == "fini"}}
|
{{elseif $type_immo == "encours" || $type_immo == "amortie"}}
|
||||||
{{:include file="_immobilisations.html"}}
|
{{:include file="_immobilisations.html"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
112
other_amortizations.html
Normal file
112
other_amortizations.html
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
Lister les écritures d'amortissement indépendantes
|
||||||
|
et proposer des les attacher à l'immo sélectionnée
|
||||||
|
@param immo_id = id de la ligne d'immo
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{* récupérer les infos de l'immobilisation *}}
|
||||||
|
{{#select
|
||||||
|
line.id as immo_id,
|
||||||
|
line.debit as montant,
|
||||||
|
trans.id as trans_id,
|
||||||
|
trans.label as label,
|
||||||
|
trans.date
|
||||||
|
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}}
|
||||||
|
|
||||||
|
{{#select
|
||||||
|
line.id as l_id,
|
||||||
|
line.id_transaction as t_id,
|
||||||
|
line.credit as amort_amount,
|
||||||
|
line.label as l_label,
|
||||||
|
trans.date as t_date,
|
||||||
|
trans.label as t_label,
|
||||||
|
trans.id_year as amort_year,
|
||||||
|
account.id as account_id,
|
||||||
|
account.code as account_code,
|
||||||
|
account.label as account_label
|
||||||
|
FROM acc_transactions_lines AS line
|
||||||
|
INNER JOIN acc_accounts AS account ON account.id = line.id_account
|
||||||
|
INNER JOIN acc_transactions AS trans ON trans.id = line.id_transaction
|
||||||
|
INNER JOIN acc_years AS y ON y.id = trans.id_year
|
||||||
|
WHERE account.code LIKE "28%" AND credit > 0 AND (NOT trans.status & 16)
|
||||||
|
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}}
|
||||||
|
{{:assign var="autres_amortissements." value=$autre_amort}}
|
||||||
|
{{/select}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
|
{{:admin_header title="Amortissements non rattachés" custom_css="./style.css" current="module_amortissement"}}
|
||||||
|
|
||||||
|
{{* barre de navigation *}}
|
||||||
|
{{if ! $dialog}}
|
||||||
|
{{:include
|
||||||
|
file="_nav.html"
|
||||||
|
current="index"
|
||||||
|
subcurrent="autre"
|
||||||
|
subsubcurrent="amortization"
|
||||||
|
type_immo="autre"
|
||||||
|
autres_amort=$autres_amortissements
|
||||||
|
}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{if $autres_amortissements != null}}
|
||||||
|
<section class="amortissement">
|
||||||
|
<h3 class="center-block ruler">Immobilisation « {{$ligne_immo.label}} »</h3>
|
||||||
|
<table class="list">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>N°</th>
|
||||||
|
<th>Date</th>
|
||||||
|
<th class="nombre">Montant</th>
|
||||||
|
<th>Libellé</th>
|
||||||
|
<th>N° compte</th>
|
||||||
|
<th>Compte</th>
|
||||||
|
<th class="actions"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{#foreach from=$autres_amortissements item="line"}}
|
||||||
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.t_id}}
|
||||||
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.amort_year}}
|
||||||
|
<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.amort_amount|money}}</td>
|
||||||
|
<td>{{if $line.l_label == null}}
|
||||||
|
{{$line.t_label}}
|
||||||
|
{{else}}
|
||||||
|
{{$line.l_label}}
|
||||||
|
{{/if}}
|
||||||
|
</td>
|
||||||
|
<td><a href={{$compte_url}}>{{$line.account_code}}</a></td>
|
||||||
|
<td>{{$line.account_label}}</td>
|
||||||
|
<td>
|
||||||
|
{{:linkbutton label="Attacher" href="attach_amort.html?amort_id=%d&immo_id=%d"|args:$line.l_id:$_GET.immo_id shape="plus"}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{/foreach}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
{{/if}}
|
||||||
|
{{:form_errors}}
|
||||||
|
{{:admin_footer}}
|
|
@ -21,7 +21,7 @@
|
||||||
},
|
},
|
||||||
"status" : {
|
"status" : {
|
||||||
"type" : ["string", "null"],
|
"type" : ["string", "null"],
|
||||||
"enum" : ["managed", "archived", "ignored"]
|
"enum" : ["managed", "amortized", "archived", "ignored"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["type", "line", "duration", "date"]
|
"required": ["type", "line", "duration", "date"]
|
||||||
|
|
|
@ -41,3 +41,7 @@ h2[class="aide"], h3[class="aide"] {
|
||||||
nav.amort aside {
|
nav.amort aside {
|
||||||
margin-top : 0;
|
margin-top : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.describe dt::after {
|
||||||
|
content: ' :';
|
||||||
|
}
|
||||||
|
|
|
@ -260,7 +260,7 @@
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:redirect to="index.html?amort=archive"}}
|
{{:redirect to="index.html?type_immo=sortie"}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:admin_header title="Sortie du bilan" custom_css="./style.css" current="module_amortissement"}}
|
{{:admin_header title="Sortie du bilan" custom_css="./style.css" current="module_amortissement"}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue