Simplification navigation

This commit is contained in:
Jean-Christophe Engel 2026-06-15 12:13:24 +02:00
parent a99bcc1753
commit 7903afbd0c
15 changed files with 84 additions and 84 deletions

View file

@ -1,55 +1,31 @@
{{* -*- brindille -*- *}}
<nav class="tabs">
{{if $current == "index" && $subcurrent != "unfinished" && $subsubcurrent == null}}
<aside>
{{:linkbutton label="Ajouter une immobilisation" shape="plus" href="add_asset.html"}}
</aside>
{{elseif $current == "index" && $subcurrent == "details"}}
<aside>
{{if $subsubcurrent|match:"credit"}}
{{:linkbutton label="Rattacher une écriture d'immobilisation" href="link_immo.html?immo_doc_id=%s"|args:$_GET.immo_doc_id shape="link" target="_dialog"}}
{{/if}}
{{if $subsubcurrent|match:"modif"}}
{{:linkbutton label="Modifier" href="modify_infos.html?immo_doc_id=%s"|args:$_GET.immo_doc_id shape="edit" target="_dialog"}}
{{/if}}
</aside>
{{elseif $subsubcurrent == "amortization" && $type_immo == null || $type_immo == "managed" || $type_immo == "other"}}
<aside>
{{if $autres_amort}}
{{:linkbutton
label="Rattacher un amortissement"
title="Rattacher un amortissement existant"
href="other_amortizations.html?immo_doc_id=%s"|args:$_GET.immo_doc_id
shape="link"
target="_dialog"}}
{{/if}}
{{:linkbutton
label="Enregistrer un amortissement"
title="Enregistrer un nouvel amortissement"
href="save_amort.html?immo_doc_id=%s"|args:$_GET.immo_doc_id target="_dialog"
shape="plus"
}}
{{if $subcurrent == null}}
{{if $current == "managed" || $current == "amortized" || $current == "archived"}}
<aside>
{{:linkbutton label="Ajouter une immobilisation" shape="plus" href="add_asset.html"}}
</aside>
{{/if}}
{{/if}}
<ul>
<li {{if $subcurrent == "managed"}}class="current"{{/if}}><a href="index.html?type_immo=managed">Amortissables</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 == "unfinished"}}class="current"{{/if}}><a href="index.html?type_immo=unfinished">En cours</a></li>
<li {{if $subcurrent == "other"}}class="current"{{/if}}><a href="index.html?type_immo=other">À classer</a></li>
<li {{if $current == "managed"}}class="current"{{/if}}><a href="index.html?type_immo=managed">Amortissables</a></li>
<li {{if $current == "amortized"}}class="current"{{/if}}><a href="index.html?type_immo=amortized">Amorties</a></li>
<li {{if $current == "archived"}}class="current"{{/if}}><a href="index.html?type_immo=archived">Sorties du bilan</a></li>
<li {{if $current == "unfinished"}}class="current"{{/if}}><a href="index.html?type_immo=unfinished">En cours</a></li>
<li {{if $current == "other"}}class="current"{{/if}}><a href="index.html?type_immo=other">À classer</a></li>
<li {{if $current == "config"}} class="current"{{/if}}><a href="config.html">Configuration</a></li>
</ul>
{{if $subsubcurrent != null}}
{{if $subcurrent != null}}
<ul class="sub">
{{if $subsubcurrent == "amortization"}}
<li class="title strong">Amortissements</li>
{{elseif $subsubcurrent == "balance_exit"}}
<li class="title strong">Sortie de bilan</li>
{{elseif $subsubcurrent == "transfer"}}
{{if $subcurrent == "transfer"}}
<li class="title strong">Transfert d'immobilisations</li>
{{elseif $subcurrent == "balance_exit"}}
<li class="title strong">Sortie de bilan</li>
{{elseif $subcurrent == "details"}}
<li class="title strong">Détails</li>
{{/if}}
</ul>
{{/if}}

View file

@ -161,7 +161,7 @@
{{:admin_header title="Ajout immobilisation" current="module_amortization"}}
{{* barre de navigation *}}
{{if ! $dialog}}
{{:include file="_nav.html" current="index" subcurrent="managed"}}
{{:include file="_nav.html" current="managed" subcurrent="add_asset"}}
{{/if}}
{{:form_errors}}

View file

@ -151,7 +151,7 @@
{{:admin_header title="Classer l'immobilisation" custom_css="./style.css" current="module_amortization"}}
{{* barre de navigation *}}
{{if ! $dialog}}
{{:include file="_nav.html" current="index" subcurrent="other" subsubcurrent="parameter"}}
{{:include file="_nav.html" current="other" subcurrent="parameter"}}
{{/if}}
{{:form_errors}}

View file

@ -42,24 +42,23 @@
{{:include file="./_get_free_amort.html" filter_condition=$filter_condition keep="free_amort_lines"}}
{{/if}}
{{:admin_header title="Liste des amortissements" custom_css="./style.css" current="module_amortization"}}
{{:admin_header title="Détails de l'immobilisation" custom_css="./style.css" current="module_amortization"}}
{{* barre de navigation *}}
{{if $_GET.type_immo == "amortized" || $valeur_residuelle== 0 }}
{{:assign subcurrent="amortized"}}
{{if $_GET.type_immo == "amortized" || $valeur_residuelle == 0 }}
{{:assign current="amortized"}}
{{elseif $_GET.type_immo == "archived"}}
{{:assign subcurrent="archived"}}
{{:assign current="archived"}}
{{elseif $_GET.type_immo == null || $_GET.type_immo == "managed"}}
{{:assign subcurrent="managed"}}
{{:assign current="managed"}}
{{else}}
{{:assign subcurrent="other"}}
{{:assign current="other"}}
{{/if}}
{{:include
file="_nav.html"
current="index"
subcurrent="%s"|args:$subcurrent
subsubcurrent="amortization"
current="%s"|args:$current
subcurrent="details"
type_immo=$_GET.type_immo
autres_amort=$free_amort_lines
}}
@ -136,14 +135,6 @@
<dt>Montant à amortir</dt>
<dd class="money strong">{{"%f"|math:$solde|money_currency_html:false|raw}}</dd>
{{/if}}
<dt>Montant de l'immobilisation</dt>
<dd class="money">{{"%f"|math:$ligne_immo.montant|money_currency_html:false|raw}}</dd>
{{if $total_credits > 0}}
<dt>Montant des avoirs</dt>
<dd class="money">{{"%f"|math:$total_credits|money_currency_html:false|raw}}</dd>
<dt>Montant à amortir</dt>
<dd class="money">{{"%f"|math:$montant_amortissable|money_currency_html:false|raw}}</dd>
{{/if}}
{{if $valeur_residuelle > 0}}
<dt>Montant des amortissements</dt>
<dd>{{$total_amort|money_currency_html:false|raw}}</dd>
@ -202,12 +193,14 @@
shape="link"
target="_dialog"}}
{{/if}}
{{:linkbutton
label="Enregistrer un amortissement"
title="Enregistrer un nouvel amortissement"
href="save_amort.html?immo_doc_id=%s"|args:$_GET.immo_doc_id target="_dialog"
shape="plus"
{{if $valeur_residuelle > 0}}
{{:linkbutton
label="Enregistrer un amortissement"
title="Enregistrer un nouvel amortissement"
href="save_amort.html?immo_doc_id=%s"|args:$_GET.immo_doc_id target="_dialog"
shape="plus"
}}
{{/if}}
</nav>
{{if $linked_amort != null}}

View file

@ -134,7 +134,7 @@
{{* barre de navigation *}}
{{if ! $dialog}}
{{:include file="_nav.html" current="config" subcurrent="init" subsubcurrent="parameter"}}
{{:include file="_nav.html" current="managed" subcurrent="attach_amort"}}
{{/if}}
{{:form_errors}}

View file

@ -115,9 +115,8 @@
{{if ! $dialog}}
{{:include
file="_nav.html"
current="config"
subcurrent="other"
subsubcurrent="immo"
current="managed"
subcurrent="attach_credit"
type_immo="other"
}}
{{/if}}

View file

@ -10,6 +10,12 @@
{{if $message != null}}
{{:error message=$message}}
{{/if}}
{{* TODO VÉRIFIER SI UTILE *}}
{{*
{{if $info_immo.duration == null || $info_immo.duration == 0}}
{{:error message="Vous devez renseigner la durée d'amortissement au préalable"}}
{{/if}}
*}}
{{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}}
{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}}
@ -135,7 +141,7 @@
{{:admin_header title="Sortie de bilan" custom_css="./style.css" current="module_amortization"}}
{{if ! $dialog}}
{{:include file="_nav.html" current="index" subcurrent="%s"|args:$_GET.type_immo subsubcurrent="balance_exit"}}
{{:include file="_nav.html" current="%s"|args:$_GET.type_immo subcurrent="balance_exit"}}
{{/if}}
{{:form_errors}}

View file

@ -9,7 +9,9 @@
@param date_debut : date de début de la période d'amortissement complémentaire
@param exit_date : date de sortie de l'immobilisation
*}}
{{* TODO *}}
{{* TODO boutons de navigation avant-arrière*}}
{{* données de l'immobilisation *}}
{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id|intval keep="info_immo, ligne_immo, message"}}
{{if $message != null}}
@ -58,7 +60,12 @@
{{* barre de navigation *}}
{{if ! $dialog}}
{{:include file="_nav.html" current="index" subcurrent="balance_exit"}}
{{if $valeur_nette > 0}}
{{:assign type_immo="managed"}}
{{else}}
{{:assign type_immo="amortized"}}
{{/if}}
{{:include file="_nav.html" current="%s"|args:$type_immo subcurrent="balance_exit"}}
{{/if}}
{{:form_errors}}

View file

@ -19,7 +19,7 @@
{{:admin_header title="Immobilisations en cours de constitution" custom_css="./style.css" current="module_amortization" subcurrent="unfinished"}}
{{/if}}
{{:include file="_nav.html" current="index" subcurrent=$type_immo}}
{{:include file="_nav.html" current=$type_immo}}
{{if $_GET.ok}}
{{if $_GET.msg|match:"immobilisation"}}

View file

@ -51,9 +51,8 @@
{{if ! $dialog}}
{{:include
file="_nav.html"
current="config"
subcurrent="other"
subsubcurrent="immo"
current="managed"
subcurrent="link_immo"
type_immo="other"
}}
{{/if}}

View file

@ -153,7 +153,7 @@
{{:admin_header title="Modifier l'immobilisation" custom_css="./style.css" current="module_amortization"}}
{{if ! $dialog}}
{{:include file="_nav.html" current="index" subcurrent="%s"|args:$_GET.type_immo subsubcurrent="parameter"}}
{{:include file="_nav.html" current="managed" subcurrent="modify_infos"}}
{{/if}}
{{:form_errors}}

View file

@ -38,9 +38,8 @@
{{if ! $dialog}}
{{:include
file="_nav.html"
current="index"
subcurrent="managed"
subsubcurrent="amortization"
current="managed"
subcurrent="amortization"
type_immo="managed"
autres_amort=$free_amort_lines
}}

View file

@ -65,7 +65,7 @@
*}}
{{:assign msg_years=""}}
{{#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 $total_amort == 0}}
{{:assign ts_debut=$date_debut|strtotime}}
{{else}}
@ -178,6 +178,20 @@
{{* enregistrer la liaison des lignes *}}
{{#foreach from=$result.lines item="line"}}
{{if $line.account_code == $credit_account|keys|value:0}}
{{* TODO VOIR SI CORRECT ET UTILE *}}
{{*
vérifier la présence d'un doc avec cette ligne d'amortissement
(cas de la suppression manuelle d'un amortissement)
*}}
{{#load type="amort_link" where="$$.amort_line_id = :amort_line_id" :amort_line_id=$line.id debug=true assign="info_amort"}}
{{:debug info_amort=$info_amort}}
{{:assign uuid=$key}}
{{:break}}
{{else}}
{{:assign uuid=""|uuid}}
{{/load}}
{{:debug uuid=$uuid}}
{{:save
key=""|uuid
type="amort_link"
@ -205,12 +219,14 @@
{{* barre de navigation *}}
{{if ! $dialog}}
{{:include file="_nav.html" current="index" subcurrent="managed" subsubcurrent="amortization"}}
{{:include file="_nav.html" current="managed" subcurrent="amortization"}}
{{/if}}
{{:form_errors}}
{{:assign var=selected_year value=$years.0.id}}
{{if $years|count == 1}}
{{:assign var=selected_year value=$years.0.id}}
{{/if}}
{{:assign var=date_amort value=$years.0.end_date}}
{{:include file="_calcul_dates.html" date_debut=$date_debut date_fin=$date_amort keep="nbjours"}}

View file

@ -192,7 +192,7 @@
{{:admin_header title="Transfert d'immobilisation en cours" custom_css="./style.css" current="module_amortization"}}
{{if ! $dialog}}
{{:include file="_nav.html" current="index" subcurrent="unfinished" subsubcurrent="transfer"}}
{{:include file="_nav.html" current="unfinished" subcurrent="transfer"}}
{{/if}}
{{:form_errors}}

View file

@ -267,7 +267,12 @@
{{:admin_header title="Sortie du bilan" custom_css="./style.css" current="module_amortization"}}
{{if ! $dialog}}
{{:include file="_nav.html" current="index" subcurrent="balance_exit"}}
{{if $valeur_nette > 0}}
{{:assign type_immo="managed"}}
{{else}}
{{:assign type_immo="amortized"}}
{{/if}}
{{:include file="_nav.html" current="%s"|args:$type_immo subcurrent="balance_exit"}}
{{/if}}
{{*