Mutualisation infos immo, écritures crédit, amortissements liés et libres
This commit is contained in:
parent
91795c69a8
commit
780eb206ce
21 changed files with 410 additions and 879 deletions
|
|
@ -5,30 +5,12 @@
|
|||
@param immo_doc_id
|
||||
*}}
|
||||
|
||||
{{#load id=$_GET.immo_doc_id|intval assign="info_immo"}}
|
||||
{{else}}
|
||||
{{:error message="Immobilisation non trouvée"}}
|
||||
{{/load}}
|
||||
{{#select
|
||||
trans.id as immo_trans_id,
|
||||
trans.label as trans_label,
|
||||
trans.date as date_achat,
|
||||
line.debit as montant,
|
||||
line.label as line_label,
|
||||
acc.code,
|
||||
acc.label as account_label
|
||||
FROM acc_transactions_lines AS line
|
||||
INNER join acc_transactions AS trans ON line.id_transaction = trans.id
|
||||
INNER JOIN acc_accounts AS acc ON line.id_account = acc.id
|
||||
WHERE line.id = :line_id;
|
||||
:line_id = $info_immo.line
|
||||
assign="ligne_immo"
|
||||
}}
|
||||
{{else}}
|
||||
{{:error message="Immobilisation non trouvée"}}
|
||||
{{/select}}
|
||||
{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id|intval keep="info_immo, ligne_immo, message"}}
|
||||
{{if $message != null}}
|
||||
{{:error message=$message}}
|
||||
{{/if}}
|
||||
|
||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$ligne_immo.immo_trans_id}}
|
||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$ligne_immo.trans_id}}
|
||||
{{:assign immo_label=$info_immo.label|or:$ligne_immo.trans_label}}
|
||||
{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $immo_label}}
|
||||
{{:assign immo_label=$immo_label|cat::" — "|cat:$ligne_immo.line_label}}
|
||||
|
|
@ -49,7 +31,6 @@
|
|||
{{:assign var="linked_trans." value=$id}}
|
||||
{{/select}}
|
||||
|
||||
{{:debug linked_trans=$linked_trans}}
|
||||
{{if $linked_trans != null}}
|
||||
{{* chercher et supprimer les écritures liées *}}
|
||||
{{#select
|
||||
|
|
@ -62,7 +43,7 @@
|
|||
ON (links.id_transaction = trans.id OR links.id_related = trans.id)
|
||||
WHERE trans.id = :immo_trans_id
|
||||
;
|
||||
:immo_trans_id=$ligne_immo.immo_trans_id
|
||||
:immo_trans_id=$ligne_immo.trans_id
|
||||
}}
|
||||
{{if ! $linked_trans|has:$linked_id}}
|
||||
{{:assign var="linked_transactions." value=$linked_id}}
|
||||
|
|
@ -72,7 +53,7 @@
|
|||
{{* enregistrer les liaisons restantes *}}
|
||||
{{:api
|
||||
method="POST"
|
||||
path="accounting/transaction/%s/transactions"|args:$ligne_immo.immo_trans_id
|
||||
path="accounting/transaction/%s/transactions"|args:$ligne_immo.trans_id
|
||||
assign="result"
|
||||
assign_code="result_code"
|
||||
transactions=$linked_transactions
|
||||
|
|
@ -92,8 +73,8 @@
|
|||
{{:admin_header title="Supprimer" current="module_amortization"}}
|
||||
{{:form_errors}}
|
||||
{{:delete_form
|
||||
legend="Immobilisation « #%s %s »"|args:$ligne_immo.immo_trans_id:$immo_label
|
||||
warning="Supprimer les paramètres de l'immobilisation « #%s %s » ?"|args:$ligne_immo.immo_trans_id:$immo_label
|
||||
legend="Immobilisation « #%s %s »"|args:$ligne_immo.trans_id:$immo_label
|
||||
warning="Supprimer les paramètres de l'immobilisation « #%s %s » ?"|args:$ligne_immo.trans_id:$immo_label
|
||||
info="L'écriture d'immobilisation ne sera pas supprimée ; les nouveaux paramètres pourront être saisis depuis l'onglet « À classer »"
|
||||
}}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue