List of all investments

Dear community
I’m trying to make a text template of all the investments. I’m doing this on the info that was provided in the template “afschrijvings & investeringstabel”. But when I try to access the details in my text template it will only give the details after the date “Einde eerste boekjaar” which was provided when creating the dossier. Is there any workaround to give all the provided details since I cannot change the date of the first bookyear in the parameters.

Hey @Julie_Vandekerckhove,

You can ask our fist line chat to adjust that date. What you said is true: because of this date you can’t access data from before that date, because those period drops don’t exist.

However, I’m not sure how exactly you link to those details, so it might be something else. But I suggest to change this for now. Keep us posted if it works for you or not.

Hi Sven

This will resolve our problem with the details. However I’m having another related problem.
I’m getting all my info from the details provided by the details added to specific asset account. eg. Installations has 4 lines of details added in the “afschrijvings en investeringstabel” template.

The objective of the text which I’am creating is to export the depreciation table as similar as possible to the old ones we used to use.
But now, when I preview the details they do not have the same order as they do in the details as seen in the pic above, they come out this way:

Used code:
_Installaties_{% assign current_account = #230000 %}

|Jaar|vorig bj |a/b |boekjaar|Waarde|D/L|%|Vorige boekj|Boekj|Balans|BW|
|--10%--|--10%--|--5%--|--10%--|--10%--|:--5%--:|:--5%--:|--10%-|--10%-|--10%--|---:+ {% fori detail in current_account.details %}
{% stripnewlines %}
|{{detail.date }} 
|{{detail.value | currency}}
|a
| XXX
|{{detail.value | currency}} {% assign $4 = detail.value %}
|{{detail.custom.l_d}}
|{{detail.custom.jr}} 
|{{detail.custom.vorige_afschr | currency}} {% assign $2 = detail.custom.vorige_afschr %}
|{{detail.custom.dit_jaar | currency}} {% assign $3 = detail.custom.dit_jaar %}
|{{$2+$3 |currency }} 
|{{ $4-$2-$3 | currency}}
{% endstripnewlines %} {% endfori %}

So the sorting is all over the place, they need to be in a chronological order in some way.
The eventual goal is to sum up all the lines per year.

Hey @Julie_Vandekerckhove,

You should use the addnewinputs-tag, which allows to sort a collection (which details is basically) on a certain value.

I’d add this in your code:

{% assign current_account = #230000  %}

{% addnewinputs %}
  {% assign details = current_account.details | sort:'date' %}
{% endaddnewinputs %}

This creates a variable details which is really a collection that is sorted on the field ‘date’.

In your fori-loop you can use this then:

{% fori detail in details %}