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 class="nombre">Montant</th>
|
||||||
<th>N° compte</th>
|
<th>N° compte</th>
|
||||||
<th>Compte</th>
|
<th>Compte</th>
|
||||||
<th>Projet</th>
|
|
||||||
<th class="actions"></th>
|
<th class="actions"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
@ -54,13 +53,11 @@
|
||||||
line.debit AS debit,
|
line.debit AS debit,
|
||||||
account.id as account_id,
|
account.id as account_id,
|
||||||
account.code as account_code,
|
account.code as account_code,
|
||||||
account.label as account_label,
|
account.label as account_label
|
||||||
project.label as project_label
|
|
||||||
FROM acc_transactions AS trans
|
FROM acc_transactions AS trans
|
||||||
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
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_accounts AS account ON line.id_account = account.id
|
||||||
INNER JOIN acc_years AS years ON trans.id_year = years.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
|
WHERE !condition
|
||||||
ORDER BY trans.date DESC;
|
ORDER BY trans.date DESC;
|
||||||
!condition=$condition
|
!condition=$condition
|
||||||
|
|
@ -155,8 +152,8 @@
|
||||||
<td class="money">{{"%f"|math:$montant_immo|money_html:false|raw}}</td>
|
<td class="money">{{"%f"|math:$montant_immo|money_html:false|raw}}</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 class="actions">
|
<td class="actions">
|
||||||
|
{{:linkbutton label="Modifier" href="exit_step3.html?immo_doc_id=%s"|args:$info_immo.id shape="edit"}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
type="immo"
|
type="immo"
|
||||||
line=$_GET.immo_line_id|intval
|
line=$_GET.immo_line_id|intval
|
||||||
duration=0
|
duration=0
|
||||||
status="archived"
|
status="managed"
|
||||||
assign_new_id="immo_doc_id"
|
assign_new_id="immo_doc_id"
|
||||||
}}
|
}}
|
||||||
{{:redirect force="exit_step1.html?immo_doc_id=%s"|args:$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 *}}
|
{{* 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"}}
|
{{: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
|
chercher des écritures au crédit du compte de l'immo sans doc associé
|
||||||
- line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan
|
- line.credit < ligne_immo.amount => peut-être un avoir
|
||||||
*}}
|
- line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan
|
||||||
|
*}}
|
||||||
{{#select
|
{{#select
|
||||||
trans.id as trans_id,
|
trans.id as trans_id,
|
||||||
trans.label as trans_label,
|
trans.label as trans_label,
|
||||||
|
|
@ -51,8 +51,12 @@
|
||||||
acc.code = :acc_code
|
acc.code = :acc_code
|
||||||
AND line.credit > 0
|
AND line.credit > 0
|
||||||
AND credit_line_id NOT IN (
|
AND credit_line_id NOT IN (
|
||||||
SELECT json_extract(link.document, '$.credit_line_id') AS line_id FROM !table as link
|
SELECT json_extract(credit_link.document, '$.credit_line_id') AS line_id FROM !table as credit_link
|
||||||
WHERE json_extract(link.document, '$.type') == "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
|
:acc_code=$ligne_immo.account_code
|
||||||
!table =$module.table
|
!table =$module.table
|
||||||
|
|
@ -60,8 +64,6 @@
|
||||||
}}
|
}}
|
||||||
{{if $credit_line.amount < $solde}}
|
{{if $credit_line.amount < $solde}}
|
||||||
{{:assign var="credit_lines." value=$credit_line}}
|
{{:assign var="credit_lines." value=$credit_line}}
|
||||||
{{elseif $credit_line.amount == $solde}}
|
|
||||||
{{:assign var="exit_lines." value=$credit_line}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,16 @@
|
||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
Associer les différentes écritures à une immo créée avant la mise
|
Associer les différentes écritures à une immo créée et sortie du
|
||||||
en service du module et sortie du bilan
|
bilan avant la mise en service du module
|
||||||
@param immo_doc_id : id du doc associé à l'immobilisation
|
@param immo_doc_id : id du doc associé à l'immobilisation
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* données de 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}}
|
{{if $message != null}}
|
||||||
{{:error message=$message}}
|
{{:error message=$message}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{* voir si un document a été associé à l'immo *}}
|
|
||||||
{{#load id=$ligne_immo.line_id assign="info_immo"}}{{/load}}
|
|
||||||
|
|
||||||
{{#form on="backward"}}
|
{{#form on="backward"}}
|
||||||
{{:redirect to="exit_step1.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}}
|
{{: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 *}}
|
{{* 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"}}
|
{{: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 *}}
|
{{* déterminer le compte d'amortissement en fonction du compte d'immobilisation *}}
|
||||||
{{:include
|
{{:include
|
||||||
file="./_get_amort_code.html"
|
file="./_get_amort_code.html"
|
||||||
|
|
@ -189,6 +149,9 @@
|
||||||
<td>
|
<td>
|
||||||
{{if $line.line_label != null}}
|
{{if $line.line_label != null}}
|
||||||
{{$line.line_label}}
|
{{$line.line_label}}
|
||||||
|
{{if $line.trans_label != $line.line_label}}
|
||||||
|
— {{$line.trans_label}}
|
||||||
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{$line.trans_label}}
|
{{$line.trans_label}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
@ -203,15 +166,19 @@
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{else}}
|
{{elseif $free_amort_lines}}
|
||||||
<p class="block alert">
|
<p class="block alert">
|
||||||
Vous pouvez attacher une ou plusieurs écritures d'amortissement à l'immobilisation
|
Vous pouvez attacher une ou plusieurs écritures d'amortissement à l'immobilisation
|
||||||
</p>
|
</p>
|
||||||
|
{{else}}
|
||||||
|
<p class="block alert">
|
||||||
|
Aucune écriture d'amortissement à rattacher ; vous pouvez passer à la suite
|
||||||
|
</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<h3 class="ruler">Autres écritures d'amortissements</h3>
|
|
||||||
|
|
||||||
{{if $free_amort_lines}}
|
{{if $free_amort_lines}}
|
||||||
|
<h3 class="ruler">Autres écritures d'amortissements</h3>
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -232,8 +199,19 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$amort_url}}">#{{$line.amort_trans_id}}</a></td>
|
<td class="num"><a href="{{$amort_url}}">#{{$line.amort_trans_id}}</a></td>
|
||||||
<td>{{$line.date|date_short}}</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}}
|
{{if $line.line_label != null && $line.line_label != $line.trans_label}} — {{$line.line_label}}{{/if}}
|
||||||
|
*}}
|
||||||
</td>
|
</td>
|
||||||
<td class="money">{{"%f"|math:$line.amort_amount|money_html:false|raw}}</td>
|
<td class="money">{{"%f"|math:$line.amort_amount|money_html:false|raw}}</td>
|
||||||
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,11 @@
|
||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
Associer les différentes écritures à une immo créée avant la mise
|
Associer les différentes écritures à une immo créée et sortie du
|
||||||
en service du module et sortie du bilan
|
bilan avant la mise en service du module
|
||||||
@param immo_doc_id : id du doc associé à l'immobilisation
|
@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 *}}
|
{{* données de l'immobilisation *}}
|
||||||
{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id keep="info_immo, 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}}
|
{{if $message != null}}
|
||||||
|
|
@ -29,6 +25,10 @@
|
||||||
{{:redirect to="index.html?type_immo=archived"}}
|
{{:redirect to="index.html?type_immo=archived"}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
|
{{#form on="finish"}}
|
||||||
|
{{:redirect to="index.html?type_immo=managed"}}
|
||||||
|
{{/form}}
|
||||||
|
|
||||||
{{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}}
|
{{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}}
|
||||||
{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}}
|
{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}}
|
||||||
{{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}}
|
{{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}}
|
||||||
|
|
@ -68,11 +68,11 @@
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* chercher des écritures au crédit du compte de l'immo sans doc associé *}}
|
|
||||||
{{*
|
{{*
|
||||||
- line.credit < ligne_immo.amount => peut-être un avoir
|
chercher des écritures au crédit du compte de l'immo sans doc associé
|
||||||
- line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan
|
- line.credit < ligne_immo.amount => peut-être un avoir
|
||||||
*}}
|
- line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan
|
||||||
|
*}}
|
||||||
{{#select
|
{{#select
|
||||||
trans.id as trans_id,
|
trans.id as trans_id,
|
||||||
trans.label as trans_label,
|
trans.label as trans_label,
|
||||||
|
|
@ -103,9 +103,7 @@
|
||||||
!table =$module.table
|
!table =$module.table
|
||||||
assign="credit_line"
|
assign="credit_line"
|
||||||
}}
|
}}
|
||||||
{{if $credit_line.amount < $solde}}
|
{{if $credit_line.amount == $solde}}
|
||||||
{{:assign var="credit_lines." value=$credit_line}}
|
|
||||||
{{elseif $credit_line.amount == $solde}}
|
|
||||||
{{:assign var="exit_lines." value=$credit_line}}
|
{{:assign var="exit_lines." value=$credit_line}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
@ -233,7 +231,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{else}}
|
{{elseif $exit_lines}}
|
||||||
<p class="block alert">
|
<p class="block alert">
|
||||||
Vous pouvez attacher une écriture de sortie du bilan à l'immobilisation
|
Vous pouvez attacher une écriture de sortie du bilan à l'immobilisation
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -275,14 +273,16 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{elseif $exit_line == null}}
|
{{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}}
|
{{/if}}
|
||||||
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
{{:button type="submit" name="backward" label="Revenir à l'étape précédente" shape="left" class="main"}}
|
{{:button type="submit" name="backward" label="Revenir à l'étape précédente" shape="left" class="main"}}
|
||||||
{{if $exit_line}}
|
{{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}}
|
{{/if}}
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -78,8 +78,15 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$trans_url}}">#{{$line.trans_id}}</a></td>
|
<td class="num"><a href="{{$trans_url}}">#{{$line.trans_id}}</a></td>
|
||||||
<td>{{$line.trans_date|date_short}}</td>
|
<td>{{$line.trans_date|date_short}}</td>
|
||||||
<td>{{$line.trans_label}}
|
<td>
|
||||||
{{if $line.line_label != null && $line.line_label != $line.trans_label}} - {{$line.line_label}}{{/if}}
|
{{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>
|
||||||
<td class="money">{{"%f"|math:$line.amount|money_html:false|raw}}</td>
|
<td class="money">{{"%f"|math:$line.amount|money_html:false|raw}}</td>
|
||||||
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||||
|
|
|
||||||
|
|
@ -271,6 +271,7 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
<tr><td colspan="5"></td></tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue