For loop - reproduction of table in other reconcilation

Hi,

I want to reproduce this table below in another reconciliation. How can I do this?
For results or customs I add period.reconciliations.handle…
But for tables I do not know were to put the period.reconciliatons.handle…? Or do I have to capture it and then reproduce?

Is it also possible to reproduce only one collumn of the table in another reconcilation?

Thanks!


{% addnewinputs %}
{% assign lines = custom.lines | sort:'a2'%}
{% endaddnewinputs %}

| {% t "Exemption classification"%}  | {% t "Tax year-number" %} | {% t "Name beneficiary" %} | {% t "Adress beneficiary" %} | {% t "Debt claim, start of the taxable period" %} | {% t "Debt claim, end of the taxable period" %} | {% t "Exempt write down, start of the taxable period" %} | {% t "Exempt write down, end of the taxable period" %} | 
|:---:|:--6%----|:-----------10%---------|:--------10%---|----15%-------:|----15%----:|-----15%-----:|---15%--:+{% for line in lines %}
{% stripnewlines %}
 |{% input line.category_a as:select options:"Increase|Decrease|New|Unaltered" option_values:"1|2|3|4" %} 
 |{% input line.year_a as:number placeholder:'' %} 
 |{% input line.name_a placeholder:''%}
 |{% input line.adress_a placeholder:''%}
 |{% input line.debt_claim_start_a placeholder:'' %}
 |{% input line.debt_claim_end_a placeholder:''%}
 |{%$1+input line.exempt_write_down_start_a as:currency placeholder:''%}
 |{%=$2+input line.exempt_write_down_end_a as:currency placeholder:'' %}
{% endstripnewlines %} {% endfor %}
| |      |              |     | |  | ***{{ $1 | currency }}***| ***{{ $2 | currency }}***| 

Hello @nlondoz,

As far as I know, you are not able to use a table in another reconciliation. IF there is a way, then what you suggested is the only way. Try to capture it and then reproduce it. But I am not sure if this is going to work either. You can try it thought and if it doesn’t work you can drop a reply here and I will have a discuss with my colleagues about your issue.

Regards,
Michail

Hello @michail,

We’ve tried to capture and reproduce the table within the same form. with the capture option.
It worked, however we still try to reproduce the captured table in another form.

If it would have been a variable, it would have been: period.reconciliations.handle.custom.some.thing
But now the variable is a capture function. How can we adress the capture function in the other form; like: period.reconciliations.handle.capture.name ?

Kind regards,

Glenn

Hi @GMOONS,

You can put the variable of the capture in a result tag. So you could do the following:

{% capture 'the_form' %}GENERATE THE FORM{% endcapture %}
{% result 'the_form' the_form %} 

In another template you could do

{{ period.reconciliations.handle.results.the_form }}

Hi,

I was able to reproduce a table in another form with the above capture code.

But now I have the issue that there is a fori loop in my table so that I Always have one row extra if I input a row and when I display my table with the capture tag I also have the last row with all 0.

So now my question: is it possible to capture a table minus the last row?

My code in form A:

{% addnewinputs %}
{% assign lines = custom.lines | sort:'a1' %}
{% endaddnewinputs %}


{% assign a1 = custom.capitalgain.shareholder %}
{% assign a2 = custom.capitalgain.total_amount %}
{% assign a3 = custom.capitalgain.exempt %}
{% assign a4 = custom.capitalgain.taxed0 %}
{% assign a5 = custum.capitalgain.taxed25 %}
{% assign a6 = custom.capitalgain.taxed33 %}


| {% t "Name subsidiary" %} | {% t "Total amount" ´%}  | {% t "Exempt amount" %} | {% t "Taxed at 0,412%" %} | **{% t "Taxed at 25,75%" %}** | **{% t "Taxed at 33,99%" %}**
|:--------------------------|:-------------------------|:------------------------|:--------------------------|:------------------------------|:----+{% for line in lines %}
{% stripnewlines %}
  |{% input line.a1 as placeholder:"Name" %} 
  |{% input line.a2 as:currency as placeholder:"Value" %}
  |{% input line.a3 as:currency as placeholder:"Value"  %} 
  |{% input line.a4 as:currency as placeholder:"Value"  %} 
  |{% input line.a5 as:currency as placeholder:"Value"  %}
  |{% input line.a6 as:currency as placeholder:"Value"  %}
{% endstripnewlines %}{% endfor %}



{% capture 'Capital_gain_table' %}

| {% t "Name subsidiary" %} | {% t "Total amount" ´%}  | {% t "Exempt amount" %} | {% t "Taxed at 0,412%" %} | **{% t "Taxed at 25,75%" %}** | **{% t "Taxed at 33,99%" %}**
|:--------------------------|:-------------------------|:------------------------|:--------------------------|:------------------------------|:----+{% for line in lines %}
{% stripnewlines %}
  |{{ line.a1 }} 
  |{{ line.a2  }}
  |{{ line.a3  }} 
  |{{ line.a4  }} 
  |{{ line.a5  }}
  |{{ line.a6 | currency  }}
{% endstripnewlines %}{% endfor %}

{% endcapture %}

My code in form B:

{{ period.reconciliations.working_docs.results.Capital_gain_table }}

Thanks in advance

Dear Tim,

Thanks for the prompt answer!

Indeed, I was able to reproduce my table in another form.
First of all I have the same question as Marnix has.

Secondly, I have the following issue as well:

I capture my fori loop table by using in the capture a calculation, now in my second form I want to check whether the calculation within the captured table != 0 to display the captured table or not. Below is the code used, however the If-check does not seem to work. Can you help me out on that one as well?

Kind regards,

Glenn

Code in form 1:

{% capture 'taxable_reserves' %}

|----80%-----|:--------10%-----:|---10%----------:+{% fori taxable in custom.taxable_reserves %} 
{% stripnewlines %}
| {{ taxable.description }}
|
| {{ taxable.reserves_CY-taxable.reserves_LY |currency }} 
{% endstripnewlines %}{% endfori %}

{% endcapture %}
{% result 'taxable_reserves' taxable_reserves %}

code in form 2:

{% if period.reconciliations.reserves_and_dividends.other.reserves_CY-period.reconciliations.reserves_and_dividends.other.reserves_LY != 0 %}

{{ period.reconciliations.reserves_and_dividends.results.other_reserves }} {% else %}{% endif %}

{% if period.reconciliations.reserves_and_dividends.taxable.reserves_CY-period.reconciliations.reserves_and_dividends.taxable.reserves_LY != 0 %}

{{ period.reconciliations.reserves_and_dividends.results.taxable_reserves }} {% else %} {% endif %}

@marnixcoudre the thing is, at the top of the template you explicitly add an extra item (that’s what the addnewinputs tag does.

It’s probably best to do something like:

{% addnewinputs %}
{% assign lines = custom.lines | sort:'a1' %}
{% endaddnewinputs %} 
{% assign lines_without_extra_input = custom.lines | sort:'a1' %}

and for the form you want to capture, you can use the variable lines_without_extra_input

@GMOONS wrt the code in form 2, do you want to address a result with period.reconciliations.reserves_and_dividends.other.reserves_CY?

Because then you’re probably missing the results in the if (I see you’re using the variable with results when you print it: period.reconciliations.reserves_and_dividends.results.other_reserves

Hi @Tim

In the code in form 2 I would like to test whether the variable other.reserves_CY-other.reservesLY != 0 and if that’s the case that the captured table would be displayed.

As such I’m adressing the variable within the table and not the result (= captured table).

however I get an error that the method to_d is not defined?

Kind regards,

Glenn

@ Tim

Thanks for the solution!

@GMOONS I think you probably want to access the variables of that template then? So you’re missing custom:

period.reconciliations.reserves_and_dividends.custom.other.reserves_CY
iso
period.reconciliations.reserves_and_dividends.other.reserves_CY

correct?