Simplification et amélioration présentation
This commit is contained in:
parent
023a2b81bd
commit
b3aeb9b09c
7 changed files with 63 additions and 78 deletions
|
|
@ -1,18 +1,16 @@
|
|||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{*
|
||||
Associer les différentes écritures à une immo créée avant la mise
|
||||
en service du module et sortie du bilan
|
||||
Associer les différentes écritures à une immo créée et sortie du
|
||||
bilan avant la mise en service du module
|
||||
@param immo_doc_id : id du doc associé à l'immobilisation
|
||||
*}}
|
||||
|
||||
{{* données de l'immobilisation *}}
|
||||
{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id keep="ligne_immo, message"}}
|
||||
{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id keep="info_immo, ligne_immo, message"}}
|
||||
{{if $message != null}}
|
||||
{{:error message=$message}}
|
||||
{{/if}}
|
||||
{{* voir si un document a été associé à l'immo *}}
|
||||
{{#load id=$ligne_immo.line_id assign="info_immo"}}{{/load}}
|
||||
|
||||
{{#form on="backward"}}
|
||||
{{:redirect to="exit_step1.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}}
|
||||
|
|
@ -37,44 +35,6 @@
|
|||
{{* lister les amortissements liés à l'immobilisation *}}
|
||||
{{:include file="./_get_amort_lines.html" immo_doc_id=$_GET.immo_doc_id keep="linked_amort, total_amort"}}
|
||||
|
||||
{{*
|
||||
chercher des écritures au crédit du compte de l'immo sans doc associé
|
||||
- line.credit < ligne_immo.amount => peut-être un avoir
|
||||
- line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan
|
||||
*}}
|
||||
{{#select
|
||||
trans.id as trans_id,
|
||||
trans.label as trans_label,
|
||||
trans.date as date,
|
||||
trans.id_year as year,
|
||||
line.id as credit_line_id,
|
||||
line.label as line_label,
|
||||
line.credit as amount,
|
||||
acc.id as account_id,
|
||||
acc.code as account_code,
|
||||
acc.label as account_label
|
||||
FROM acc_transactions AS trans
|
||||
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
||||
INNER JOIN acc_accounts AS acc ON line.id_account = acc.id
|
||||
LEFT JOIN module_data_amortization AS mda ON json_extract(mda.document, '$.amort_line_id') = line.id
|
||||
WHERE
|
||||
acc.code = :acc_code
|
||||
AND line.credit > 0
|
||||
AND credit_line_id NOT IN (
|
||||
SELECT json_extract(link.document, '$.credit_line_id') AS line_id FROM !table as link
|
||||
WHERE json_extract(link.document, '$.type') == "credit_link")
|
||||
;
|
||||
:acc_code=$ligne_immo.account_code
|
||||
!table =$module.table
|
||||
assign="credit_line"
|
||||
}}
|
||||
{{if $credit_line.amount < $solde}}
|
||||
{{:assign var="credit_lines." value=$credit_line}}
|
||||
{{elseif $credit_line.amount == $solde}}
|
||||
{{:assign var="exit_lines." value=$credit_line}}
|
||||
{{/if}}
|
||||
{{/select}}
|
||||
|
||||
{{* déterminer le compte d'amortissement en fonction du compte d'immobilisation *}}
|
||||
{{:include
|
||||
file="./_get_amort_code.html"
|
||||
|
|
@ -189,6 +149,9 @@
|
|||
<td>
|
||||
{{if $line.line_label != null}}
|
||||
{{$line.line_label}}
|
||||
{{if $line.trans_label != $line.line_label}}
|
||||
— {{$line.trans_label}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{$line.trans_label}}
|
||||
{{/if}}
|
||||
|
|
@ -203,15 +166,19 @@
|
|||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{else}}
|
||||
{{elseif $free_amort_lines}}
|
||||
<p class="block alert">
|
||||
Vous pouvez attacher une ou plusieurs écritures d'amortissement à l'immobilisation
|
||||
</p>
|
||||
{{else}}
|
||||
<p class="block alert">
|
||||
Aucune écriture d'amortissement à rattacher ; vous pouvez passer à la suite
|
||||
</p>
|
||||
{{/if}}
|
||||
|
||||
<h3 class="ruler">Autres écritures d'amortissements</h3>
|
||||
|
||||
{{if $free_amort_lines}}
|
||||
<h3 class="ruler">Autres écritures d'amortissements</h3>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -232,8 +199,19 @@
|
|||
<tr>
|
||||
<td class="num"><a href="{{$amort_url}}">#{{$line.amort_trans_id}}</a></td>
|
||||
<td>{{$line.date|date_short}}</td>
|
||||
<td>{{$line.trans_label}}
|
||||
<td>
|
||||
{{if $line.line_label != null}}
|
||||
{{$line.line_label}}
|
||||
{{if $line.trans_label != $line.line_label}}
|
||||
— {{$line.trans_label}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{$line.trans_label}}
|
||||
{{/if}}
|
||||
{{*
|
||||
{{$line.trans_label}}
|
||||
{{if $line.line_label != null && $line.line_label != $line.trans_label}} — {{$line.line_label}}{{/if}}
|
||||
*}}
|
||||
</td>
|
||||
<td class="money">{{"%f"|math:$line.amort_amount|money_html:false|raw}}</td>
|
||||
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue