diff --git a/amortization.html b/amortization.html index 6a2b77b..7e42e78 100644 --- a/amortization.html +++ b/amortization.html @@ -6,9 +6,21 @@ {{:include file="_nav.html" current="amortization"}} {{if $_GET.ok}} -
Amortissement enregistré
+ {{if $_GET.msg|match:"attach"}} + {{:assign msg="Attachement effectué"}} + {{elseif $_GET.msg|match:"detach"}} + {{:assign msg="Attachement supprimé"}} + {{elseif $_GET.msg|match:"amortissement"}} + {{:assign msg="Amortissement enregistré"}} + {{/if}} +{{$msg}}
{{elseif $_GET.err}} -Échec enregistrement amortissement
+ {{if $_GET.msg|match:"attach"}} + {{:assign msg="Échec attachement"}} + {{elseif $_GET.msg|match:"amortissement"}} + {{:assign msg="Échec enregistrement amortissement"}} + {{/if}} +{{$msg}}
{{/if}} {{* récupérer les infos de l'immobilisation *}} @@ -18,12 +30,23 @@ {{:error message=$message}} {{/load}} +{{* liste de toutes les immobilisations gérées *}} +{{#load type="immo"}} + {{:assign + var="info_immos.%s"|args:$line + duration=$duration + amort=$amort + }} + {{:assign var="amort_associes" value=$amort|values}} +{{/load}} +{{:assign var="duree" from="info_immos.%s.duration"|args:$_GET.line_id}} + {{#select line.id as line_id, line.id_account as account_id, line.id_project as project_id, - trans.id as trans_id, line.debit as montant, + trans.id as trans_id, trans.label as label, trans.date as date_achat, y.id as year_id, @@ -37,54 +60,86 @@ :line_id = $_GET.line_id|intval assign=ligne_immo }} -N° | +Date | +Montant | +Solde | +Libellé | +N° compte | +Compte | +Projet | ++ |
---|---|---|---|---|---|---|---|---|
#{{$line.amort_trans_id}} | +{{$line.amort_date|date_short}} | +{{"%f"|math:$line.amort_amount|money}} | +{{"%f"|math:$solde|money}} | ++ {{if $line.amort_label == null}} + {{$line.trans_label}} + {{else}} + {{$line.amort_label}} + {{/if}} + | +{{$line.account_code}} | +{{$line.account_name}} | +{{$line.project_label}} | ++ {{if $line.linked == null}} + {{:linkbutton label="Détacher" href="detach_amort.html?amort_id=%d&immo_id=%d"|args:$line.amort_line:$ligne_immo.line_id shape="plus"}} + {{else}} + {{:linkbutton label="Détacher" href="" shape="lock" class="disabled"}} + {{/if}} + | +
#{{$line.t_amort}} | -{{$line.date_immo|date_short}} | -{{"%f"|math:$line.montant|money}} | -{{"%f"|math:$solde|money}} | -{{$line.libelle}} | -{{$line.account_code}} | -{{$line.nom_compte}} | -{{$line.project_label}} | -- |
{{"%d+1"|math:$num}} | -{{$date_immo}} | -{{"%f"|math:$annuite_courante|money}} | -{{if $solde == 0}}0,00{{else}}{{"%f"|math:$solde|money}}{{/if}} | -- {{if $libelle == null}} - {{:assign libelle="Amortissement "|cat:$ligne_immo.label}} - {{/if}} - {{$libelle}} - | -- | - | {{$project_label}} | -- {{if $all_years|keys|has:$current_year}} - {{:linkbutton - label="Enregistrer" - href="save_amort.html?amount=%d&account=%s&year=%s&trans_id=%d&line_id=%s&project_id=%d&label=%s"|args:$annuite_courante:$ligne_immo.account_id:$current_year:$ligne_immo.trans_id:$_GET.line_id:$project_id:$libelle - shape="right" - }} - {{else}} - {{:linkbutton label="Enregistrer" href="" shape="lock" class="disabled"}} - {{/if}} - | -
{{"%d+1"|math:$num}} | +{{$date_amort}} | +{{"%f"|math:$annuite_courante|money}} | +{{if $solde == 0}}0,00{{else}}{{"%f"|math:$solde|money}}{{/if}} | ++ {{if $libelle == null}} + {{:assign libelle="Amortissement "|cat:$ligne_immo.label}} + {{/if}} + {{$libelle}} + | ++ | + | + | + {{if $enregistrer == 1}} + {{:linkbutton + label="Enregistrer" + href="save_amort.html?amount=%d&account=%s&year=%s&trans_id=%d&line_id=%s&project_id=%d&label=%s"|args:$annuite_courante:$ligne_immo.account_id:$current_year:$ligne_immo.trans_id:$_GET.line_id:$project_id:$libelle + shape="right" + }} + {{else}} + {{:linkbutton label="Enregistrer" href="" shape="lock" class="disabled"}} + {{/if}} + | +
N° | +Date | +Montant | +Libellé | +N° compte | +Compte | +Projet | ++ |
---|---|---|---|---|---|---|---|
#{{$t_id}} | +{{$t_date|date_short}} | +{{"%f"|math:$montant|money}} | +{{if $l_label == null}} + {{$t_label}} + {{else}} + {{$l_label}} + {{/if}} + | +{{$a_code}} | +{{$a_label}} | +{{$p_label}} | ++ {{if $linked != "true"}} + {{:linkbutton label="Attacher" href="attach_amort.html?amort_id=%d&immo_id=%d"|args:$l_id:$ligne_immo.line_id shape="plus"}} + {{else}} + {{:linkbutton label="Attacher" href="" shape="lock" class="disabled"}} + {{/if}} + | +