Ajout possibilité détachement écriture crédit
This commit is contained in:
parent
18ce7b0edd
commit
91ec943e6d
2 changed files with 118 additions and 38 deletions
|
|
@ -9,12 +9,6 @@
|
|||
@param immo_doc_id : numéro du doc d'immo
|
||||
*}}
|
||||
|
||||
{{*
|
||||
TODO : permettre la modification des param (en cas d'erreur de saisie)
|
||||
TODO : permettre de corriger le montant de l'amort et/ou de supprimer l'attachement
|
||||
FAIT : déduire montant au crédit de la ligne d'immo
|
||||
*}}
|
||||
|
||||
{{* données de l'immobilisation *}}
|
||||
{{#load type="immo" id=$_GET.immo_doc_id|intval assign="info_immo"}}
|
||||
{{else}}
|
||||
|
|
@ -58,7 +52,8 @@
|
|||
{{#load type="credit_link" where="$$.immo_doc_id=:immo_doc_id" :immo_doc_id=$_GET.immo_doc_id|intval}}
|
||||
{{#select
|
||||
line.credit,
|
||||
trans.id,
|
||||
line.id as line_id,
|
||||
trans.id as trans_id,
|
||||
trans.label,
|
||||
trans.date
|
||||
FROM acc_transactions_lines AS line
|
||||
|
|
@ -67,7 +62,7 @@
|
|||
:credit_line_id=$credit_line_id
|
||||
}}
|
||||
{{:assign credit=$credit}}
|
||||
{{:assign var="linked_immos." id=$id label=$label amount=$credit date=$date}}
|
||||
{{:assign var="linked_immos." trans_id=$trans_id credit_line_id=$line_id label=$label amount=$credit date=$date}}
|
||||
{{/select}}
|
||||
{{if $amount == null}}
|
||||
{{:assign total_credits="%d+%d"|math:$total_credits:$credit}}
|
||||
|
|
@ -127,11 +122,15 @@
|
|||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg|match:"attach_amort"}}
|
||||
{{:assign msg="Attachement amortissement effectué"}}
|
||||
{{:assign msg="Écriture d'amortissement attachée"}}
|
||||
{{elseif $_GET.msg|match:"attach_immo"}}
|
||||
{{:assign msg="Attachement avoir effectué"}}
|
||||
{{:assign msg="Écriture au crédit attachée"}}
|
||||
{{elseif $_GET.msg|match:"info"}}
|
||||
{{:assign msg="Données de l'immobilisation enregistrées"}}
|
||||
{{elseif $_GET.msg|match:"detach"}}
|
||||
{{:assign msg="Écriture au crédit détachée"}}
|
||||
{{else}}
|
||||
{{:assign msg="Opération effectuée avec succès"}}
|
||||
{{/if}}
|
||||
<p class="block confirm">{{$msg}}</p>
|
||||
{{elseif $_GET.err}}
|
||||
|
|
@ -139,24 +138,26 @@
|
|||
<p class="block error">{{$msg}}</p>
|
||||
{{/if}}
|
||||
|
||||
{{*
|
||||
<h3 class="ruler">
|
||||
Paramètres de l'immobilisation
|
||||
Immobilisation
|
||||
<span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.immo_trans_id}}</a></span>
|
||||
{{$info_immo.label}}
|
||||
</h3>
|
||||
*}}
|
||||
{{if $linked_immos != null}}
|
||||
<aside class="right">
|
||||
<table class="list">
|
||||
<caption>Écritures d'avoir liées</caption>
|
||||
<tbody>
|
||||
{{#foreach from=$linked_immos item="elem"}}
|
||||
{{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$elem.id}}
|
||||
{{#foreach from=$linked_immos item="line"}}
|
||||
{{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
||||
<tr>
|
||||
<td class="num"><a href="{{$url}}">#{{$elem.id}}</a></td>
|
||||
<td>{{$elem.label}}</td>
|
||||
<td>{{$elem.date|date_short}}</td>
|
||||
<td class="money">{{"%f"|math:$elem.amount|money_currency_html:false|raw}}</td>
|
||||
<td class="num"><a href="{{$url}}">#{{$line.trans_id}}</a></td>
|
||||
<td>{{$line.label}}</td>
|
||||
<td>{{$line.date|date_short}}</td>
|
||||
<td class="money">{{"%f"|math:$line.amount|money_currency_html:false|raw}}</td>
|
||||
<td>
|
||||
{{:linkbutton label="Détacher" href="detach_immo.html?credit_line_id=%d&immo_line_id=%d&immo_doc_id=%s"|args:$line.credit_line_id:$ligne_immo.immo_line_id:$_GET.immo_doc_id shape="minus"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
|
|
@ -165,27 +166,12 @@
|
|||
{{/if}}
|
||||
<div class="informations">
|
||||
<dl class="describe">
|
||||
{{*
|
||||
<dt>Immobilisation</dt>
|
||||
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.immo_trans_id}}</a></span><span class="label"> {{$info_immo.label}}</span></dd>
|
||||
*}}
|
||||
<dt>Compte d'immobilisation</dt>
|
||||
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}</dd>
|
||||
<dt>Montant de l'immobilisation</dt>
|
||||
<dd class="money strong">{{"%f"|math:$info_immo.amount|money_currency_html:false|raw}}</dd>
|
||||
{{if $total_credits > 0}}
|
||||
<dt>Montant des avoirs</dt>
|
||||
<dd class="money">{{"%f"|math:$total_credits|money_currency_html:false|raw}}</dd>
|
||||
{{*
|
||||
<dt>Écritures d'avoir</dt>
|
||||
<dd>
|
||||
{{#foreach from=$linked_immos item="elem"}}
|
||||
{{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$elem.id}}
|
||||
<span class="num"><a href="{{$url}}">#{{$elem.id}}</a></span>
|
||||
{{/foreach}}
|
||||
</dd>
|
||||
*}}
|
||||
<dt>Montant à amortir</dt>
|
||||
<dd class="money strong">{{"%f"|math:$solde|money_currency_html:false|raw}}</dd>
|
||||
{{/if}}
|
||||
<dt>Date d'acquisition</dt>
|
||||
<dd>{{$info_immo.date_achat|date_short}}</dd>
|
||||
{{if $info_immo.date_mes != null && $info_immo.date_mes != $info_immo.date_achat}}
|
||||
|
|
@ -194,7 +180,28 @@
|
|||
{{/if}}
|
||||
<dt>Durée d'amortissement</dt>
|
||||
<dd>{{$info_immo.duration}} ans</dd>
|
||||
<dt>Montant des amortissements</dt>
|
||||
<dd>{{$total_amort|money_currency_html:false|raw}}</dd>
|
||||
<dt>Montant de l'immobilisation</dt>
|
||||
<dd class="money">{{"%f"|math:$info_immo.amount|money_currency_html:false|raw}}</dd>
|
||||
{{if $total_credits > 0}}
|
||||
<dt>Montant des avoirs</dt>
|
||||
<dd class="money">{{"%f"|math:$total_credits|money_currency_html:false|raw}}</dd>
|
||||
{{*
|
||||
<dt>Écritures d'avoir</dt>
|
||||
<dd>
|
||||
{{#foreach from=$linked_immos item="line"}}
|
||||
{{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.id}}
|
||||
<span class="num"><a href="{{$url}}">#{{$line.id}}</a></span>
|
||||
{{/foreach}}
|
||||
</dd>
|
||||
*}}
|
||||
<dt>Montant à amortir</dt>
|
||||
<dd class="money">{{"%f"|math:$solde|money_currency_html:false|raw}}</dd>
|
||||
{{/if}}
|
||||
{{if $total_amort > 0}}
|
||||
<dt>Montant des amortissements</dt>
|
||||
<dd>{{$total_amort|money_currency_html:false|raw}}</dd>
|
||||
<dt>Valeur nette comptable</dt>
|
||||
<dd>{{"%d-%d-%d"|math:$info_immo.amount:$total_credits:$total_amort|money_currency_html:false|raw}}</dd>
|
||||
{{/if}}
|
||||
</dl>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue