Template SME investment reserve

Hello fellow users,
After following the workshops ‘Let’s get technical’ I’ve tried to build a template for the SME investment reserve. See code below:

**Aangelegde reserves**<br>

|                 Jaar          |     Bedrag    |
|----------40%--------------|-------------------------------------------------------:+ {% fori detail in current_account.details %}
|       {% input detail.custom.jaartal %}                   |               {% $5+input detail.custom.bedrag as:currency %}{% endfori %}<br>
{% unexplained $5+current_account.value %}                                             | |        **Totaal aangelegde reserves: {{$5 | currency}}** <br>

**Investeringen**<br>

|         Omschrijving         |           Datum         |         Bedrag      |
|-----------40%-----------------|-----------20%-----------|----------40%----------:+
| <br> _Kantoormaterieel_|                               |                         |                      {% fori kantoormaterieel in period.custom.kantoormaterieel %}
|{% input kantoormaterieel.omschrijving %} | {% input kantoormaterieel.datum as:date %}   | {% $1+input kantoormaterieel.bedrag as:currency %} | {% endfori %}
|                               |                         |      *Totaal kantoormaterieel: {{$1 | currency }}*
| <br> _Beveiligingskosten_|                               |                         |                      {% fori beveiliging in period.custom.beveiliging %}
|{% input beveiliging.omschrijving %} | {% input beveiliging.datum as:date %}   | {% $2+input beveiliging.bedrag as:currency %} | {% endfori %}
|                               |                         |      *Totaal beveiligingskosten: {{$2 | currency }}*
| <br> _Machines en gereedschap_|                               |                         |                      {% fori machines in period.custom.machines %}
|{% input machines.omschrijving %} | {% input machines.datum as:date %}   | {% $3+input machines.bedrag as:currency %} | {% endfori %}
|                               |                         |      *Totaal machines en gereedschap: {{$3 | currency }}*
| <br> _Kosten van onderzoek & ontwikkeling_|                               |                         |                      {% fori onderzoek in period.custom.onderzoek %}
|{% input onderzoek.omschrijving %} | {% input onderzoek.datum as:date %}   | {% $4+input onderzoek.bedrag as:currency %} | {% endfori %}
|                               |                         |      *Totaal kosten van onderzoek & ontwikkeling: {{$4 | currency }}*
<br> <br>                                |                         |      **Totaal bedrag investeringen: {{$1+$2+$3+$4 | currency }}**

Hey @CedricDeVos,

Seems okay, no? Of course, I don’t really know what exactly this template should do, but it works looking it at a first glance. You wish for us to optimalize it a bit, purely based on the code?

(ps keep topics in English please :pray: )

Hey Sven,

My apologies for the misunderstanding, I have adjusted this in the meantime.

The first problem is that the categories ‘Kantoormaterieel’, ‘Beveiligingskosten’, etc. are fixed in the template. Is it possible for putting in another fori loop? Then I was thinking of an extra column between ‘Datum’ & ‘Bedrag’ named ‘Ref.’ In this column I would fill in the year the investment was used in the investment reserve.

Is it also possible that for example I’ve filled in 2 times 2011 in this column, it gives a total at the bottom of the page of the year 2011 and not 2 times the value 2011?

Thanks in advance!

Hi Cedric

You might try using the reference to create a variable with that reference (cfr. Variables with variable names (eg fiscal parameters))

Everytime the same reference is used, add the value of that row to the variable with the reference.
At the bottom of the page you can then show the total of the variable.

Hopefully this helps.

Kind regards
Sam