Template Annex to the table of taxed reserves

Hallo,

In the template you have column with titel “Fiscal reserves end financial year”. This column is a sum of 4 columns.

The amount in column from current year would be copied n the column with titel “Fiscal reserves end previous financial year” in the template of a new year.

Is this possible and how?

Thanks,

Sylvie

Hello @svalais,

I think I know what you mean by this.

Let’s say in your reconciliation template with handle “test” (your template has to have a handle for this so you can link to it later on) you have an input object custom.investment.amount . It’s this object that should be given in a different column (object) if it’s the next year, right?

So, we have the handle of the template (“test”), and we know the name of the object (custom.investment.amount).

In any template (even the current template) you’ll be able to link to this object in a certain period with following code :

period.reconciliations.test.custom.investment.amount

Of course, you do need this object and its value, but in the previous period instead of the current one.
So if you add this to the code: minus_1y you’ll be able to do this, as following :

period.minus_1y.reconciliations.test.custom.investment.amount

If you have this, you can link in another object to this new object with a placeholder_default

Hope this helps you further. If not, don’t hesitate to ask.

Hello Sven,

Thanks for your answer but I have another problem.

In the code I have:

**{% assign belaste_reservesPY = period.minus_1y.reconciliations.belaste_reserves %}**

**|_{% t "Andere in de balans vermelde reserves" %}_ {% ic %}| {% endic %} | |  | | | |  | {% ic %}| {% endic %}{% fori balans in custom.balans_reserves %} _**
**_| _{% input balans.omschrijving placeholder_default:belaste_reservesPY.balans.omschrijving %}_ {% ic %}|{% endic %}         | {% $0+input balans.fiscale_reserve as:currency _placeholder_default:belaste_reservesPY.balans.fiscale_reserve_ %} | {% $1+input balans.wijz_controleur as:currency placeholder:'' %} |{{ $0+$1 | currency }} | {% $2+input balans.Kapitaal_Bew_bkj as:currency placeholder:'' %} | {% $3+input balans.Kapitaal_JV_RW as:currency placeholder:'' %} | {{ $0+$1+$2+$3 | currency }} {% ic %}|{% endic %} | {% endfori %}**

This is a table of multiple lines.

I tried to use your solution for the lines but it’s not working.

Can you help me?

Thanks,

Sylvie

Hello @svalais,

I see you try to link an input-field for description from current year to last year.

Isn’t it a better alternative to just copy the whole reconciliation template from one period to another? It will copy everything, and the user can adjust the fields if he wants to.

I’m not sure if you follow me? In the working papers there’s an option for “copy details” that does just that.

Can you try it out?

Hello Sven,

In the code I also try to link the amount of previous year of the line but it does not work.

This is the code:

|_{% t "Andere in de balans vermelde reserves" %}_ {% ic %}| {% endic %} | |  | | | |  | {% ic %}| {% endic %}{% fori balans in custom.balans_reserves %} 
| {% input balans.omschrijving %} {% ic %}|{% endic %}         | **{% $0+input balans.fiscale_reserve as:currency placeholder_default:belaste_reservesPY.results.totaal_andere_balans_eind_line %}** | {% $1+input balans.wijz_controleur as:currency placeholder:'' %} |{{ $0+$1 | currency }} | {% $2+input balans.Kapitaal_Bew_bkj as:currency placeholder:'' %} | {% $3+input balans.Kapitaal_JV_RW as:currency placeholder:'' %} | {{ $0+$1+$2+$3 | currency }} **{% result 'totaal_andere_balans_eind_line' ($0+$1+$2+$3) %}**{% ic %}|{% endic %} | {% endfori %}

I can’t use the copy for the amount because the amounts would not be correct, so I need to link the description too from previous year.

Thanks,

Sylvie

Hi @svalais,

Sorry for the late reply, but your question is a bit more complicated as what to I’ve said in the previous post.

But here it goes (it’s not based on your code, for the reason it’s better to explain it):

{% assign last_year = period.minus_1y.custom.reserves %}
{% assign $0 = 0 %}{% assign $1 = 0 %}


{% stripnewlines %}
{% newline %}
|     Column A        |       Column B            |     Column C          |     Column D  |
{% newline %}
|---------------------|-------------25%-----------|-----------25%---------|---------25%------------+
{% fori res in period.custom.reserves %}
  {% capture col_b %}amount_b_{{ forloop.index0 }}{% endcapture %}
  {% newline %} 
    | {% input res.omschr %} 
      {% for res in last_year %}
        {% if res[col_b] != 0 %}
          last year: {{ res[col_b] | currency }}
        {% endif %}
      {% endfor %}
    | {% $0+input res[col_b] as:currency %}
    | **{{ $0+$1 | currency }}**
{% endfori %}

We create a collection, and it’s important to attach the collection to the period-drop, because that way we can call items from that collection from last year.

period.custom.reserves

Create the collection for items of last year :

{% assign last_year = period.minus_1y.custom.reserves %}

We are going to fill that collection with an item. The thing is, that we need to index those items as well (so the results of the current collection are linked to the same items from last year, which is a different collection).
Normally, you can do this by adding [forloop.index0] but in a collection you can’t go any further than 2 levels deep (unfortunately).

So, to fix that, we’ll capture it in our fori-loop:

{% capture col_b %}amount_b_{{ forloop.index0 }}{% endcapture %}

So, for each iteration of a loop, we’ll get the result of [col_b] as: amount_b_0 (first loop), amount_b_1 (second loop), and so on…

We’ll create that item in our collection period.custom.reserves :

{% $0+input res[col_b] as:currency %}

Now, the next year I want those results as well (which were inputted last year), and those values are in our collection last_year.
With a forloop in our fori-loop, we’ll need to get those items (with the same index of course):

      {% for res in last_year %}
        {% if res[col_b] != 0 %}
          last year: {{ res[col_b] | currency }}
        {% endif %}
      {% endfor %}

This is the way to call for items in a collection from a previous period.
If you need items from a previous period not in a collection, the first post is a way to do it (and less complicated though).

Hope this helps you further; let me know if something is unclear.