Capture "Depreciation of the year" from "Investerings- en afschrijvingstabel" (account model from Silverfin)

Hi,

I would like to create a reconciliation called “Table of depreciation” in which I list all investments of the firm.

For that, I’m using details from “Investerings- en afschrijvingstabel” (account model from Silverfin).

I met no problem for all details (for example : detail.custom.title, detail.custom.date, detail.custom.value, etc.) except for “detail.custom.dit_jaar” for which the value is always 0!

I guess the origin of the problem is that the account model “Investerings- en afschrijvingstabel” uses a default value. Consequently, detail.custom.dit_jaar is empty…
{% $10+input detail.custom.dit_jaar as:currency default:proposed_value placeholder:“Afschr. dit jaar” %}

How could I solve this matter ?

Here is my code :


{%ic%}Sélectionner les comptes qui doivent apparaître : {%endic%}{%input custom.invest.range as:account_collection range:2 default:account_range%}

{% assign accounts = period.accounts|range:custom.invest.range%}

---------------------------

->**TABLEAU DES AMORTISSEMENTS {{ period.year_end_date|date:'%d/%m/%Y' }}**<-

---------------------------

{%for current_account in accounts%}

{%assign $22 = 0%}{%assign $23 = 0%}{%assign $24 = 0%}{%assign $25 = 0%}{%assign $26 = 0%}{%assign $27 = 0%}

|:------20%------------------------:|:----10%----------------|:---30%----------------:|--40%--+|
|||
|:------20%------------------------:|:----10%----------------|:---30%----------------:|--40%--+|
|**COMPTE** |**{{ current_account.number }}**| **{{ current_account.name|upcase }}**||
|:------20%------------------------:|:----10%----------------|:---30%----------------:|--40%--+|
||||

{%capture style_titre_amort%}|:---20%---:|:---10%---:|:---5%---:|:---5%---:|:---10%---:|:---10%---:|:---10%---:|:---10%---:|:---10%---:|:---15%---:+{%endcapture%}

{%capture style_corps_amort%}|:---20%----|:---10%---:|:---5%---:|:---5%----:|----10%---:|---10%---:|---10%----:|----10%---:|----10%---:|---15%----:+{%endcapture%}


{% stripnewlines%}
|Description 
|Date Acq.
|Méthode
|Durée
|Valeur<br>Acq.
|Amort.<br>antérieurs
|Solde <br>à amortir
|Amort.<br>ex.
|Amort.<br>total
|Valeur<br>nette
{%newline%}{{ style_titre_amort }}{% for detail in current_account.details %}
{%newline%}
{%newline%}{{ style_corps_amort }}
{%newline%}
|{{ detail.custom.title}}
|{{ detail.date |date:'%d/%m/%Y'}}
|{{ detail.custom.l_d }}
|{{ detail.custom.jr }}
|{%=$22+ detail.custom.value|currency %} {%$32+ detail.custom.value %}
|{%=$23+ detail.custom.vorige_afschr|currency %} {%$33+ detail.custom.vorige_afschr %}
|{{ detail.custom.value-detail.custom.vorige_afschr|currency }}{%$24+ detail.custom.value-detail.custom.vorige_afschr %}{%$34+ detail.custom.value-detail.custom.vorige_afschr %}
|{%=$25+ detail.custom.dit_jaar %} {%$35+ detail.custom.dit_jaar %}
|{{ detail.custom.vorige_afschr+detail.custom.dit_jaar|currency }}{%$26+ detail.custom.vorige_afschr+detail.custom.dit_jaar %}{%$36+ detail.custom.vorige_afschr+detail.custom.dit_jaar %}
|{{ detail.custom.value-detail.custom.vorige_afschr-detail.custom.dit_jaar|currency }}{%$27+ detail.custom.value-detail.custom.vorige_afschr-detail.custom.dit_jaar %}{%$37+ detail.custom.value-detail.custom.vorige_afschr-detail.custom.dit_jaar %}{%endfor%}
{%newline%}{{ style_corps_amort }}
{%newline%}
|**Total compte**
|
|
|
|**{{ $22|currency }}**
|**{{ $23|currency }}**
|**{{ $24|currency }}**
|**{{ $25|currency }}**
|**{{ $26|currency }}** 
|**{{ $27|currency }}** 
{%newline%}{{ style_corps_amort }}
{%newline%}|||||{% endstripnewlines%}

{%endfor%}

<br>

{{ style_corps_amort }}
|||
{{ style_corps_amort }}
{%stripnewlines%}|**TOTAL  EXERCICE**
|
|
|
|**{{ $32|currency }}**
|**{{ $33|currency }}**
|**{{ $34|currency }}**
|**{{ $35|currency }}**
|**{{ $36|currency }}** 
|**{{ $37|currency }}** 
{%newline%}
{{ style_corps_cession }}
{%newline%}
|||||
{%endstripnewlines%}```

Hi Alexandra,

For the moment it is indeed hard to get to that variable. We are working on adding the necessary result in the template so you will be able to call it in your template.

Kind regards,

Gary

Hi @Alexandra

We’ve added a couple results in our account template so it’s easier to access the values that have defaults (otherwise you needed to duplicate the code from our template to get the same default).
Here’s an example of how to access the results for the depreciation type (L/D) and the depreciations of the current year, the other values don’t have defaults so you should be able to access them directly:

{% assign asset_accounts = period.accounts.starred | range:"2" %}

{% stripnewlines %}
{% for acc in asset_accounts %}
  {% newline %}
  | {::font size='l'}**Account: {{ acc.mapped_number }}**{:/font}
  {% for detail in acc.custom.details %}
    {% capture investment_key %}investment_{{ acc.mapped_number }}_{{ detail.key }}{% endcapture %}
    {% capture investment_key_depreciations_cy %}{{ investment_key }}_depreciations_current_year{% endcapture %}
    {% capture investment_key_depreciation_type %}{{ investment_key }}_depreciation_type{% endcapture %}
    
    {% assign depreciation_current_year = acc.results.[investment_key_depreciations_cy] %}
    {% assign depreciation_type = acc.results.[investment_key_depreciation_type] %}
    
    {% newline %}
    | Depreciation type: {{ depreciation_type }}
    {% newline %}
    |_ Depreciations current year: {{ depreciation_current_year }} _
  {% endfor %}
  
  {% newline %}
  | **Total depreciations current year: {{ acc.results.depDitjaar }}**
  {% newline %}
  | &nbsp;
{% endfor %}
{% endstripnewlines %}

Kind regards
Wouter

1 Like

Bonjour,

Un très grand merci !

J’ai intégré le tout dans mon code et ça a l’air de fonctionner correctement…