{{* -*- brindille -*- *}} {{* Lister les écritures d'amortissement associées à une immobilisation @param immo_doc_id : id du doc associé à l'immo @param type_immo : managed, amortized, archived, others *}} {{* données de l'immobilisation *}} {{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id 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.trans_id}} {{:assign date_debut=$info_immo.date_mes|or:$info_immo.date_achat|or:$ligne_immo.date_achat}} {{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}} {{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}} {{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}} {{/if}} {{if $info_immo.amount != null}} {{:assign var="ligne_immo.amount" value=$info_immo.amount}} {{/if}} {{if $info_immo.status == 'ignored'}} {{:error message="Cette immobilisation ne doit pas être amortie"}} {{/if}} {{* 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 solde="%d-%d"|math:$ligne_immo.amount:$total_credits}} {{if $info_immo.status == "amortized"}} {{:assign amort_amount=$solde}} {{:assign valeur_residuelle=0}} {{else}} {{:assign valeur_residuelle=$solde}} {{/if}} {{* 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_residuelle="%d-%d"|math:$valeur_residuelle:$total_amort}} {{if $valeur_residuelle > 0}} {{* lister les amortissements non rattachés à une immo *}} {{:include file="./_get_free_amort.html" filter_condition="1" keep="free_amort_lines"}} {{/if}} {{:admin_header title="Liste des amortissements" custom_css="./style.css" current="module_amortization"}} {{* barre de navigation *}} {{if $_GET.type_immo == "amortized" || $valeur_residuelle== 0 }} {{:assign subcurrent="amortized"}} {{elseif $_GET.type_immo == "archived"}} {{:assign subcurrent="archived"}} {{elseif $_GET.type_immo == null || $_GET.type_immo == "managed"}} {{:assign subcurrent="managed"}} {{else}} {{:assign subcurrent="other"}} {{/if}} {{:include file="_nav.html" current="index" subcurrent="%s"|args:$subcurrent subsubcurrent="amortization" type_immo=$_GET.type_immo autres_amort=$free_amort_lines }} {{if $_GET.ok}} {{if $_GET.msg|match:"attach"}} {{:assign msg="Attachement amortissement %s effectué"|args:$_GET.trans_id}} {{elseif $_GET.msg|match:"detach"}} {{:assign msg="Détachement amortissement %s affectué"|args:$_GET.trans_id}} {{elseif $_GET.msg|match:"amortissement"}} {{:assign msg="Amortissement enregistré"}} {{/if}}
{{$msg}}
{{elseif $_GET.err}} {{if $_GET.msg|match:"attach"}} {{:assign msg="Échec attachement amortissement"}} {{elseif $_GET.msg|match:"amortissement"}} {{:assign msg="Échec enregistrement amortissement"}} {{/if}}{{$msg}}
{{/if}}| N° | Date | Libellé | Montant | Valeur nette | N° compte | Compte | |
|---|---|---|---|---|---|---|---|
| #{{$line.trans_id}} | {{$line.date|date_short}} | {{$line.trans_label}} {{if $line.line_label != null && $line.line_label != $line.trans_label}} — {{$line.line_label}} {{/if}} | {{"%f"|math:$line.amount|money_html:false|raw}} | {{"%f"|math:$solde|money_html:false|raw}} | {{$line.account_code}} | {{$line.account_label}} | {{:linkbutton label="Détacher" href="detach_amort.html?immo_doc_id=%s&amort_line_id=%s"|args:$_GET.immo_doc_id:$line.line_id shape="minus"}} |
Aucun amortissement enregistré pour cette immobilisation
{{/if}} {{if $free_amort_lines}}
Il y a des écritures d'amortissement qui ne sont pas rattachées à une immobilisation !
Utilisez le bouton « Rattacher un amortissement » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation.