Ajout suppression doc orphelins (attach_amort, save_amort)
This commit is contained in:
parent
003af639ea
commit
77fa5f353a
2 changed files with 16 additions and 19 deletions
|
|
@ -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,7 +120,7 @@
|
||||||
}}
|
}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{* À VÉRIFIER immo soldée ? *}}
|
{{* immo soldée ? *}}
|
||||||
{{if $total_amort == $montant_immo}}
|
{{if $total_amort == $montant_immo}}
|
||||||
{{:assign status="amortized"}}
|
{{:assign status="amortized"}}
|
||||||
{{:save
|
{{:save
|
||||||
|
|
|
||||||
|
|
@ -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