Simplification et amélioration présentation
This commit is contained in:
parent
023a2b81bd
commit
b3aeb9b09c
7 changed files with 63 additions and 78 deletions
|
|
@ -34,7 +34,6 @@
|
|||
<th class="nombre">Montant</th>
|
||||
<th>N° compte</th>
|
||||
<th>Compte</th>
|
||||
<th>Projet</th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -54,13 +53,11 @@
|
|||
line.debit AS debit,
|
||||
account.id as account_id,
|
||||
account.code as account_code,
|
||||
account.label as account_label,
|
||||
project.label as project_label
|
||||
account.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 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
|
||||
|
|
@ -155,8 +152,8 @@
|
|||
<td class="money">{{"%f"|math:$montant_immo|money_html:false|raw}}</td>
|
||||
<td><a href="{{$compte_url}}">{{$account_code}}</a></td>
|
||||
<td>{{$account_label}}</td>
|
||||
<td>{{$project_label}}</td>
|
||||
<td class="actions">
|
||||
{{:linkbutton label="Modifier" href="exit_step3.html?immo_doc_id=%s"|args:$info_immo.id shape="edit"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/select}}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
type="immo"
|
||||
line=$_GET.immo_line_id|intval
|
||||
duration=0
|
||||
status="archived"
|
||||
status="managed"
|
||||
assign_new_id="immo_doc_id"
|
||||
}}
|
||||
{{:redirect force="exit_step1.html?immo_doc_id=%s"|args:$immo_doc_id}}
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@
|
|||
{{* 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é *}}
|
||||
{{*
|
||||
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,
|
||||
|
|
@ -51,8 +51,12 @@
|
|||
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")
|
||||
SELECT json_extract(credit_link.document, '$.credit_line_id') AS line_id FROM !table as credit_link
|
||||
WHERE json_extract(credit_link.document, '$.type') == "credit_link"
|
||||
UNION
|
||||
SELECT json_extract(exit_link.document, '$.exit_line_id') AS line_id FROM !table as exit_link
|
||||
WHERE json_extract(exit_link.document, '$.type') == "exit_link"
|
||||
)
|
||||
;
|
||||
:acc_code=$ligne_immo.account_code
|
||||
!table =$module.table
|
||||
|
|
@ -60,8 +64,6 @@
|
|||
}}
|
||||
{{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}}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
{{* -*- 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
|
||||
*}}
|
||||
|
||||
{{*
|
||||
TODO : affichage après attachement écriture sortie bilan (ligne attachée, bouton détacher)
|
||||
*}}
|
||||
|
||||
{{* données de l'immobilisation *}}
|
||||
{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id keep="info_immo, ligne_immo, message"}}
|
||||
{{if $message != null}}
|
||||
|
|
@ -29,6 +25,10 @@
|
|||
{{:redirect to="index.html?type_immo=archived"}}
|
||||
{{/form}}
|
||||
|
||||
{{#form on="finish"}}
|
||||
{{:redirect to="index.html?type_immo=managed"}}
|
||||
{{/form}}
|
||||
|
||||
{{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}}
|
||||
{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}}
|
||||
{{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}}
|
||||
|
|
@ -68,11 +68,11 @@
|
|||
{{/select}}
|
||||
{{/if}}
|
||||
|
||||
{{* chercher des écritures au crédit du compte de l'immo sans doc associé *}}
|
||||
{{*
|
||||
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,
|
||||
|
|
@ -103,9 +103,7 @@
|
|||
!table =$module.table
|
||||
assign="credit_line"
|
||||
}}
|
||||
{{if $credit_line.amount < $solde}}
|
||||
{{:assign var="credit_lines." value=$credit_line}}
|
||||
{{elseif $credit_line.amount == $solde}}
|
||||
{{if $credit_line.amount == $solde}}
|
||||
{{:assign var="exit_lines." value=$credit_line}}
|
||||
{{/if}}
|
||||
{{/select}}
|
||||
|
|
@ -233,7 +231,7 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{{else}}
|
||||
{{elseif $exit_lines}}
|
||||
<p class="block alert">
|
||||
Vous pouvez attacher une écriture de sortie du bilan à l'immobilisation
|
||||
</p>
|
||||
|
|
@ -275,14 +273,16 @@
|
|||
</tbody>
|
||||
</table>
|
||||
{{elseif $exit_line == null}}
|
||||
<p class="block alert">Aucune écriture de sortie du bilan</p>
|
||||
<p class="block alert">Aucune écriture de sortie du bilan. Vérifiez l'attachement d'écriture d'avoir.</p>
|
||||
{{/if}}
|
||||
|
||||
<form method="post" action="">
|
||||
<p class="submit">
|
||||
{{:button type="submit" name="backward" label="Revenir à l'étape précédente" shape="left" class="main"}}
|
||||
{{if $exit_line}}
|
||||
{{:button type="submit" name="validate" label="Valider" shape="check" class="main"}}
|
||||
{{:button type="submit" name="validate" label="Terminer" shape="check" class="main"}}
|
||||
{{else}}
|
||||
{{:button type="submit" name="finish" label="Terminer" shape="export" class="main"}}
|
||||
{{/if}}
|
||||
</p>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -78,8 +78,15 @@
|
|||
<tr>
|
||||
<td class="num"><a href="{{$trans_url}}">#{{$line.trans_id}}</a></td>
|
||||
<td>{{$line.trans_date|date_short}}</td>
|
||||
<td>{{$line.trans_label}}
|
||||
{{if $line.line_label != null && $line.line_label != $line.trans_label}} - {{$line.line_label}}{{/if}}
|
||||
<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}}
|
||||
</td>
|
||||
<td class="money">{{"%f"|math:$line.amount|money_html:false|raw}}</td>
|
||||
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||
|
|
|
|||
|
|
@ -271,6 +271,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
<tr><td colspan="5"></td></tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue