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

**URL:** <https://community.silverfin.com/t/capture-depreciation-of-the-year-from-investerings-en-afschrijvingstabel-account-model-from-silverfin/1965>\
**Category:** Templates\
**Created:** [December 2, 2020, 5:12pm UTC](https://community.silverfin.com/t/capture-depreciation-of-the-year-from-investerings-en-afschrijvingstabel-account-model-from-silverfin/1965 "2020-12-02T17:12:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandra](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@Alexandra](https://community.silverfin.com/u/Alexandra)\
**Post date:** [December 2, 2020, 5:12pm UTC](https://community.silverfin.com/t/capture-depreciation-of-the-year-from-investerings-en-afschrijvingstabel-account-model-from-silverfin/1965/1 "2020-12-02T17:12:49Z")

</div>

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 :

````auto

{%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%}```
````

---

<div class="post-metadata">

**Author:** ![Gary\_Weimberg](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/gary_weimberg/32/1581_2.png) [@Gary\_Weimberg](https://community.silverfin.com/u/Gary_Weimberg)\
**Post date:** [December 7, 2020, 7:55am UTC](https://community.silverfin.com/t/capture-depreciation-of-the-year-from-investerings-en-afschrijvingstabel-account-model-from-silverfin/1965/2 "2020-12-07T07:55:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Wouter\_Bruynsteen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/wouter_bruynsteen/32/1196_2.png) [@Wouter\_Bruynsteen](https://community.silverfin.com/u/Wouter_Bruynsteen)\
**Post date:** [December 14, 2020, 4:59pm UTC](https://community.silverfin.com/t/capture-depreciation-of-the-year-from-investerings-en-afschrijvingstabel-account-model-from-silverfin/1965/3 "2020-12-14T16:59:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Alexandra](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@Alexandra](https://community.silverfin.com/u/Alexandra)\
**Post date:** [December 15, 2020, 1:36pm UTC](https://community.silverfin.com/t/capture-depreciation-of-the-year-from-investerings-en-afschrijvingstabel-account-model-from-silverfin/1965/4 "2020-12-15T13:36:17Z")

</div>

Bonjour,

Un très grand merci !

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