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 *}}
|
{{* 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}}
|
{{if $message != null}}
|
||||||
{{:error message=$message}}
|
{{:error message=$message}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@
|
||||||
<h3 class="ruler">Avoirs</h3>
|
<h3 class="ruler">Avoirs</h3>
|
||||||
<nav class="actions">
|
<nav class="actions">
|
||||||
{{if $total_amort == 0 || ! $created_amort}}
|
{{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}}
|
{{/if}}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,7 @@
|
||||||
@param amort_line_id : id de la ligne d'amortissement
|
@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 *}}
|
{{* supprimer le doc de liaison entre les lignes *}}
|
||||||
{{#load type="amort_link"
|
{{#load type="amort_link"
|
||||||
where="$$.immo_doc_id = :immo_doc_id AND $$.amort_line_id = :amort_line_id"
|
where="$$.immo_doc_id = :immo_doc_id AND $$.amort_line_id = :amort_line_id"
|
||||||
|
|
@ -19,11 +18,12 @@
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{* marquer immo non soldée *}}
|
{{* marquer immo non soldée *}}
|
||||||
{{* TODO : À VÉRIFIER *}}
|
{{if $info_immo.status == "amortized"}}
|
||||||
{{:save
|
{{:save
|
||||||
key=$info_immo.key
|
key=$info_immo.key
|
||||||
status="managed"
|
status="managed"
|
||||||
}}
|
}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{if $_GET.from == "exit"}}
|
{{if $_GET.from == "exit"}}
|
||||||
{{:redirect force="exit_step2.html?immo_doc_id=%s&ok=1&msg=detach_amort"|args:$_GET.immo_doc_id}}
|
{{: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 *}}
|
{{* 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"}}
|
{{: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 *}}
|
{{* 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 type="exit_link" where="$$.immo_doc_id = :immo_doc_id" :immo_doc_id=$info_immo.id assign="exit_info"}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
@ -200,6 +218,10 @@
|
||||||
<dt>Valeur nette résiduelle</dt>
|
<dt>Valeur nette résiduelle</dt>
|
||||||
<dd>{{"%d-%d"|math:$solde:$total_amort|money_currency_html:false|raw}}</dd>
|
<dd>{{"%d-%d"|math:$solde:$total_amort|money_currency_html:false|raw}}</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{if $montant_cession > 0}}
|
||||||
|
<dt>Montant de la cession</dt>
|
||||||
|
<dd>{{$montant_cession|money_currency_html:false|raw}}</dd>
|
||||||
|
{{/if}}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,11 @@
|
||||||
{{*
|
{{*
|
||||||
lister les écritures au crédit du compte de l'immobilisation
|
lister les écritures au crédit du compte de l'immobilisation
|
||||||
*}}
|
*}}
|
||||||
{{:assign account_code=$ligne_immo.account_code|cat:"%"}}
|
{{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
|
{{#select
|
||||||
line.id as credit_line_id,
|
line.id as credit_line_id,
|
||||||
line.id_transaction as credit_trans_id,
|
line.id_transaction as credit_trans_id,
|
||||||
|
|
@ -61,23 +65,32 @@
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<section class="immobilisation">
|
<nav class="tabs">
|
||||||
<fieldset>
|
<ul>
|
||||||
<legend>
|
<li {{if $_GET.filter}}class="current"{{/if}}>
|
||||||
Écritures au crédit du compte d'immobilisation « {{$ligne_immo.account_code}} » et sous-comptes
|
<a href="link_immo.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&filter=true">
|
||||||
</legend>
|
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">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||||
<dt>Montant</dt>
|
<dt>Montant</dt>
|
||||||
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
<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>
|
<dd>{{$ligne_immo.date_achat|date_short}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
{{if $other_immos != null}}
|
{{if $other_immos != null}}
|
||||||
<table class="list">
|
<table class="list">
|
||||||
|
|
@ -111,8 +124,8 @@
|
||||||
</tr>
|
</tr>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</tbody>
|
</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>
|
<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}}
|
{{else}}
|
||||||
<p class="block alert">Aucune écriture au crédit du compte « {{$ligne_immo.account_code}} »</p>
|
<p class="block alert">Aucune écriture au crédit du compte « {{$ligne_immo.account_code}} »</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -60,9 +60,19 @@
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
{{if $free_amort_lines != null}}
|
<section class="amortissement">
|
||||||
<section class="amortissement">
|
<div class="informations">
|
||||||
<h3 class="ruler">Immobilisation « {{$label_immo}} »</h3>
|
<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">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -106,11 +116,12 @@
|
||||||
</tr>
|
</tr>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
<p class="help">Sélectionner une écriture d'amortissement pour l'associer à l'immobilisation</p>
|
||||||
</table>
|
</table>
|
||||||
</section>
|
{{else}}
|
||||||
{{else}}
|
|
||||||
<p class="block alert">Aucun amortissement pour le compte {{$code_amort}}</p>
|
<p class="block alert">Aucun amortissement pour le compte {{$code_amort}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue