Harmonisation et amélioration navigation
This commit is contained in:
parent
ab9b2a37ff
commit
e0cf555851
9 changed files with 82 additions and 101 deletions
|
@ -5,7 +5,7 @@
|
|||
<section class="immobilisation">
|
||||
{{if $type_immo == "encours"}}
|
||||
<h2 class="ruler">Immobilisations en cours</h2>
|
||||
{{elseif $type_immo == "fini"}}
|
||||
{{elseif $type_immo == "amortie"}}
|
||||
<h2 class="ruler">Immobilisations amorties</h2>
|
||||
{{/if}}
|
||||
{{:assign nb_immo=0}}
|
||||
|
@ -134,7 +134,7 @@
|
|||
|
||||
{{* classement par onglet *}}
|
||||
{{if $type_immo == "encours" && $amort_amount >= $debit ||
|
||||
$type_immo == "fini" && $amort_amount < $debit ||
|
||||
$type_immo == "amortie" && $amort_amount < $debit ||
|
||||
$amortissable == "nsp" && ! $exist_amort
|
||||
}}
|
||||
{{:continue}}
|
||||
|
|
15
_nav.html
15
_nav.html
|
@ -5,19 +5,21 @@
|
|||
<aside>
|
||||
{{:linkbutton label="Ajouter une immobilisation" shape="plus" href="add_asset.html" target="_dialog"}}
|
||||
</aside>
|
||||
{{elseif $subsubcurrent == "amortization" && $type_immo == null || $type_immo == "encours"}}
|
||||
{{elseif $subsubcurrent == "amortization" && $type_immo == null || $type_immo == "encours" || $type_immo == "autres"}}
|
||||
<aside>
|
||||
{{:linkbutton label="Attacher un amortissement" href="other_amortizations.html?immo_id=%s"|args:$_GET.immo_id shape="plus" target="_dialog"}}
|
||||
{{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 $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 == 'fini'}}class="current"{{/if}}><a href="index.html?type_immo=fini">Amorties</a></li>
|
||||
<li {{if $subcurrent == 'archive'}}class="current"{{/if}}><a href="index.html?type_immo=archive">Sorties du bilan</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 == 'autres'}}class="current"{{/if}}><a href="index.html?type_immo=autres">Autres</a></li>
|
||||
</ul>
|
||||
{{/if}}
|
||||
|
@ -27,5 +29,8 @@
|
|||
<li class="title"><strong>Amortissements</strong></li>
|
||||
</ul>
|
||||
{{elseif $subsubcurrent == 'balance_exit'}}
|
||||
<ul class="sub">
|
||||
<li class="title"><strong>Sortie de bilan</strong></li>
|
||||
</ul>
|
||||
{{/if}}
|
||||
</nav>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@param immo_id
|
||||
@param amort = 1 si immo amortissable, 0 si non
|
||||
@param op = new ou modif
|
||||
@param type_immo : encours, archive, fini, autre
|
||||
@param type_immo : encours, sortie, amortie, autre
|
||||
*}}
|
||||
|
||||
{{if $_GET.op == "modif"}}
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
{{* -*- 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 *}}
|
||||
{{#select
|
||||
line.id as immo_id,
|
||||
|
@ -65,19 +71,60 @@
|
|||
{{:assign valeur_residuelle="%d-%d"|math:$valeur_residuelle:$amort_amount}}
|
||||
{{/foreach}}
|
||||
|
||||
{{* 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"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{if $_GET.type_immo == "fini" || $valeur_residuelle== 0 }}
|
||||
{{:assign subcurrent="fini"}}
|
||||
{{elseif $_GET.type_immo == "archive"}}
|
||||
{{:assign subcurrent="archive"}}
|
||||
{{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"}}
|
||||
{{else}}
|
||||
{{:assign subcurrent="autres"}}
|
||||
{{/if}}
|
||||
{{:include file="_nav.html" current="index" subcurrent="%s"|args:$subcurrent subsubcurrent="amortization" type_immo=$_GET.type_immo}}
|
||||
|
||||
{{: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.msg|match:"attach"}}
|
||||
|
@ -97,23 +144,13 @@
|
|||
<p class="block error">{{$msg}}</p>
|
||||
{{/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="">
|
||||
<fieldset>
|
||||
<legend>Sortir l'immobilisation du bilan ?</legend>
|
||||
<p class="submit">
|
||||
{{:linkbutton
|
||||
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"
|
||||
class="main"
|
||||
}}
|
||||
|
@ -197,85 +234,15 @@
|
|||
<p class="block alert">Aucun amortissement enregistré pour cette immobilisation</p>
|
||||
{{/if}}
|
||||
|
||||
{{if $_GET.type_immo == null || $_GET.type_immo != "fini"}}
|
||||
{{if $_GET.type_immo == null || $_GET.type_immo != "amortie"}}
|
||||
|
||||
{{* 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}}
|
||||
<p class="block alert">
|
||||
Il existe des écritures d'amortissement qui ne sont pas rattachés à une immobilisation ! <br />
|
||||
Utilisez le bouton « Attacher un amortissement » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation.
|
||||
</p>
|
||||
{{*
|
||||
<section class="amortissement">
|
||||
<h3 class="center-block ruler">Amortissements non rattachés</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:$ligne_immo.immo_id shape="plus"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
*}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{:form_errors}}
|
||||
|
|
|
@ -53,4 +53,4 @@
|
|||
assign_code="result_code"
|
||||
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}}
|
||||
|
|
|
@ -158,9 +158,10 @@
|
|||
{{/form}}
|
||||
|
||||
{{:admin_header title="Sortie de bilan" custom_css="./style.css" current="module_amortissement"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{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}}
|
||||
{{:form_errors}}
|
||||
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
|
||||
{{if $type_immo == "autres"}}
|
||||
{{:include file="_immobilisations_autres.html"}}
|
||||
{{elseif $type_immo == "archive"}}
|
||||
{{elseif $type_immo == "sortie"}}
|
||||
{{:include file="_archives.html"}}
|
||||
{{elseif $type_immo == "encours" || $type_immo == "fini"}}
|
||||
{{elseif $type_immo == "encours" || $type_immo == "amortie"}}
|
||||
{{:include file="_immobilisations.html"}}
|
||||
{{/if}}
|
||||
|
||||
|
|
|
@ -55,9 +55,17 @@
|
|||
{{/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="autres" subsubcurrent="amortization"}}
|
||||
{{:include
|
||||
file="_nav.html"
|
||||
current="index"
|
||||
subcurrent="autres"
|
||||
subsubcurrent="amortization"
|
||||
type_immo="autres"
|
||||
autres_amort=$autres_amortissements
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
{{if $autres_amortissements != null}}
|
||||
|
|
|
@ -260,7 +260,7 @@
|
|||
}}
|
||||
{{/if}}
|
||||
|
||||
{{:redirect to="index.html?amort=archive"}}
|
||||
{{:redirect to="index.html?amort=sortie"}}
|
||||
{{/form}}
|
||||
|
||||
{{:admin_header title="Sortie du bilan" custom_css="./style.css" current="module_amortissement"}}
|
||||
|
|
Loading…
Add table
Reference in a new issue