Compare commits
No commits in common. "main" and "v0.41" have entirely different histories.
15 changed files with 90 additions and 124 deletions
|
|
@ -26,7 +26,7 @@
|
|||
{{:assign filter_condition=$filter_condition|cat:" trans_label LIKE "|cat:$filter|cat:" OR "}}
|
||||
{{/foreach}}
|
||||
{{:assign filter_condition=$filter_condition|cat:"0)"}}
|
||||
{{:assign condition=$account_condition|cat:" AND debit > 0 AND NOT "|cat:$filter_condition|cat:" AND "|cat:$status_condition}}
|
||||
{{:assign condition=$account_condition|cat:" AND debit > 0 AND NOT (trans.status & 16) AND NOT "|cat:$filter_condition|cat:" AND "|cat:$status_condition}}
|
||||
|
||||
{{:assign total_cessions = 0}}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
lister les lignes d'amortissement liées à la ligne d'immobilisation
|
||||
@param immo_doc_id : id du doc associé à l'immobilisation
|
||||
@result linked_amort : lignes d'amortissement liées à la ligne d'immobilisation
|
||||
@result sommes_amort : montant des amortissements par compte d'amortissement
|
||||
@result total_amort : montant total des amortissements de l'immobilisation
|
||||
@result created_amort : vrai s'il y a au moins un amortissement créé par le module dans la liste
|
||||
*}}
|
||||
|
|
@ -40,8 +39,6 @@
|
|||
{{:assign var="created_amort" value=true}}
|
||||
{{/if}}
|
||||
{{:assign var="linked_amort.%s_%d"|args:$amort_line.date:$amort_info.id value=$amort_line}}
|
||||
{{:assign var="montant" from="sommes_amort.%s"|args:$account_code}}
|
||||
{{:assign var="sommes_amort.%s"|args:$account_code value="%d+%d"|math:$montant:$amort_line.amount}}
|
||||
{{:assign total_amort="%d+%d"|math:$total_amort:$amort_line.amount}}
|
||||
{{/select}}
|
||||
{{/load}}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
FROM acc_transactions_lines AS line
|
||||
INNER JOIN acc_accounts AS account ON account.id = line.id_account
|
||||
INNER JOIN acc_transactions AS trans ON trans.id = line.id_transaction
|
||||
WHERE credit > 0 AND !condition
|
||||
WHERE credit > 0 AND (NOT trans.status & 16) AND !condition
|
||||
ORDER BY trans.date, trans.label;
|
||||
!condition=$condition
|
||||
assign="amort_line"
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
{{:assign account_condition=$account_condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}}
|
||||
{{/foreach}}
|
||||
{{:assign account_condition=$account_condition|cat:"0)"}}
|
||||
{{:assign condition=$account_condition|cat:" AND debit > 0 AND "|cat:$doc_condition}}
|
||||
{{:assign condition=$account_condition|cat:" AND debit > 0 AND NOT (trans.status & 16) AND "|cat:$doc_condition}}
|
||||
|
||||
{{:assign nb_ignored=0}}
|
||||
{{#select
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
!condition=$condition
|
||||
assign="immo_line"
|
||||
}}
|
||||
{{if $immo_line.status == 'managed' || $immo_line.status == 'amortized'}}
|
||||
{{if $immo_line.status == 'managed'}}
|
||||
{{if $immo_line.amount == null || $immo_line.amount == 0 || $immo_line.amount == $immo_line.debit}}
|
||||
{{:continue}}
|
||||
{{/if}}
|
||||
|
|
@ -169,10 +169,7 @@ function changeVisibility(evt, idcheck = 'f_unhide_1') {
|
|||
}
|
||||
|
||||
(function () {
|
||||
let unhide_button = document.getElementById('f_unhide_1');
|
||||
if (unhide_button != null) {
|
||||
unhide_button.onclick = changeVisibility;
|
||||
}
|
||||
document.getElementById('f_unhide_1').onclick = changeVisibility;
|
||||
})();
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
{{:assign accounts_condition=$accounts_condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}}
|
||||
{{/foreach}}
|
||||
{{:assign accounts_condition=$accounts_condition|cat:"0)"}}
|
||||
{{:assign condition=$accounts_condition|cat:" AND debit > 0"}}
|
||||
{{:assign condition=$accounts_condition|cat:" AND debit > 0 AND NOT (trans.status & 16)"}}
|
||||
|
||||
{{:assign filter_condition=" NOT ("}}
|
||||
{{#foreach from=$module.config.filters item="filter"}}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@
|
|||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{:redirect to="compute_exit_data.html?immo_doc_id=%s&year=%s&date_debut=%s&exit_date=%s"|args:$_GET.immo_doc_id:$selected_year:$ts_debut:$ts_exit}}
|
||||
{{:redirect to="compute_exit_data.html?immo_doc_id=%s&amort_amount=%s&year=%s&date_debut=%s&exit_date=%s"|args:$_GET.immo_doc_id:$total_amort:$selected_year:$ts_debut:$ts_exit}}
|
||||
{{/form}}
|
||||
|
||||
{{:admin_header title="Sortie de bilan" custom_css="./style.css" current="module_amortization"}}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
Calculer les valeurs de la sortie et saisir le montant de la cession (optionnel)
|
||||
paramètres :
|
||||
@param immo_doc_id : id du doc associé à l'immo
|
||||
@param amort_amount : montant des amortissements
|
||||
@param year : exercice de la date de sortie de l'immobilisation
|
||||
@param date_debut : date de début de la période d'amortissement complémentaire
|
||||
@param exit_date : date de sortie de l'immobilisation
|
||||
|
|
@ -34,10 +35,7 @@
|
|||
{{* déduire le montant des écritures liées à l'immo courante au crédit du même compte *}}
|
||||
{{:include file="_get_credit_lines.html" immo_doc_id=$_GET.immo_doc_id keep="total_credits"}}
|
||||
{{:assign var="ligne_immo.amount" value="%d-%d"|math:$ligne_immo.amount:$total_credits}}
|
||||
|
||||
{{* 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"}}
|
||||
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.amount:$total_amort}}
|
||||
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.amount:$_GET.amort_amount}}
|
||||
|
||||
{{:assign amort_comp=0}} {{* amortissement complémentaire jqà date sortie *}}
|
||||
{{if $valeur_nette > 0}}
|
||||
|
|
@ -55,7 +53,7 @@
|
|||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{:redirect to="write_exit.html?immo_doc_id=%s&year=%s&date_debut=%s&exit_date=%s&cession=%s"|args:$_GET.immo_doc_id:$_GET.year:$_GET.date_debut:$_GET.exit_date:$_POST.montant_cession}}
|
||||
{{:redirect to="write_exit.html?immo_doc_id=%s&amort_amount=%s&year=%s&date_debut=%s&exit_date=%s&cession=%s"|args:$_GET.immo_doc_id:$_GET.amort_amount:$_GET.year:$_GET.date_debut:$_GET.exit_date:$_POST.montant_cession}}
|
||||
|
||||
{{/form}}
|
||||
{{:admin_header title="Sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
||||
|
|
@ -89,7 +87,7 @@
|
|||
<dt>Durée de l'amortissement</dt>
|
||||
<dd id="duree_amort" class="num">{{$info_immo.duration}} ans</dd>
|
||||
<dt>Montant des amortissements</dt>
|
||||
<dd id="montant_amort" class="money">{{$total_amort|money_currency_html:false|raw}} <span class="help">(à la date de début de l'exercice)</span></dd>
|
||||
<dd id="montant_amort" class="money">{{$_GET.amort_amount|money_currency_html:false|raw}} <span class="help">(à la date de début de l'exercice)</span></dd>
|
||||
<dt>Valeur nette résiduelle</dt>
|
||||
<dd class="money">{{$valeur_nette|money_currency_html:false|raw}} <span class="help">(à la date de début de l'exercice)</span></dd>
|
||||
<dt>Date de sortie</dt>
|
||||
|
|
@ -98,7 +96,7 @@
|
|||
<dt>Amortissement complémentaire</dt>
|
||||
<dd class="money">{{$amort_comp|money_currency_html:false|raw}} <span class="help">(jusqu'à la date de sortie)</span></dd>
|
||||
<dt>Total des amortissements</dt>
|
||||
<dd class="money">{{"%f+%f"|math:$total_amort:$amort_comp|money_currency_html:false|raw}} <span class="help">(à la date de sortie)</span></dd>
|
||||
<dd class="money">{{"%f+%f"|math:$_GET.amort_amount:$amort_comp|money_currency_html:false|raw}} <span class="help">(à la date de sortie)</span></dd>
|
||||
<dt>Valeur nette résiduelle</dt>
|
||||
<dd class="money">{{"%f-%f"|math:$valeur_nette:$amort_comp|money_currency_html:false|raw}} <span class="help">(à la date de sortie)</span></dd>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@
|
|||
WHERE
|
||||
account.code = :code_amort
|
||||
AND line.credit > 0
|
||||
AND (NOT trans.status & 16)
|
||||
AND trans.date >= :immo_date
|
||||
;
|
||||
:code_amort = $code_amort
|
||||
|
|
|
|||
|
|
@ -43,7 +43,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"}}
|
||||
{{:assign vnr="%d-%d"|math:$solde:$total_amort}}
|
||||
|
||||
{{* déterminer le compte d'amortissement en fonction du compte d'immobilisation *}}
|
||||
{{:include
|
||||
|
|
@ -70,6 +69,7 @@
|
|||
WHERE
|
||||
account.code = :code_amort
|
||||
AND line.credit > 0
|
||||
AND (NOT trans.status & 16)
|
||||
AND trans.date >= :immo_date
|
||||
;
|
||||
:code_amort = $code_amort
|
||||
|
|
@ -132,12 +132,12 @@
|
|||
<dt>Montant des amortissements</dt>
|
||||
<dd>{{$total_amort|money_currency_html:false|raw}}</dd>
|
||||
<dt>Valeur nette résiduelle</dt>
|
||||
<dd>{{$vnr|money_currency_html:false|raw}}</dd>
|
||||
<dd>{{"%d-%d"|math:$solde:$total_amort|money_currency_html:false|raw}}</dd>
|
||||
{{/if}}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{{if $free_amort_lines && $vnr > 0}}
|
||||
{{if $free_amort_lines}}
|
||||
<nav class="actions">
|
||||
{{:linkbutton
|
||||
label="Attacher une écriture d'amortissement"
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@
|
|||
{{/select}}
|
||||
|
||||
{{* lignes de l'écriture de sortie *}}
|
||||
{{:assign exit_amort=0}}
|
||||
{{#select
|
||||
line.label as line_label,
|
||||
line.credit,
|
||||
|
|
@ -86,11 +85,16 @@
|
|||
assign="trans"
|
||||
}}
|
||||
{{:assign var="exit_trans.%s"|args:$account_code value=$trans}}
|
||||
{{if $account_code|strpos:"28" === 0}}
|
||||
{{:assign exit_amort="%d+%d"|math:$exit_amort:$debit}}
|
||||
{{/if}}
|
||||
{{/select}}
|
||||
|
||||
{{:assign acc_codes=$exit_trans|keys}}
|
||||
{{#foreach from=$linked_amort}}
|
||||
{{if $account_code|in:$acc_codes}}
|
||||
{{:assign var="exit_amort" from="exit_trans.%s.debit"|args:$account_code}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{if $exit_amort != $total_amort}}
|
||||
{{:assign exit_amort_display=$exit_amort|money_currency:false|replace:" ":" "}}
|
||||
{{:assign total_amort_display=$total_amort|money_currency:false|replace:" ":" "}}
|
||||
|
|
@ -171,6 +175,7 @@
|
|||
WHERE
|
||||
account.code = :code_amort
|
||||
AND line.credit > 0
|
||||
AND (NOT trans.status & 16)
|
||||
AND trans.date >= :immo_date
|
||||
;
|
||||
:code_amort = $code_amort
|
||||
|
|
@ -308,7 +313,7 @@
|
|||
{{if $exit_lines}}
|
||||
<nav class="actions">
|
||||
{{:linkbutton
|
||||
label="Attacher une écriture de sortie de bilan"
|
||||
label="Attacher une écriture sortie de bilan"
|
||||
href="list_exit.html?immo_doc_id=%s&filter=true&from=%s"|args:$_GET.immo_doc_id:$_GET.from shape="link"
|
||||
target="_dialog"}}
|
||||
</nav>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
{{* Mise à niveau *}}
|
||||
{{:assign module_version="0.41"}}
|
||||
{{:include file="_upgrade.html" module_version=$module_version}}
|
||||
{{:include file="upgrade.html" module_version=$module_version}}
|
||||
|
||||
{{* supprimer les documents sans écriture associée *}}
|
||||
{{:include file="_remove_orphan_docs.tpl"}}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
paramètre et proposer de les attacher à l'immo paramètre
|
||||
@param immo_doc_id : document associé à l'immo
|
||||
@param filter : si vrai ne montrer que les écritures du compte de l'immobilisation (et sous-comptes)
|
||||
dans le cas contraire, montrer les écritures de tous les comptes d'immo
|
||||
dans le cas contraire, montrer les écritures du compte d'immo à deux chiffres (et sous-comptes)
|
||||
*}}
|
||||
|
||||
{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id|intval keep="info_immo, ligne_immo, message"}}
|
||||
|
|
@ -32,23 +32,11 @@
|
|||
{{*
|
||||
lister les écritures au crédit du compte de l'immobilisation
|
||||
*}}
|
||||
{{:include file="_get_config.html" keep="module.config"}}
|
||||
{{if $_GET.filter}}
|
||||
{{:assign account_code=$ligne_immo.account_code|cat:"%"|quote_sql}}
|
||||
{{:assign account_condition="account.code LIKE "|cat:$account_code}}
|
||||
{{:assign account_code=$ligne_immo.account_code|cat:"%"}}
|
||||
{{else}}
|
||||
{{:assign account_condition="("}}
|
||||
{{#foreach from=$module.config.prefixes item="account_code"}}
|
||||
{{:assign account_code=$account_code|cat:"%"|quote_sql}}
|
||||
{{:assign account_condition=$account_condition|cat:" account.code LIKE "|cat:$account_code|cat:" OR "}}
|
||||
{{/foreach}}
|
||||
{{#foreach from=$module.config.unfinished item="account_code"}}
|
||||
{{:assign account_code=$account_code|cat:"%"|quote_sql}}
|
||||
{{:assign account_condition=$account_condition|cat:" account.code LIKE "|cat:$account_code|cat:" OR "}}
|
||||
{{/foreach}}
|
||||
{{:assign account_condition=$account_condition|cat:"0)"}}
|
||||
{{:assign account_code=$ligne_immo.account_code|substr:0:2|cat:"%"}}
|
||||
{{/if}}
|
||||
|
||||
{{:assign date_immo=$info_immo.date_achat|or:$ligne_immo.date_achat}}
|
||||
|
||||
{{#select
|
||||
|
|
@ -67,8 +55,7 @@
|
|||
INNER JOIN acc_transactions AS trans ON trans.id = line.id_transaction
|
||||
INNER JOIN acc_accounts AS account ON account.id = line.id_account
|
||||
INNER JOIN acc_years AS y ON y.id = trans.id_year
|
||||
WHERE !account_condition
|
||||
AND credit > 0
|
||||
WHERE account.code LIKE :account_code AND credit > 0
|
||||
AND trans.date > :date_immo
|
||||
AND credit_line_id NOT IN (
|
||||
SELECT json_extract(link.document, '$.credit_line_id') AS credit_line_id FROM !table as link
|
||||
|
|
@ -77,7 +64,7 @@
|
|||
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")
|
||||
ORDER BY trans.date, trans.label;
|
||||
!account_condition = $account_condition
|
||||
:account_code = $account_code
|
||||
!table = $module.table
|
||||
:date_immo = $date_immo
|
||||
assign="credit_line"
|
||||
|
|
@ -99,6 +86,7 @@
|
|||
}}
|
||||
{{/if}}
|
||||
|
||||
{{if $ligne_immo.account_code|substr:0:2 != $ligne_immo.account_code}}
|
||||
<nav class="tabs">
|
||||
<ul>
|
||||
<li {{if $_GET.filter}}class="current"{{/if}}>
|
||||
|
|
@ -108,11 +96,12 @@
|
|||
</li>
|
||||
<li {{if ! $_GET.filter}}class="current"{{/if}}>
|
||||
<a href="link_immo.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&from={{$_GET.from}}">
|
||||
Tous les comptes
|
||||
Compte {{$ligne_immo.account_code|substr:0:2}} et sous-comptes
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{{/if}}
|
||||
|
||||
<section class="immobilisation">
|
||||
<div class="informations">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
name="Amortissements"
|
||||
description="Immobilisations et amortissements\nversion 0.41.2"
|
||||
description="Immobilisations et amortissements\nversion 0.41"
|
||||
author="Jean-Christophe Engel"
|
||||
author_url="https://gitea.zaclys.com/lesanges"
|
||||
home_button=false
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
Enregistrer les écritures de sortie du bilan
|
||||
paramètres :
|
||||
- immo_doc_id : id du doc associé à l'immobilisation
|
||||
- amort_amount : montant des amortissements
|
||||
- year : exercice de la date de sortie de l'immobilisation
|
||||
- date_debut : date de début de la période d'amortissement complémentaire
|
||||
- exit_date : date de sortie de l'immobilisation
|
||||
|
|
@ -33,10 +34,7 @@
|
|||
{{* déduire le montant des écritures liées à l'immo courante au crédit du même compte *}}
|
||||
{{:include file="_get_credit_lines.html" immo_doc_id=$_GET.immo_doc_id keep="total_credits"}}
|
||||
{{:assign var="ligne_immo.amount" value="%d-%d"|math:$ligne_immo.amount:$total_credits}}
|
||||
|
||||
{{* lister les amortissements liés à l'immobilisation *}}
|
||||
{{:include file="./_get_amort_lines.html" immo_doc_id=$_GET.immo_doc_id keep="linked_amort, sommes_amort, total_amort"}}
|
||||
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.amount:$total_amort}}
|
||||
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.amount:$_GET.amort_amount}}
|
||||
|
||||
{{:assign amort_comp=0}} {{* amortissement complémentaire jqà date sortie *}}
|
||||
{{:assign amort_except=0}} {{* amortissement exceptionnel jqà date fin amortissement *}}
|
||||
|
|
@ -47,7 +45,7 @@
|
|||
{{:assign amort_comp="min(%f, %f)"|math:$valeur_nette:$amort_comp}}
|
||||
|
||||
{{if $_GET.cession == null}}
|
||||
{{:assign amort_except="%f-%f-%f"|math:$ligne_immo.amount:$total_amort:$amort_comp}}
|
||||
{{:assign amort_except="%f-%f-%f"|math:$ligne_immo.amount:$_GET.amort_amount:$amort_comp}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
|
|
@ -60,11 +58,6 @@
|
|||
{{* numéros de comptes ; voir info.org *}}
|
||||
{{:assign vnc_code="652"}}
|
||||
{{:assign cession_code="757"}}
|
||||
{{:include
|
||||
file="./_get_amort_code.html"
|
||||
code_immo=$ligne_immo.account_code
|
||||
keep="code_amort"
|
||||
}}
|
||||
|
||||
{{* Traiter l'envoi du formulaire *}}
|
||||
{{#form on="save"}}
|
||||
|
|
@ -99,7 +92,7 @@
|
|||
{{:assign
|
||||
var="lines."
|
||||
credit="%f/100"|math:$amort_comp
|
||||
account=$code_amort|intval
|
||||
account=$amort_account_code
|
||||
id_project=$ligne_immo.id_project
|
||||
label=$libelle
|
||||
}}
|
||||
|
|
@ -124,7 +117,7 @@
|
|||
{{:assign
|
||||
var="lines."
|
||||
credit="%f/100"|math:$amort_except
|
||||
account=$code_amort|intval
|
||||
account=$amort_account_code
|
||||
id_project=$ligne_immo.id_project
|
||||
label=$libelle
|
||||
}}
|
||||
|
|
@ -146,7 +139,7 @@
|
|||
|
||||
{{* liaisons lignes d'amortissement *}}
|
||||
{{#foreach from=$result.lines item="line"}}
|
||||
{{if $line.account_code == $code_amort}}
|
||||
{{if $line.account_code == $amort_account_code}}
|
||||
{{:save
|
||||
key=""|uuid
|
||||
type="amort_link"
|
||||
|
|
@ -174,20 +167,13 @@
|
|||
id_project=$ligne_immo.id_project
|
||||
label=$libelle
|
||||
}}
|
||||
{{* amortissements *}}
|
||||
{{#foreach from=$sommes_amort key="code" item="montant"}}
|
||||
{{if $code == $code_amort}}
|
||||
{{* amortissements complémentaire et exceptionnel *}}
|
||||
{{:assign montant="(%d+%d+%d)"|math:$montant:$amort_comp:$amort_except}}
|
||||
{{/if}}
|
||||
{{:assign
|
||||
var="lines."
|
||||
account=$code
|
||||
debit="%d/100"|math:$montant
|
||||
account=$amort_account_code
|
||||
debit="(%f-%f)/100"|math:$ligne_immo.amount:$valeur_nette
|
||||
id_project=$ligne_immo.id_project
|
||||
label=$libelle
|
||||
}}
|
||||
{{/foreach}}
|
||||
{{if $valeur_nette > 0}}
|
||||
{{:include
|
||||
file="_get_codes.html"
|
||||
|
|
@ -300,12 +286,16 @@
|
|||
déterminer les comptes pour les différentes écritures
|
||||
*}}
|
||||
|
||||
{{:include
|
||||
file="./_get_amort_code.html"
|
||||
code_immo=$ligne_immo.account_code
|
||||
keep="code_amort"
|
||||
}}
|
||||
|
||||
{{:assign var="liste_codes.6811" name="comp_account"}}
|
||||
{{:assign var="liste_codes.687" name="except_account"}}
|
||||
{{:assign var="liste_codes.462" name="creance_account"}}
|
||||
{{#foreach from=$sommes_amort key="code"}}
|
||||
{{:assign var="liste_codes.%s"|args:$code name="amort_account"}}
|
||||
{{/foreach}}
|
||||
{{:assign var="liste_codes.%s"|args:$code_amort name="amort_account"}}
|
||||
{{:assign var="liste_codes.%s"|args:$ligne_immo.account_code name="immo_account"}}
|
||||
{{:assign var="liste_codes.%s"|args:$vnc_code name="vnc_account"}}
|
||||
{{:assign var="liste_codes.%s"|args:$cession_code name="cession_account"}}
|
||||
|
|
@ -348,6 +338,7 @@
|
|||
|
||||
<h3>Sortir l'immobilisation « {{$label_immo}} » du bilan</h3>
|
||||
<form method="post" action="">
|
||||
|
||||
<div class="informations">
|
||||
<legend>Données de l'imobilisation</legend>
|
||||
<dl class="describe">
|
||||
|
|
@ -362,7 +353,7 @@
|
|||
<dt>Durée de l'amortissement</dt>
|
||||
<dd class="num">{{$info_immo.duration}} ans</dd>
|
||||
<dt>Montant des amortissements</dt>
|
||||
<dd class="money">{{$total_amort|money_currency_html:false|raw}} <span class="help">(à la date de début de l'exercice)</span></dd>
|
||||
<dd class="money">{{$_GET.amort_amount|money_currency_html:false|raw}} <span class="help">(à la date de début de l'exercice)</span></dd>
|
||||
<dt>Valeur nette résiduelle</dt>
|
||||
<dd class="money">{{$valeur_nette|money_currency_html:false|raw}} <span class="help">(à la date de début de l'exercice)</span></dd>
|
||||
<dt>Date de sortie</dt>
|
||||
|
|
@ -372,7 +363,7 @@
|
|||
<dt>Amortissement complémentaire</dt>
|
||||
<dd class="money">{{$amort_comp|money_currency_html:false|raw}} <span class="help">(jusqu'à la date de sortie)</span></dd>
|
||||
<dt>Total des amortissements</dt>
|
||||
<dd class="money">{{"%f+%f"|math:$total_amort:$amort_comp|money_currency_html:false|raw}} <span class="help">(à la date de sortie)</span></dd>
|
||||
<dd class="money">{{"%f+%f"|math:$_GET.amort_amount:$amort_comp|money_currency_html:false|raw}} <span class="help">(à la date de sortie)</span></dd>
|
||||
<dt>Valeur nette résiduelle</dt>
|
||||
<dd class="money">{{$valeur_nette|money_currency_html:false|raw}} <span class="help">(à la date de sortie)</span></dd>
|
||||
{{/if}}
|
||||
|
|
@ -392,7 +383,6 @@
|
|||
<legend>Écritures de sortie du bilan</legend>
|
||||
{{* Amortissement complémentaire *}}
|
||||
{{if $amort_comp > 0}}
|
||||
{{:assign var="account.%s"|args:$code from="amort_account.%s"|args:$code_amort}}
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -427,7 +417,7 @@
|
|||
name="amort_comp_account"
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"28*":$chart_id
|
||||
readonly=true
|
||||
default=$account
|
||||
default=$amort_account
|
||||
}}
|
||||
</td>
|
||||
<td></td>
|
||||
|
|
@ -435,12 +425,10 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{{:assign account=null}}
|
||||
{{/if}}
|
||||
|
||||
{{* Amortissement exceptionnel *}}
|
||||
{{if $montant_cession == 0 && $amort_except > 0}}
|
||||
{{:assign var="account.%s"|args:$code from="amort_account.%s"|args:$code_amort}}
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -475,7 +463,7 @@
|
|||
name="amort_except_account"
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"28*":$chart_id
|
||||
readonly=true
|
||||
default=$account
|
||||
default=$amort_account
|
||||
}}
|
||||
</td>
|
||||
<td></td>
|
||||
|
|
@ -483,7 +471,6 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{{:assign account=null}}
|
||||
{{/if}}
|
||||
|
||||
{{* Sortie du bilan *}}
|
||||
|
|
@ -496,8 +483,6 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#foreach from=$sommes_amort key="code" item="montant"}}
|
||||
{{:assign var="account.%s"|args:$code from="amort_account.%s"|args:$code}}
|
||||
<tr>
|
||||
<td>
|
||||
{{:input
|
||||
|
|
@ -505,23 +490,17 @@
|
|||
name="amort_sortie_account"
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"28*":$chart_id
|
||||
readonly=true
|
||||
default=$account
|
||||
default=$amort_account
|
||||
}}
|
||||
</td>
|
||||
{{if $montant_cession == 0}}
|
||||
{{if $code == $code_amort}}
|
||||
{{:assign montant="%f+%f+%f"|math:$montant:$amort_comp:$amort_except}}
|
||||
{{/if}}
|
||||
{{:assign montant=$ligne_immo.amount}}
|
||||
{{else}}
|
||||
{{if $code == $code_amort}}
|
||||
{{:assign montant="%f+%f"|math:$montant:$amort_comp}}
|
||||
{{/if}}
|
||||
{{:assign montant="%f+%f"|math:$_GET.amort_amount:$amort_comp}}
|
||||
{{/if}}
|
||||
<td>{{$montant|money_currency_html:false|raw}}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{{:assign account=null}}
|
||||
{{/foreach}}
|
||||
{{if $montant_cession > 0 && $valeur_nette > 0}}
|
||||
<tr>
|
||||
<td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue