Compare commits
2 commits
eae9a2f31c
...
e3bbdf7574
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e3bbdf7574 | ||
![]() |
688cada3e8 |
9 changed files with 84 additions and 57 deletions
|
@ -3,9 +3,9 @@
|
|||
{{* Liste des immobilisations en cours ou amorties *}}
|
||||
|
||||
<section class="immobilisation">
|
||||
{{if $type_immo == "encours"}}
|
||||
{{if $type_immo == "managed"}}
|
||||
<h2 class="ruler">Immobilisations en cours</h2>
|
||||
{{elseif $type_immo == "amortie"}}
|
||||
{{elseif $type_immo == "amortized"}}
|
||||
<h2 class="ruler">Immobilisations amorties</h2>
|
||||
{{/if}}
|
||||
{{:assign nb_immo=0}}
|
||||
|
@ -133,10 +133,11 @@
|
|||
|
||||
|
||||
{{* classement par onglet *}}
|
||||
{{if $type_immo == "encours" && $amort_amount >= $debit}}{{:continue}}{{/if}}
|
||||
{{if $type_immo == "encours" && $status == "amortized"}}{{:continue}}{{/if}}
|
||||
{{if $type_immo == "managed" && $amort_amount >= $debit}}{{:continue}}{{/if}}
|
||||
{{if $type_immo == "managed" && $status == "amortized"}}{{:continue}}{{/if}}
|
||||
{{if $status == "unknown" && ! $exist_amort}}{{:continue}}{{/if}}
|
||||
{{if $type_immo == "amortie" && $amort_amount < $debit && $status != "amortized"}}{{:continue}}{{/if}}
|
||||
{{if $type_immo == "amortized" && $amort_amount < $debit && $status != "amortized"}}{{:continue}}{{/if}}
|
||||
|
||||
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
||||
<tr>
|
||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||
|
@ -150,14 +151,14 @@
|
|||
{{if ! $exist_amort}}
|
||||
{{:linkbutton
|
||||
label="Paramètres"
|
||||
href="add_infos.html?immo_id=%s&amort=1&op=modif&type_immo=%s"|args:$immo_id:$type_immo
|
||||
href="add_infos.html?immo_id=%s&op=modif&type_immo=%s"|args:$immo_id:$type_immo
|
||||
shape="settings"
|
||||
target="_dialog"
|
||||
}}
|
||||
{{elseif $status == "unknown"}}
|
||||
{{:linkbutton
|
||||
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&op=new&type_immo=%s"|args:$immo_id:$type_immo
|
||||
shape="settings"
|
||||
target="_dialog"
|
||||
}}
|
||||
|
|
|
@ -6,6 +6,12 @@
|
|||
<h2 class="ruler">Autres immobilisations</h2>
|
||||
{{:assign nb_immo=0}}
|
||||
|
||||
<form method="post" action="">
|
||||
<fieldset>
|
||||
{{:input type="checkbox" value=1 name="unhide" label="Afficher les écritures marquées ignorées" }}
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -59,8 +65,14 @@
|
|||
{{else}}
|
||||
{{:assign status="unknown"}}
|
||||
{{/load}}
|
||||
{{if $status != "unknown"}}
|
||||
{{:continue}}
|
||||
{{if $_POST.unhide == null}}
|
||||
{{if $status != "unknown"}}
|
||||
{{:continue}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{if $status != "ignored" && $status != "unknown"}}
|
||||
{{:continue}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{* voir s'il existe des écritures d'amortissement associées *}}
|
||||
|
@ -88,7 +100,7 @@
|
|||
account.code LIKE '28%';
|
||||
:line_id = $immo_id|intval
|
||||
}}
|
||||
{{if $status == "unknown" && $amort_amount != null}}
|
||||
{{if $amort_amount != null}}
|
||||
{{:assign ignore=true}}
|
||||
{{else}}
|
||||
{{:assign ignore=false}}
|
||||
|
@ -111,14 +123,14 @@
|
|||
{{if $status == "unknown"}}
|
||||
{{:linkbutton
|
||||
label="Paramètres"
|
||||
href="add_infos.html?immo_id=%s&amort=0&op=new&type_immo=autre"|args:$immo_id
|
||||
href="add_infos.html?immo_id=%s&op=new&type_immo=autre"|args:$immo_id
|
||||
shape="settings"
|
||||
target="_dialog"
|
||||
}}
|
||||
{{else}}
|
||||
{{:linkbutton
|
||||
label="Paramètres"
|
||||
href="add_infos.html?immo_id=%s&amort=0&op=modif&type_immo=autre"|args:$immo_id
|
||||
href="add_infos.html?immo_id=%s&op=modif&type_immo=autre"|args:$immo_id
|
||||
shape="settings"
|
||||
target="_dialog"
|
||||
}}
|
||||
|
@ -137,3 +149,15 @@
|
|||
<p class="block alert">Aucune immobilisation</p>
|
||||
{{/if}}
|
||||
</section>
|
||||
|
||||
<script type="text/javascript">
|
||||
function changeVisibility(evt, idcheck = 'f_unhide_1') {
|
||||
this.form.dispatchEvent(new Event('submit'));
|
||||
this.form.submit();
|
||||
}
|
||||
|
||||
(function () {
|
||||
document.getElementById('f_unhide_1').onclick = changeVisibility;
|
||||
})();
|
||||
|
||||
</script>
|
||||
|
|
18
_nav.html
18
_nav.html
|
@ -1,11 +1,11 @@
|
|||
{{* -*- brindille -*- *}}
|
||||
|
||||
<nav class="tabs">
|
||||
{{if $current == 'index' && $subsubcurrent == null}}
|
||||
{{if $current == "index" && $subsubcurrent == null}}
|
||||
<aside>
|
||||
{{:linkbutton label="Ajouter une immobilisation" shape="plus" href="add_asset.html" target="_dialog"}}
|
||||
</aside>
|
||||
{{elseif $subsubcurrent == "amortization" && $type_immo == null || $type_immo == "encours" || $type_immo == "autre"}}
|
||||
{{elseif $subsubcurrent == "amortization" && $type_immo == null || $type_immo == "managed" || $type_immo == "other"}}
|
||||
<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"}}
|
||||
|
@ -15,20 +15,20 @@
|
|||
</aside>
|
||||
{{/if}}
|
||||
|
||||
{{if $current == 'index'}} {{* && $subsubcurrent != 'balance_exit' *}}
|
||||
{{if $current == "index"}} {{* && $subsubcurrent != "balance_exit" *}}
|
||||
<ul>
|
||||
<li {{if $subcurrent == 'encours'}}class="current"{{/if}}><a href="index.html?type_immo=encours">En cours</a></li>
|
||||
<li {{if $subcurrent == 'amortie'}}class="current"{{/if}}><a href="index.html?type_immo=amortie">Amorties</a></li>
|
||||
<li {{if $subcurrent == 'sortie'}}class="current"{{/if}}><a href="index.html?type_immo=sortie">Sorties du bilan</a></li>
|
||||
<li {{if $subcurrent == 'autre'}}class="current"{{/if}}><a href="index.html?type_immo=autre">Autres</a></li>
|
||||
<li {{if $subcurrent == "managed"}}class="current"{{/if}}><a href="index.html?type_immo=managed">En cours</a></li>
|
||||
<li {{if $subcurrent == "amortized"}}class="current"{{/if}}><a href="index.html?type_immo=amortized">Amorties</a></li>
|
||||
<li {{if $subcurrent == "archived"}}class="current"{{/if}}><a href="index.html?type_immo=archived">Sorties du bilan</a></li>
|
||||
<li {{if $subcurrent == "other"}}class="current"{{/if}}><a href="index.html?type_immo=other">Autres</a></li>
|
||||
</ul>
|
||||
{{/if}}
|
||||
|
||||
{{if $subsubcurrent == 'amortization'}}
|
||||
{{if $subsubcurrent == "amortization"}}
|
||||
<ul class="sub">
|
||||
<li class="title"><strong>Amortissements</strong></li>
|
||||
</ul>
|
||||
{{elseif $subsubcurrent == 'balance_exit'}}
|
||||
{{elseif $subsubcurrent == "balance_exit"}}
|
||||
<ul class="sub">
|
||||
<li class="title"><strong>Sortie de bilan</strong></li>
|
||||
</ul>
|
||||
|
|
|
@ -117,9 +117,9 @@
|
|||
status=$status
|
||||
}}
|
||||
{{if $_POST.amortir}}
|
||||
{{:assign type_immo="encours"}}
|
||||
{{:assign type_immo="managed"}}
|
||||
{{else}}
|
||||
{{:assign type_immo="autre"}}
|
||||
{{:assign type_immo="other"}}
|
||||
{{/if}}
|
||||
{{:redirect force="index.html?ok=1&msg=immobilisation&type_immo=%s"|args:$type_immo}}
|
||||
{{/form}}
|
||||
|
|
|
@ -2,15 +2,12 @@
|
|||
|
||||
{{*
|
||||
@param immo_id
|
||||
@param amort = 1 si immo amortissable, 0 si non
|
||||
@param op = new ou modif
|
||||
@param type_immo : encours, amortie, sortie, autre
|
||||
@param type_immo : managed, amortized, archived, other
|
||||
*}}
|
||||
|
||||
{{if $_GET.op == "modif"}}
|
||||
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
||||
{{/load}}
|
||||
{{/if}}
|
||||
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
||||
{{/load}}
|
||||
|
||||
{{* Traiter l'envoi du formulaire *}}
|
||||
{{#form on="save"}}
|
||||
|
@ -70,10 +67,8 @@
|
|||
status=$status
|
||||
}}
|
||||
|
||||
{{if $_POST.classify == "managed"}}
|
||||
{{:assign type_immo="encours"}}
|
||||
{{elseif $_POST.classify == "amortized"}}
|
||||
{{:assign type_immo="amortie"}}
|
||||
{{if $_POST.classify == "managed" || $_POST.classify == "amortized"}}
|
||||
{{:assign type_immo=$_POST.classify}}
|
||||
{{else}}
|
||||
{{:assign type_immo=$_GET.type_immo}}
|
||||
{{/if}}
|
||||
|
@ -89,23 +84,30 @@
|
|||
{{:include file="_nav.html" current="index"}}
|
||||
{{/if}}
|
||||
|
||||
{{* renseigner ou modifier la date de mise en service et la durée d'amortissement *}}
|
||||
{{if $_GET.amort == 0}}
|
||||
{{:assign disabled=1}}
|
||||
{{:assign default=""}}
|
||||
{{if $info_immo == null}}
|
||||
{{:assign default=$_GET.type_immo}}
|
||||
{{else}}
|
||||
{{:assign disabled=0}}
|
||||
{{:assign default="managed"}}
|
||||
{{:assign default=$info_immo.status}}
|
||||
{{/if}}
|
||||
|
||||
{{if $_GET.type_immo == "managed" || $_GET.type_immo == "amortized"}}
|
||||
{{:assign disabled=0}}
|
||||
{{else}}
|
||||
{{:assign disabled=1}}
|
||||
{{/if}}
|
||||
|
||||
{{*
|
||||
- classer l'immobilisation
|
||||
- renseigner ou modifier la date de mise en service et la durée d'amortissement
|
||||
*}}
|
||||
<form method="post" action="">
|
||||
<fieldset id="infos_immo">
|
||||
<legend></legend>
|
||||
<dl>
|
||||
<dt><label>Faites un choix</label> <b>(obligatoire)</b></dt>
|
||||
{{: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')"}}
|
||||
{{: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')"}}
|
||||
{{: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')"}}
|
||||
{{:input type="radio" name="classify" value="amortized" label="Amortissement terminé" help="Cette immobilisation sera classée parmi les immobilisations amorties" default=$default onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
||||
{{:input type="radio" name="classify" value="ignored" label="Ignorer l'écriture" help="Cette écriture n'apparaitra plus dans la liste des immobilisations" default=$default onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
||||
|
||||
{{if $info_immo != null}}
|
||||
{{:assign date_defaut=$info_immo.date}}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{{*
|
||||
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
|
||||
@param type_immo : managed, amortized, archived, others
|
||||
*}}
|
||||
|
||||
{{* récupérer les infos de l'immobilisation *}}
|
||||
|
@ -114,14 +114,14 @@
|
|||
{{:admin_header title="Liste des amortissements" custom_css="./style.css" current="module_amortissement"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{if $_GET.type_immo == "amortie" || $valeur_residuelle== 0 }}
|
||||
{{:assign subcurrent="amortie"}}
|
||||
{{elseif $_GET.type_immo == "sortie"}}
|
||||
{{:assign subcurrent="sortie"}}
|
||||
{{elseif $_GET.type_immo == null || $_GET.type_immo == "encours"}}
|
||||
{{:assign subcurrent="encours"}}
|
||||
{{if $_GET.type_immo == "amortized" || $valeur_residuelle== 0 }}
|
||||
{{:assign subcurrent="amortized"}}
|
||||
{{elseif $_GET.type_immo == "archived"}}
|
||||
{{:assign subcurrent="archived"}}
|
||||
{{elseif $_GET.type_immo == null || $_GET.type_immo == "managed"}}
|
||||
{{:assign subcurrent="managed"}}
|
||||
{{else}}
|
||||
{{:assign subcurrent="autre"}}
|
||||
{{:assign subcurrent="other"}}
|
||||
{{/if}}
|
||||
|
||||
{{:include
|
||||
|
@ -241,7 +241,7 @@
|
|||
<p class="block alert">Aucun amortissement enregistré pour cette immobilisation</p>
|
||||
{{/if}}
|
||||
|
||||
{{if $_GET.type_immo == null || $_GET.type_immo != "amortie"}}
|
||||
{{if $_GET.type_immo == null || $_GET.type_immo != "amortized"}}
|
||||
|
||||
{{* Autres amortissements non rattachés *}}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{{* barre de navigation *}}
|
||||
{{if $_GET.type_immo == null}}
|
||||
{{:assign type_immo="encours"}}
|
||||
{{:assign type_immo="managed"}}
|
||||
{{else}}
|
||||
{{:assign type_immo=$_GET.type_immo}}
|
||||
{{/if}}
|
||||
|
@ -34,11 +34,11 @@
|
|||
{{/select}}
|
||||
{{/load}}
|
||||
|
||||
{{if $type_immo == "autre"}}
|
||||
{{if $type_immo == "other"}}
|
||||
{{:include file="_immobilisations_autres.html"}}
|
||||
{{elseif $type_immo == "sortie"}}
|
||||
{{elseif $type_immo == "archived"}}
|
||||
{{:include file="_archives.html"}}
|
||||
{{elseif $type_immo == "encours" || $type_immo == "amortie"}}
|
||||
{{elseif $type_immo == "managed" || $type_immo == "amortized"}}
|
||||
{{:include file="_immobilisations.html"}}
|
||||
{{/if}}
|
||||
|
||||
|
|
|
@ -61,9 +61,9 @@
|
|||
{{:include
|
||||
file="_nav.html"
|
||||
current="index"
|
||||
subcurrent="autre"
|
||||
subcurrent="other"
|
||||
subsubcurrent="amortization"
|
||||
type_immo="autre"
|
||||
type_immo="other"
|
||||
autres_amort=$autres_amortissements
|
||||
}}
|
||||
{{/if}}
|
||||
|
|
|
@ -214,7 +214,7 @@
|
|||
|
||||
{{* barre de navigation *}}
|
||||
{{if ! $dialog}}
|
||||
{{:include file="_nav.html" current="index" subcurrent="encours" subsubcurrent="amortization"}}
|
||||
{{:include file="_nav.html" current="index" subcurrent="managed" subsubcurrent="amortization"}}
|
||||
{{/if}}
|
||||
|
||||
{{:form_errors}}
|
||||
|
|
Loading…
Add table
Reference in a new issue