Template shares

Hi there,

We are building an account template which gives the history of a specific share account.

In the first chapter we give an overview of the purchase and sale of shares and that total (in this example 15.500,00 is linked with to give us the green dot at the top of the page)

Then we let the user give in the value according to the investment portfolio (in this case 39,00)

Then a calculation tells us if there is a ‘meerwaarde’ or ‘minderwaarde’. (in this case 'minderwaarde van 15.461,00).
I already added a hashtag with let the user select the depreciation value of that specific share account.
When the account is selected I want to show a green dot (or red triangle) if that value matches the value calculated in ‘minderwaarde’ (15.461,00).

Is that possible?

At the bottom of the page I let the user also give a history of the deprecations (15.461,00). Is it also possible to link that value with the previous ‘15.461,00’ and give a green dot (or red triangle)?

| Uittreksel | Datum | Omschrijving | Aantal | Koerswaarde in EUR | Waarde in % | EUR/EUR | Totaal
|----5%------|--7%---|-----35%------|--10%--:|-----------------10%--------------:|--10%--:|----------5%----------:|------:+{% fori aandelen in custom.aandelen %}
| {% input aandelen.uittreksel %}| {% input aandelen.datum as:date '%d/%m/%y' %}| {% input aandelen.omschrijving %}| {% input aandelen.aantal as:currency %}| {% input aandelen.koers as:currency %}| {% input aandelen.waarde as:percentage %}|{{ 1 | currency }}| {% =$1+ aandelen.aantal*aandelen.koers*aandelen.waarde|currency %} {% endfori %}
|  |  |  |  |  |  |  | {% if $1 <> 0 %} **{{ $1 | currency }}**`
{% endif %}

<br>

|----5%------|--7%---|-----10%------|--10%--:|-----------------35%--------------:|--10%--:|----------5%----------:|------:+
|||||Waarde volgens de beleggingsportefeuille per|{% input custom.beleggingsportefeuille.datum as:date '%d/%m/%y' %}||{% $3+input custom.beleggingsportefeuille.waarde as:currency default:$2+$1%}
||||||||
||||||||{% if $1 > $3 %} Minderwaarde van {% =$4+ $1-$3|currency %} {% elsif $1 <= $3 %} Meerwaarde van {% =$4+ $3-$1|currency %} {% endif %} {% input custom.waardevermindering.range as:account_collection range:51,52 %}

<br>

{% if $1 > $3%}
|----5%------|--7%---|-----10%------|--10%--:|-----------------35%--------------:|--10%--:|----------5%----------:|------:+{% fori waardevermindering in custom.waardevermindering %}
|||||Geboekte waardevermindering per|{% input waardevermindering.datum as:date '%d/%m/%y' %}||{% $5+input waardevermindering.waarde as:currency %} {% endfori %}
|||||||| **{{ $5 | currency }}**
{% endif %}

{% unreconciled $1+$2-current_account.value %}

Thanks in advance!

Hi Cedric,

Yes, both are possible! For the first one your code could look like this

{% input custom.waardevermindering.range as:account_collection range:51,52 accounts_var:waardevermindering%}{% unreconciled waardevermindering-$4 as:indicator%}

For the second one, the following reconciliation tag can be used:

**{{ $5 | currency }}** {% unreconciled $5-$4 as:indicator %}

Regards,

Michiel

Hi Michiel,

Thanks for your answer!

It works!

But there is one strange thing about this. When I link the depreciation account using the hashtag a new line ‘Geboekte waardevermindering per’ shows up (3rd line in the picture) but all dots are green.

When I delete that extra line (3rd line) it gives this as result;

What is going on? :slight_smile:

Regards,
Cedric

Hi Cedric,

I had a closer look and here’s what goes wrong: your hashtag is named custom.waardevermindering.range. However, you want to use the same custom (custom.waardevermindering) as a collection of your fori loop!

Changing the naming of the collection of your fori loop will work.

Regards,

Michiel

1 Like

Hi Michiel,

In the calculation there are some rouding differences (see below).
In our calculation the sum in total is 58.127,28.

The totals in the right column are calculated automatically by Silverfin.
Is there a way to let the user do some modificationsin this column? But when the value is correct, it should calculate with the value from Silverfin.

Is this possible?

Kind regards,
Cedric

Hi Cedric

There is a way to make automatically calculated ‘Totaal’ values editable by changing this code

{% =$1+ aandelen.aantal*aandelen.koers*aandelen.waarde|currency %}

to

{% assign temp_value = aandelen.aantal*aandelen.koers*aandelen.waarde %}{%$1+input aandelen.sub_total_value as:currency default:temp_value %}

Regards,
Jelena

Hi Jelena,

Thank you! Is it also possible to change it in this piece of code because when I try this it doesn’t make a sum anymore. Standard the value ‘-’ is filled in in the column ‘Totaal’.

**Waarde aandelen op aankoopdatum**

| Uittreksel | Datum | Omschrijving | Aantal | Koerswaarde in {{ vreemde_munt }} | Waarde in % | {{ vreemde_munt }}/EUR | Totaal
|----5%------|--7%---|-----35%------|--10%--:|-----------------10%--------------:|--10%--:|----------10%----------:|------:+{% fori aandelenvv in custom.aandelenvv %}
| {% input aandelenvv.uittreksel %}| {% input aandelenvv.datum as:date '%d/%m/%y' %}| {% input aandelenvv.omschrijving %}| {% input aandelenvv.aantal as:currency %}| {% input aandelenvv.koers_vreemde_munt as:currency %}| {% input aandelenvv.waarde as:percentage %}| {% input aandelenvv.koerswaarde_vreemde_munt_in_EUR %}| {% =$2+ aandelenvv.aantal*aandelenvv.koers_vreemde_munt*aandelenvv.waarde/aandelenvv.koerswaarde_vreemde_munt_in_EUR|currency %} {% endfori %}
|{% if $2 <> 0 %}
|  |  |  |  |  |  |  | **{{ $2 | currency }}**
{% endif %}

<br>

|----5%------|--7%---|-----10%------|--10%--:|-----------------35%--------------:|--10%--:|----------5%----------:|------:+
|||||Koers {{ vreemde_munt }}/EUR per|{% input custom.koers.datum as:date '%d/%m/%y' %}||{% $6+input custom.koers.waarde %}

**Waarde aandelen op afsluitdatum**

| Uittreksel | Datum | Omschrijving | Aantal | Koerswaarde in {{ vreemde_munt }} | Waarde in % | {{ vreemde_munt }}/EUR | Totaal
|----5%------|--7%---|-----35%------|--10%--:|-----------------10%--------------:|--10%--:|----------10%----------:|------:+{% for aandelenvv in custom.aandelenvv %}
| {% input aandelenvv.uittreksel %}| {% input aandelenvv.datum as:date '%d/%m/%y' %}| {% input aandelenvv.omschrijving %}| {% input aandelenvv.aantal as:currency %}| {% input aandelenvv.koers_vreemde_munt as:currency %}| {% input aandelenvv.waarde as:percentage %}| {{ $6 }}| {% =$7+ aandelenvv.aantal*aandelenvv.koers_vreemde_munt*aandelenvv.waarde/$6|currency %} {% endfor %}
|{% if $7 <> 0 %}
|  |  |  |  |  |  |  | **{{ $7 | currency }}**
{% endif %}

Cedric

Sum was not shown, because here was division by ‘blank’ or 0 value.
I added if statement checking if value of aandelenvv.koerswaarde_vreemde_munt_in_EUR is ‘blank’ or 0.

Instead of this code:

{% =$2+ aandelenvv.aantal*aandelenvv.koers_vreemde_munt*aandelenvv.waarde/aandelenvv.koerswaarde_vreemde_munt_in_EUR|currency %}

try this:

{% if aandelenvv.koerswaarde_vreemde_munt_in_EUR == blank or aandelenvv.koerswaarde_vreemde_munt_in_EUR == 0 %}{% assign temp_value = 0 %}{% else %}{% assign temp_value = aandelenvv.aantal*aandelenvv.koers_vreemde_munt*aandelenvv.waarde/aandelenvv.koerswaarde_vreemde_munt_in_EUR %}{% endif %}{%$2+input aandelenvv.sub_total_value as:currency default:temp_value %}

Regards,
Jelena

Hi Jelena,

Thanks for this! Just only one problem (see below)

The values in the second table are copies from the first one, but when I change the column ‘Totaal’ the second column doesn’t change this value. Or is there a way to let the user also change this value in the column ‘Totaal’?

How can I solve this?

Kind regards,
Cedric

Hi Cedric

Please amend this part of code:

{% =$7+ aandelenvv.aantal*aandelenvv.koers_vreemde_munt*aandelenvv.waarde/$6|currency %}

to

{% if $6 == blank or $6 == 0 %}{% assign temp_value2 =0 %}{% else %}{% assign temp_value2 = aandelenvv.aantal*aandelenvv.koers_vreemde_munt*aandelenvv.waarde/$6 | default:0 %}{% endif %}{%$7+input aandelenvv.sub_total_value2 as:currency default:temp_value2 %}

Default value of sub-total in second table is calculated as aandelenvv.aantal*aandelenvv.koers_vreemde_munt*aandelenvv.waarde/$6
$6 is currency exchange rate specified by user. If user has not specified currency exchange rate or specified as 0 - sub-total value is displayed as 0,00.
User can amend default value.

Please let me know if this works.

Regards,
Jelena