Compare commits
No commits in common. "fa208c566f919c847a21017154bbfb515ecda871" and "3738ea07219e5b787d19f9157a39f4a639403a82" have entirely different histories.
fa208c566f
...
3738ea0721
@ -5,10 +5,9 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{if $current == 'index'}}
|
{{if $current == 'index'}}
|
||||||
<ul class="sub">
|
<ul class="sub">
|
||||||
<li {{if $subcurrent == 'amort'}}class="current"{{/if}}><a href="index.html?amort=1">Amortissables</a></li>
|
<li {{if $subcurrent == 'amort'}}class="current"{{/if}}><a href="index.html?amort=1">Amortissables</a></li>
|
||||||
<li {{if $subcurrent == 'fini'}}class="current"{{/if}}><a href="index.html?amort=2">Terminées</a></li>
|
<li {{if $subcurrent == 'no_amort'}}class="current"{{/if}}><a href="index.html?amort=0">Non amortissables</a></li>
|
||||||
<li {{if $subcurrent == 'no_amort'}}class="current"{{/if}}><a href="index.html?amort=0">Non amortissables</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
{{if $subsubcurrent == 'amortization'}}
|
{{if $subsubcurrent == 'amortization'}}
|
||||||
<ul class="sub">
|
<ul class="sub">
|
||||||
|
@ -3,14 +3,7 @@
|
|||||||
{{: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.fini == null || $_GET.fini == 0}}
|
{{:include file="_nav.html" current="index" subcurrent="immobilisation" subsubcurrent="amortization"}}
|
||||||
{{:assign subcurrent="amort"}}
|
|
||||||
{{elseif $_GET.fini == 1}}
|
|
||||||
{{:assign subcurrent="fini"}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign subcurrent="no_amort"}}
|
|
||||||
{{/if}}
|
|
||||||
{{:include file="_nav.html" current="index" subcurrent="%s"|args:$subcurrent subsubcurrent="amortization"}}
|
|
||||||
|
|
||||||
{{if $_GET.ok}}
|
{{if $_GET.ok}}
|
||||||
{{if $_GET.msg|match:"attach"}}
|
{{if $_GET.msg|match:"attach"}}
|
||||||
@ -149,7 +142,7 @@
|
|||||||
<td class="num"><a href={{$trans_url}}>#{{$line.amort_trans_id}}</a></td>
|
<td class="num"><a href={{$trans_url}}>#{{$line.amort_trans_id}}</a></td>
|
||||||
<td>{{$line.amort_date|date_short}}</td>
|
<td>{{$line.amort_date|date_short}}</td>
|
||||||
<td class="money">{{"%f"|math:$line.amort_amount|money}}</td>
|
<td class="money">{{"%f"|math:$line.amort_amount|money}}</td>
|
||||||
<td class="money">{{"%f"|math:$solde|money:false}}</td>
|
<td class="money">{{"%f"|math:$solde|money}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{if $line.amort_label == null}}
|
{{if $line.amort_label == null}}
|
||||||
{{$line.trans_label}}
|
{{$line.trans_label}}
|
||||||
@ -204,7 +197,7 @@
|
|||||||
<td class="num">{{"%d+1"|math:$num}}</td>
|
<td class="num">{{"%d+1"|math:$num}}</td>
|
||||||
<td>{{$date_amort|date_short}}</td>
|
<td>{{$date_amort|date_short}}</td>
|
||||||
<td class="money">{{"%f"|math:$annuite_courante|money}}</td>
|
<td class="money">{{"%f"|math:$annuite_courante|money}}</td>
|
||||||
<td class="money">{{$solde|money:false}}</td>
|
<td class="money">{{if $solde == 0}}0,00{{else}}{{"%f"|math:$solde|money}}{{/if}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{if $libelle == null}}
|
{{if $libelle == null}}
|
||||||
{{:assign libelle="Amortissement "|cat:$ligne_immo.label}}
|
{{:assign libelle="Amortissement "|cat:$ligne_immo.label}}
|
||||||
@ -231,8 +224,6 @@
|
|||||||
</section>
|
</section>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $_GET.fini == null || $_GET.fini != 1}}
|
|
||||||
|
|
||||||
{{* amortissement à exclure *}}
|
{{* amortissement à exclure *}}
|
||||||
{{:include
|
{{:include
|
||||||
file="_amort_exclus.html"
|
file="_amort_exclus.html"
|
||||||
@ -314,6 +305,6 @@
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
{{* Liste des immobilisations amortissable ou à définir *}}
|
{{* Liste des immobilisations amortissable ou à définir *}}
|
||||||
|
|
||||||
<section class="immobilisation">
|
<section class="immobilisation">
|
||||||
<h2 class="ruler">Immobilisations en cours</h2>
|
<h2 class="ruler">Liste des immobilisations</h2>
|
||||||
|
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
@ -11,8 +11,8 @@
|
|||||||
<th>N°</th>
|
<th>N°</th>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th>Libellé</th>
|
<th>Libellé</th>
|
||||||
<th class="nombre">Montant</th>
|
<th>Montant</th>
|
||||||
<th class="nombre">Durée</th>
|
<th>Durée</th>
|
||||||
<th>N° compte</th>
|
<th>N° compte</th>
|
||||||
<th>Compte</th>
|
<th>Compte</th>
|
||||||
<th>Projet</th>
|
<th>Projet</th>
|
||||||
@ -70,43 +70,23 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{* voir s'il existe des écritures d'amortissement associées *}}
|
{{* voir s'il existe des écritures d'amortissement associées *}}
|
||||||
{{#select
|
{{#select
|
||||||
sum(l_amort.credit) as amort_amount,
|
links.id_transaction,
|
||||||
CASE links.id_related = t_immo.id
|
links.id_related
|
||||||
WHEN true THEN links.id_transaction
|
FROM acc_transactions_links AS links
|
||||||
WHEN false THEN links.id_related
|
WHERE links.id_transaction = :trans_id OR links.id_related = :trans_id;
|
||||||
END as amort_trans_id
|
:trans_id=$trans_id
|
||||||
FROM acc_transactions_lines as l_immo
|
|
||||||
INNER JOIN acc_transactions as t_immo on t_immo.id = l_immo.id_transaction
|
|
||||||
INNER JOIN acc_transactions_links as links
|
|
||||||
ON (
|
|
||||||
t_immo.id = links.id_transaction
|
|
||||||
OR
|
|
||||||
t_immo.id = links.id_related
|
|
||||||
)
|
|
||||||
INNER JOIN acc_transactions_lines as l_amort on amort_trans_id = l_amort.id_transaction
|
|
||||||
WHERE
|
|
||||||
l_immo.id = :line_id
|
|
||||||
AND
|
|
||||||
l_amort.credit <> 0;
|
|
||||||
:line_id = $immo_id|intval
|
|
||||||
}}
|
}}
|
||||||
{{if $amort_amount == null}}
|
{{:assign exist_amort=true}}
|
||||||
{{:assign exist_amort=false}}
|
{{else}}
|
||||||
{{else}}
|
{{:assign exist_amort=false}}
|
||||||
{{:assign amort_amount=$amort_amount}}
|
|
||||||
{{:assign exist_amort=true}}
|
|
||||||
{{/if}}
|
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{* immo amortie ? *}}
|
{{*:debug trans_id=$trans_id trans_label=$trans_label exist_amort=$exist_amort*}}
|
||||||
{{if $amort_amount >= $debit}}
|
|
||||||
{{:continue}}
|
|
||||||
{{/if}}
|
|
||||||
<tr>
|
<tr>
|
||||||
<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>
|
||||||
<td class="money">{{"%f"|math:$debit|money}}</td>
|
<td class="money">{{"%f"|math:$debit|money}}</td>
|
||||||
<td class="money">{{if $duration != null}}{{$duration}}{{/if}}</td>
|
<td class="num">{{if $duration != null}}{{$duration}}{{/if}}</td>
|
||||||
<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>{{$project_label}}</td>
|
<td>{{$project_label}}</td>
|
||||||
|
@ -1,141 +0,0 @@
|
|||||||
{{* -*- brindille -*- *}}
|
|
||||||
|
|
||||||
{{* Liste des immobilisations totalement amorties *}}
|
|
||||||
|
|
||||||
<section class="immobilisation">
|
|
||||||
<h2 class="ruler">Immobilisations amorties</h2>
|
|
||||||
|
|
||||||
<table class="list">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>N°</th>
|
|
||||||
<th>Date</th>
|
|
||||||
<th>Libellé</th>
|
|
||||||
<th class="nombre">Montant</th>
|
|
||||||
<th class="nombre">Durée</th>
|
|
||||||
<th>N° compte</th>
|
|
||||||
<th>Compte</th>
|
|
||||||
<th>Projet</th>
|
|
||||||
<th class="actions"></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
{{* lister les immobilisations *}}
|
|
||||||
{{:read file="./defaut.json" assign="config_json"}}
|
|
||||||
{{:assign config_defaut=$config_json|json_decode}}
|
|
||||||
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
|
||||||
{{:assign quote="'"}}
|
|
||||||
{{:assign condition="("}}
|
|
||||||
{{#foreach from=$prefix_array item="code"}}
|
|
||||||
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$quote|cat:$code|cat:"%"|cat:$quote|cat:" OR "}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{:assign condition=$condition|cat:"0)"}}
|
|
||||||
|
|
||||||
{{#select
|
|
||||||
trans.id as trans_id,
|
|
||||||
trans.label as trans_label,
|
|
||||||
trans.date as trans_date,
|
|
||||||
line.id as immo_id,
|
|
||||||
account.id as account_id,
|
|
||||||
account.code as account_code,
|
|
||||||
account.label as account_label,
|
|
||||||
line.debit AS debit,
|
|
||||||
project.label as project_label,
|
|
||||||
trans.id_year as trans_id_year
|
|
||||||
FROM acc_transactions AS trans
|
|
||||||
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
|
||||||
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
|
||||||
INNER JOIN acc_years AS years ON trans.id_year = years.id
|
|
||||||
LEFT JOIN acc_projects AS project ON line.id_project = project.id
|
|
||||||
WHERE !condition
|
|
||||||
ORDER BY trans.date DESC;
|
|
||||||
!condition=$condition
|
|
||||||
}}
|
|
||||||
{{: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 duration=null}}
|
|
||||||
{{#load type="immo" where="$$.line = :line_id" :line_id=$immo_id|intval}}
|
|
||||||
{{:assign duration=$duration}}
|
|
||||||
{{if $noamort}}
|
|
||||||
{{:assign amortissable="non"}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign amortissable="oui"}}
|
|
||||||
{{/if}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign amortissable="nsp"}}
|
|
||||||
{{/load}}
|
|
||||||
{{if $amortissable == "non"}}
|
|
||||||
{{:continue}}
|
|
||||||
{{/if}}
|
|
||||||
{{* voir s'il existe des écritures d'amortissement associées *}}
|
|
||||||
{{#select
|
|
||||||
sum(l_amort.credit) as amort_amount,
|
|
||||||
CASE links.id_related = t_immo.id
|
|
||||||
WHEN true THEN links.id_transaction
|
|
||||||
WHEN false THEN links.id_related
|
|
||||||
END as amort_trans_id
|
|
||||||
FROM acc_transactions_lines as l_immo
|
|
||||||
INNER JOIN acc_transactions as t_immo on t_immo.id = l_immo.id_transaction
|
|
||||||
INNER JOIN acc_transactions_links as links
|
|
||||||
ON (
|
|
||||||
t_immo.id = links.id_transaction
|
|
||||||
OR
|
|
||||||
t_immo.id = links.id_related
|
|
||||||
)
|
|
||||||
INNER JOIN acc_transactions_lines as l_amort on amort_trans_id = l_amort.id_transaction
|
|
||||||
WHERE
|
|
||||||
l_immo.id = :line_id
|
|
||||||
AND
|
|
||||||
l_amort.credit <> 0;
|
|
||||||
:line_id = $immo_id|intval
|
|
||||||
}}
|
|
||||||
{{if $amort_amount == null}}
|
|
||||||
{{:assign exist_amort=false}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign amort_amount=$amort_amount}}
|
|
||||||
{{:assign exist_amort=true}}
|
|
||||||
{{/if}}
|
|
||||||
{{/select}}
|
|
||||||
{{* immo amortie ? *}}
|
|
||||||
{{if $amort_amount < $debit}}
|
|
||||||
{{:continue}}
|
|
||||||
{{/if}}
|
|
||||||
<tr>
|
|
||||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
|
||||||
<td>{{$trans_date|date_short}}</td>
|
|
||||||
<td>{{$trans_label}}</td>
|
|
||||||
<td class="money">{{"%f"|math:$debit|money}}</td>
|
|
||||||
<td class="money">{{if $duration != null}}{{$duration}}{{/if}}</td>
|
|
||||||
<td><a href={{$compte_url}}>{{$account_code}}</a></td>
|
|
||||||
<td>{{$account_label}}</td>
|
|
||||||
<td>{{$project_label}}</td>
|
|
||||||
<td class="actions">
|
|
||||||
{{if $duration == null}}
|
|
||||||
{{:linkbutton
|
|
||||||
label="Ajouter infos"
|
|
||||||
href="add_infos.html?immo_id=%s&amort=1"|args:$immo_id
|
|
||||||
shape="help"
|
|
||||||
target="_dialog"
|
|
||||||
}}
|
|
||||||
{{else}}
|
|
||||||
{{if ! $exist_amort}}
|
|
||||||
{{:linkbutton
|
|
||||||
label="Modifier infos"
|
|
||||||
href="modif_infos.html?immo_id=%s&amort=1"|args:$immo_id
|
|
||||||
shape="help"
|
|
||||||
target="_dialog"
|
|
||||||
}}
|
|
||||||
{{/if}}
|
|
||||||
{{:linkbutton
|
|
||||||
label="Amortissements"
|
|
||||||
href="amortization.html?immo_id=%s&fini=1"|args:$immo_id
|
|
||||||
shape="table"
|
|
||||||
}}
|
|
||||||
{{/if}}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{{/select}}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</section>
|
|
@ -11,7 +11,7 @@
|
|||||||
<th>N°</th>
|
<th>N°</th>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th>Libellé</th>
|
<th>Libellé</th>
|
||||||
<th class="nombre">Montant</th>
|
<th>Montant</th>
|
||||||
<th>N° compte</th>
|
<th>N° compte</th>
|
||||||
<th>Compte</th>
|
<th>Compte</th>
|
||||||
<th>Projet</th>
|
<th>Projet</th>
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
{{:admin_header title="Gestion des amortissements" custom_css="./style.css" current="module_amortissement"}}
|
{{:admin_header title="Gestion des amortissements" custom_css=$custom_css current="module_amortissement"}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{if $_GET.amort == null || $_GET.amort == 1}}
|
{{if $_GET.amort == null || $_GET.amort}}
|
||||||
{{:assign amort="amort"}}
|
{{:assign amort="amort"}}
|
||||||
{{elseif $_GET.amort == 2}}
|
|
||||||
{{:assign amort="fini"}}
|
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign amort="no_amort"}}
|
{{:assign amort="no_amort"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@ -39,8 +37,6 @@
|
|||||||
|
|
||||||
{{if $amort == "amort"}}
|
{{if $amort == "amort"}}
|
||||||
{{:include file="./immobilisations.html"}}
|
{{:include file="./immobilisations.html"}}
|
||||||
{{elseif $amort == "fini"}}
|
|
||||||
{{:include file="./immobilisations_achevees.html"}}
|
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:include file="./immobilisations_non.html"}}
|
{{:include file="./immobilisations_non.html"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
Loading…
Reference in New Issue
Block a user