Compare commits
5 commits
003af639ea
...
32cb9e3b6b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32cb9e3b6b | ||
|
|
6ebfbe244e | ||
|
|
024d003696 | ||
|
|
74707a38c2 | ||
|
|
77fa5f353a |
8 changed files with 60 additions and 35 deletions
|
|
@ -86,7 +86,7 @@
|
||||||
!table_join
|
!table_join
|
||||||
WHERE !condition
|
WHERE !condition
|
||||||
GROUP BY immo_line_id
|
GROUP BY immo_line_id
|
||||||
ORDER BY trans.date DESC;
|
ORDER BY trans.date;
|
||||||
!columns=$columns
|
!columns=$columns
|
||||||
!table_join=$table_join
|
!table_join=$table_join
|
||||||
!table=$module.table
|
!table=$module.table
|
||||||
|
|
|
||||||
|
|
@ -53,17 +53,25 @@
|
||||||
{{:assign date_mes=null}}
|
{{:assign date_mes=null}}
|
||||||
{{:assign status="ignored"}}
|
{{:assign status="ignored"}}
|
||||||
{{elseif $_POST.classify == "archived"}}
|
{{elseif $_POST.classify == "archived"}}
|
||||||
|
{{* voir s'il y a déjà un doc associé à cette immo *}}
|
||||||
|
{{#load type="immo" where="$$.line = :immo_line_id" :immo_line_id=$_GET.immo_line_id|intval}}
|
||||||
|
{{:assign uuid=$key}}
|
||||||
|
{{:assign immo_doc_id=$id}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign uuid=""|uuid}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
{{* immobilisation sortie du bilan *}}
|
{{* immobilisation sortie du bilan *}}
|
||||||
{{:save
|
{{:save
|
||||||
key=""|uuid
|
key=$uuid
|
||||||
validate_schema="asset.schema.json"
|
validate_schema="asset.schema.json"
|
||||||
type="immo"
|
type="immo"
|
||||||
line=$_GET.immo_line_id|intval
|
line=$_GET.immo_line_id|intval
|
||||||
duration=0
|
duration=0
|
||||||
status="managed"
|
status=null
|
||||||
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&from=exit"|args:$immo_doc_id}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{* immobilisation amortissable *}}
|
{{* immobilisation amortissable *}}
|
||||||
{{if $_POST.date_achat|parse_date > $ligne_immo.date_achat}}
|
{{if $_POST.date_achat|parse_date > $ligne_immo.date_achat}}
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,12 @@
|
||||||
{{:error message="Le montant de l'amortissement (%s) dépasse la valeur résiduelle de l'immobilisation (%s)"|args:$ma:$vnc}}
|
{{:error message="Le montant de l'amortissement (%s) dépasse la valeur résiduelle de l'immobilisation (%s)"|args:$ma:$vnc}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
supprimer les documents qui pointent sur une ligne d'amortissement absente
|
||||||
|
cas de la suppression manuelle d'un amortissement
|
||||||
|
*}}
|
||||||
|
{{:include file="_remove_orphan_docs.tpl"}}
|
||||||
|
|
||||||
{{* Lier l'écriture d'amortissement à l'écriture d'immobilisation *}}
|
{{* Lier l'écriture d'amortissement à l'écriture d'immobilisation *}}
|
||||||
{{:include file="_common_attach.html" immo_doc_id=$_GET.immo_doc_id trans_id=$amort_line.trans_id}}
|
{{:include file="_common_attach.html" immo_doc_id=$_GET.immo_doc_id trans_id=$amort_line.trans_id}}
|
||||||
|
|
||||||
|
|
@ -114,8 +120,8 @@
|
||||||
}}
|
}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{* À VÉRIFIER immo soldée ? *}}
|
{{* immo soldée ? *}}
|
||||||
{{if $total_amort == $montant_immo}}
|
{{if $total_amort == $montant_immo && $_GET.from != "exit"}}
|
||||||
{{:assign status="amortized"}}
|
{{:assign status="amortized"}}
|
||||||
{{:save
|
{{:save
|
||||||
key=$info_immo.key
|
key=$info_immo.key
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,12 @@
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
||||||
{{:include file="_nav.html" current="archived" subcurrent="exit"}}
|
{{if $_GET.from == "exit"}}
|
||||||
|
{{:assign current="other"}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign current="archived"}}
|
||||||
|
{{/if}}
|
||||||
|
{{:include file="_nav.html" current=$current subcurrent="exit"}}
|
||||||
|
|
||||||
{{if $_GET.ok}}
|
{{if $_GET.ok}}
|
||||||
{{if $_GET.msg|match:"attach_avoir"}}
|
{{if $_GET.msg|match:"attach_avoir"}}
|
||||||
|
|
@ -233,7 +238,7 @@
|
||||||
</table>
|
</table>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<form method="post" action="exit_step2.html?immo_doc_id={{$_GET.immo_doc_id}}">
|
<form method="post" action="exit_step2.html?immo_doc_id={{$_GET.immo_doc_id}}&from={{$_GET.from}}">
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
{{:button type="submit" name="proceed" label="Poursuivre" shape="right" class="main"}}
|
{{:button type="submit" name="proceed" label="Poursuivre" shape="right" class="main"}}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,11 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#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&from=%s"|args:$_GET.immo_doc_id:$_GET.from}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{#form on="forward"}}
|
{{#form on="forward"}}
|
||||||
{{:redirect to="exit_step3.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}}
|
{{:redirect to="exit_step3.html?immo_doc_id=%s&from=%s"|args:$_GET.immo_doc_id:$_GET.from}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}}
|
{{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}}
|
||||||
|
|
@ -90,7 +90,12 @@
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
||||||
{{:include file="_nav.html" current="archived" subcurrent="exit"}}
|
{{if $_GET.from == "exit"}}
|
||||||
|
{{:assign current="other"}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign current="archived"}}
|
||||||
|
{{/if}}
|
||||||
|
{{:include file="_nav.html" current=$current subcurrent="exit"}}
|
||||||
|
|
||||||
{{if $_GET.ok}}
|
{{if $_GET.ok}}
|
||||||
{{if $_GET.msg|match:"attach_amort"}}
|
{{if $_GET.msg|match:"attach_amort"}}
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,11 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#form on="backward"}}
|
{{#form on="backward"}}
|
||||||
{{:redirect to="exit_step2.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}}
|
{{:redirect to="exit_step2.html?immo_doc_id=%s&from=%s"|args:$_GET.immo_doc_id:$_GET.from}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{#form on="forward"}}
|
{{#form on="forward"}}
|
||||||
{{:redirect to="exit_step4.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}}
|
{{:redirect to="exit_step4.html?immo_doc_id=%s&from=%s"|args:$_GET.immo_doc_id:$_GET.from}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}}
|
{{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}}
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
assign="line"
|
assign="line"
|
||||||
}}
|
}}
|
||||||
{{* voir si l'écriture de cession est déjà liée à une immo *}}
|
{{* voir si l'écriture de cession est déjà liée à une immo *}}
|
||||||
{{* TODO VOIR SI TUTILE
|
{{* TODO VOIR SI UTILE
|
||||||
{{#load type="cession_link"
|
{{#load type="cession_link"
|
||||||
where="$$.cession_line_id = :cession_line_id"
|
where="$$.cession_line_id = :cession_line_id"
|
||||||
:cession_line_id = $line.line_id
|
:cession_line_id = $line.line_id
|
||||||
|
|
@ -95,7 +95,12 @@
|
||||||
{{*:debug linked_cessions=$linked_cessions free_cessions=$free_cessions total_cession=$total_cession*}}
|
{{*:debug linked_cessions=$linked_cessions free_cessions=$free_cessions total_cession=$total_cession*}}
|
||||||
|
|
||||||
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
||||||
{{:include file="_nav.html" current="archived" subcurrent="exit"}}
|
{{if $_GET.from == "exit"}}
|
||||||
|
{{:assign current="other"}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign current="archived"}}
|
||||||
|
{{/if}}
|
||||||
|
{{:include file="_nav.html" current=$current subcurrent="exit"}}
|
||||||
|
|
||||||
{{if $_GET.ok}}
|
{{if $_GET.ok}}
|
||||||
{{if $_GET.msg|match:"attach_cession"}}
|
{{if $_GET.msg|match:"attach_cession"}}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#form on="backward"}}
|
{{#form on="backward"}}
|
||||||
{{:redirect to="exit_step3.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}}
|
{{:redirect to="exit_step3.html?immo_doc_id=%s&from=%s"|args:$_GET.immo_doc_id:$_GET.from}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{#form on="validate"}}
|
{{#form on="validate"}}
|
||||||
|
|
@ -164,7 +164,12 @@
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
||||||
{{:include file="_nav.html" current="archived" subcurrent="exit"}}
|
{{if $_GET.from == "exit"}}
|
||||||
|
{{:assign current="other"}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign current="archived"}}
|
||||||
|
{{/if}}
|
||||||
|
{{:include file="_nav.html" current=$current subcurrent="exit"}}
|
||||||
|
|
||||||
{{if $_GET.ok}}
|
{{if $_GET.ok}}
|
||||||
{{if $_GET.msg|match:"attach_exit"}}
|
{{if $_GET.msg|match:"attach_exit"}}
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,12 @@
|
||||||
{{:error message="Le montant indiqué « %s » dépasse le solde à amortir « %s »"|args:$montant:$solde}}
|
{{:error message="Le montant indiqué « %s » dépasse le solde à amortir « %s »"|args:$montant:$solde}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
supprimer les documents qui pointent sur une ligne d'amortissement absente
|
||||||
|
cas de la suppression manuelle d'un amortissement
|
||||||
|
*}}
|
||||||
|
{{:include file="_remove_orphan_docs.tpl"}}
|
||||||
|
|
||||||
{{* enregistrer l'écriture *}}
|
{{* enregistrer l'écriture *}}
|
||||||
{{:assign
|
{{:assign
|
||||||
var="lines."
|
var="lines."
|
||||||
|
|
@ -161,7 +167,6 @@
|
||||||
account=$credit_account|keys|value:0
|
account=$credit_account|keys|value:0
|
||||||
id_project=$ligne_immo.id_project
|
id_project=$ligne_immo.id_project
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{:api
|
{{:api
|
||||||
method="POST"
|
method="POST"
|
||||||
path="accounting/transaction"
|
path="accounting/transaction"
|
||||||
|
|
@ -178,20 +183,6 @@
|
||||||
{{* enregistrer la liaison des lignes *}}
|
{{* enregistrer la liaison des lignes *}}
|
||||||
{{#foreach from=$result.lines item="line"}}
|
{{#foreach from=$result.lines item="line"}}
|
||||||
{{if $line.account_code == $credit_account|keys|value:0}}
|
{{if $line.account_code == $credit_account|keys|value:0}}
|
||||||
{{* TODO VOIR SI CORRECT ET UTILE *}}
|
|
||||||
{{*
|
|
||||||
vérifier la présence d'un doc avec cette ligne d'amortissement
|
|
||||||
(cas de la suppression manuelle d'un amortissement)
|
|
||||||
*}}
|
|
||||||
|
|
||||||
{{#load type="amort_link" where="$$.amort_line_id = :amort_line_id" :amort_line_id=$line.id debug=true assign="info_amort"}}
|
|
||||||
{{:debug info_amort=$info_amort}}
|
|
||||||
{{:assign uuid=$key}}
|
|
||||||
{{:break}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign uuid=""|uuid}}
|
|
||||||
{{/load}}
|
|
||||||
{{:debug uuid=$uuid}}
|
|
||||||
{{:save
|
{{:save
|
||||||
key=""|uuid
|
key=""|uuid
|
||||||
type="amort_link"
|
type="amort_link"
|
||||||
|
|
@ -205,14 +196,14 @@
|
||||||
|
|
||||||
{{* immo soldée ? *}}
|
{{* immo soldée ? *}}
|
||||||
{{if $_POST.montant|trim|money_int == $solde}}
|
{{if $_POST.montant|trim|money_int == $solde}}
|
||||||
{{:assign var="info_immo.status" value="amortized"}}
|
{{:assign status="amortized"}}
|
||||||
{{:save
|
{{:save
|
||||||
key=$info_immo.key
|
key=$info_immo.key
|
||||||
status=$info_immo.status
|
status=$status
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:redirect force="amortization.html?immo_doc_id=%s&type_immo=%s&ok=1&msg=amortissement"|args:$_GET.immo_doc_id:$info_immo.status}}
|
{{:redirect force="amortization.html?immo_doc_id=%s&type_immo=%s&ok=1&msg=amortissement"|args:$_GET.immo_doc_id:$status}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:admin_header title="Ajout amortissement" custom_css="./style.css" current="module_amortization"}}
|
{{:admin_header title="Ajout amortissement" custom_css="./style.css" current="module_amortization"}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue