Issue: additional question in certain situation

Hi

If the type is Rechtspersoon and the percentage is 0%, there has to appear a question. I have a situation like that, but the question is not displayed.

{% stripnewlines %}
{% newline %}
|Naam
|Type
|Bruto dividend
|% RV
|Bedrag RV
{% newline %}

—:
—:
—:#

{% fori detail in custom.dividenden %}
{% newline %}
|{% input detail.naam %}
|{% input detail.type as:select options:“Natuurlijk persoon|Rechtspersoon” %}
|{% $1+input detail.ontvangen_bedrag as:currency placeholder:" " %}
|{% input detail.percentage as:select options:“0|5|10|15|17|20|30” option_values:“0|0.05|0.10|0.15|0.17|0.20|0.30” %}%
|{% assign bedrag_RV = detail.ontvangen_bedrag*detail.percentage as:currency %} {% =$2+ bedrag_RV %}
{% if detail.percentage == 0 %}
{% $3+ detail.ontvangen_bedrag %}
{% elsif detail.percentage == 0.05 %}
{% $4+ detail.ontvangen_bedrag %}
{% elsif detail.percentage == 0.10 %}
{% $5+ detail.ontvangen_bedrag %}
{% elsif detail.percentage == 0.15 %}
{% $6+ detail.ontvangen_bedrag %}
{% elsif detail.percentage == 0.17 %}
{% $7+ detail.ontvangen_bedrag %}
{% elsif detail.percentage == 0.20 %}
{% $8+ detail.ontvangen_bedrag %}
{% elsif detail.percentage == 0.30 %}
{% $9+ detail.ontvangen_bedrag %}
{% endif %}
{% endfori %}
{% newline %}
|TOTAAL
|
|{{ $1 | currency }}
|
|{{ $2 | currency }}
{% endstripnewlines %}

{% ic %}{::warningtext}
Opgelet - op aangifte 273A in de kolom van 0% komt NIET de liquidatiebonus voortkomend uit aangelegde liquidatiereserves (dividend aan 0% RV indien aantasting van de liquidatiereserves bij de vereffening van een vennootschap)
{:/warningtext}{% endic %}

{% ic %}{::infotext}
5%: voor bv. liquidatiereserves uitgekeerd na de 5-jarige wachttermijn
30%: tarief RV voor dividenden toegekend of betaalbaar gesteld vanaf 01/01/2017
{:/infotext}{% endic %}

{% if detail.type == “Rechtspersoon” and detail.percentage ==0 %}Langer dan 1 jaar in bezit? {% input custom.aandelen.bezit as:select options:"Ja|Nee %}{% endif %}

Hi Sylvia,

detail.type can only be used inside your fori loop. can your try to add a variable inside your fori loop to determine whether the question has to be shown?

Regards,

Michiel

Hi Michiel

I’ve tried to add custom. but then all types are overwritten by the first chosen type.

Gr.
Sylvia

Sylvia,

detail.type is part of a collection, so it’s not a single variable, it exists for all details in your collection

What I recommend you to do is to define a local variable before your fori loop and assign the value false to it. Inside your fori loop you could add following check (assuming your local variable is ‘check_question’ )

{% if detail.type == “Rechtspersoon” and detail.percentage ==0 %}{% assign check_question = true %}{% endif %}

After your fori loop you could check whether the value of the local variable is true:

{% if check_question == true %}Langer dan 1 jaar in bezit? {% input custom.aandelen.bezit as:select options:"Ja|Nee" %}{% endif %}

This means if at least one line fulfills the condition, the question will be shown.

Michiel