Compare commits
3 commits
3752fc5235
...
98f4fa5330
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98f4fa5330 | ||
|
|
1c08ddf4bc | ||
|
|
b923ad1b85 |
6 changed files with 71 additions and 25 deletions
|
|
@ -7,7 +7,7 @@
|
|||
*}}
|
||||
|
||||
{{* données de l'immobilisation *}}
|
||||
{{:include file="_get_immo_data.html" immo_doc_id=$immo_doc_id|intval keep="ligne_immo, message"}}
|
||||
{{:include file="_get_immo_data.html" immo_doc_id=$immo_doc_id|intval keep="info_immo, ligne_immo, message"}}
|
||||
{{if $message != null}}
|
||||
{{:error message=$message}}
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@
|
|||
<h3 class="ruler">Avoirs</h3>
|
||||
<nav class="actions">
|
||||
{{if $total_amort == 0 || ! $created_amort}}
|
||||
{{:linkbutton label="Attacher une écriture d'avoir" href="link_immo.html?immo_doc_id=%s"|args:$_GET.immo_doc_id shape="link" target="_dialog"}}
|
||||
{{:linkbutton label="Attacher une écriture d'avoir" href="link_immo.html?immo_doc_id=%s&filter=true"|args:$_GET.immo_doc_id shape="link" target="_dialog"}}
|
||||
{{/if}}
|
||||
</nav>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@
|
|||
@param amort_line_id : id de la ligne d'amortissement
|
||||
*}}
|
||||
|
||||
{{:include file="_common_detach.html" immo_doc_id=$_GET.immo_doc_id line_id=$_GET.amort_line_id}}
|
||||
|
||||
{{:include file="_common_detach.html" immo_doc_id=$_GET.immo_doc_id line_id=$_GET.amort_line_id keep="info_immo"}}
|
||||
{{* supprimer le doc de liaison entre les lignes *}}
|
||||
{{#load type="amort_link"
|
||||
where="$$.immo_doc_id = :immo_doc_id AND $$.amort_line_id = :amort_line_id"
|
||||
|
|
@ -19,11 +18,12 @@
|
|||
{{/load}}
|
||||
|
||||
{{* marquer immo non soldée *}}
|
||||
{{* TODO : À VÉRIFIER *}}
|
||||
{{if $info_immo.status == "amortized"}}
|
||||
{{:save
|
||||
key=$info_immo.key
|
||||
status="managed"
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
{{if $_GET.from == "exit"}}
|
||||
{{:redirect force="exit_step2.html?immo_doc_id=%s&ok=1&msg=detach_amort"|args:$_GET.immo_doc_id}}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,24 @@
|
|||
{{* 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"}}
|
||||
|
||||
{{* chercher une écriture de cession associée *}}
|
||||
{{#load type="cession_link"
|
||||
where="$$.immo_doc_id = :immo_doc_id"
|
||||
:immo_doc_id = $_GET.immo_doc_id|intval
|
||||
}}
|
||||
{{if $amount == null || $amount == 0}}
|
||||
{{#select credit
|
||||
FROM acc_transactions_lines
|
||||
WHERE id = :cession_line_id;
|
||||
:cession_line_id = $cession_line_id
|
||||
}}
|
||||
{{:assign montant_cession=$credit}}
|
||||
{{/select}}
|
||||
{{else}}
|
||||
{{:assign montant_cession=$amount}}
|
||||
{{/if}}
|
||||
{{/load}}
|
||||
|
||||
{{* chercher une écriture de sortie de bilan associée *}}
|
||||
{{#load type="exit_link" where="$$.immo_doc_id = :immo_doc_id" :immo_doc_id=$info_immo.id assign="exit_info"}}
|
||||
{{/load}}
|
||||
|
|
@ -200,6 +218,10 @@
|
|||
<dt>Valeur nette résiduelle</dt>
|
||||
<dd>{{"%d-%d"|math:$solde:$total_amort|money_currency_html:false|raw}}</dd>
|
||||
{{/if}}
|
||||
{{if $montant_cession > 0}}
|
||||
<dt>Montant de la cession</dt>
|
||||
<dd>{{$montant_cession|money_currency_html:false|raw}}</dd>
|
||||
{{/if}}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@
|
|||
{{*
|
||||
lister les écritures au crédit du compte de l'immobilisation
|
||||
*}}
|
||||
{{if $_GET.filter}}
|
||||
{{:assign account_code=$ligne_immo.account_code|cat:"%"}}
|
||||
{{else}}
|
||||
{{:assign account_code=$ligne_immo.account_code|substr:0:2|cat:"%"}}
|
||||
{{/if}}
|
||||
{{#select
|
||||
line.id as credit_line_id,
|
||||
line.id_transaction as credit_trans_id,
|
||||
|
|
@ -61,23 +65,32 @@
|
|||
}}
|
||||
{{/if}}
|
||||
|
||||
<section class="immobilisation">
|
||||
<fieldset>
|
||||
<legend>
|
||||
Écritures au crédit du compte d'immobilisation « {{$ligne_immo.account_code}} » et sous-comptes
|
||||
</legend>
|
||||
<nav class="tabs">
|
||||
<ul>
|
||||
<li {{if $_GET.filter}}class="current"{{/if}}>
|
||||
<a href="link_immo.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&filter=true">
|
||||
Compte {{$ligne_immo.account_code}} et sous-comptes
|
||||
</a>
|
||||
</li>
|
||||
<li {{if ! $_GET.filter}}class="current"{{/if}}>
|
||||
<a href="link_immo.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}">
|
||||
Compte {{$ligne_immo.account_code|substr:0:2}} et sous-comptes
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<section class="immobilisation">
|
||||
<div class="informations">
|
||||
<dl class="describe">
|
||||
<dt>Immobilisation</dt>
|
||||
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||
<dt>Montant</dt>
|
||||
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
||||
<dt>Date de l'écriture d'immobilisation</dt>
|
||||
<dt>Date de l'immobilisation</dt>
|
||||
<dd>{{$ligne_immo.date_achat|date_short}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
{{if $other_immos != null}}
|
||||
<table class="list">
|
||||
|
|
@ -111,8 +124,8 @@
|
|||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="help">Sélectionner une écriture d'avoir ou autre réduction du montant de l'acquisition pour l'associer à l'immobilisation</p>
|
||||
</table>
|
||||
{{else}}
|
||||
<p class="block alert">Aucune écriture au crédit du compte « {{$ligne_immo.account_code}} »</p>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -60,9 +60,19 @@
|
|||
</ul>
|
||||
</nav>
|
||||
|
||||
{{if $free_amort_lines != null}}
|
||||
<section class="amortissement">
|
||||
<h3 class="ruler">Immobilisation « {{$label_immo}} »</h3>
|
||||
<div class="informations">
|
||||
<dl class="describe">
|
||||
<dt>Immobilisation</dt>
|
||||
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||
<dt>Montant</dt>
|
||||
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
||||
<dt>Date de l'immobilisation</dt>
|
||||
<dd>{{$ligne_immo.date_achat|date_short}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{{if $free_amort_lines != null}}
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -106,11 +116,12 @@
|
|||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
<p class="help">Sélectionner une écriture d'amortissement pour l'associer à l'immobilisation</p>
|
||||
</table>
|
||||
</section>
|
||||
{{else}}
|
||||
<p class="block alert">Aucun amortissement pour le compte {{$code_amort}}</p>
|
||||
{{/if}}
|
||||
</section>
|
||||
|
||||
|
||||
{{:form_errors}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue