Making text field dependant of which company_form is used

Hi,

We are trying to create a account template where we want de make a table dependant of the company-form. We use this code:

{% comment %}Groepsstructuur{% endcomment %}
{% newline %}
| {% t “Maakt dit dossier deel uit van een groepsstructuur?” %}{% if vennootschapsvorm != ‘VZW’ or vennootschapsvorm != ‘ASBL’%}{::infotext}{% t “Uw antwoord kan hier afwijken van de vraag onder de module Vennootschapsbelasting.” %}{:/infotext}{% endif %}
| {% input custom.check.groepsstructuur as:select options:‘Ja|Nee’%}

As we tested this in de documents everything worked fine but by using this in the real life template the company_form if statement doesn’t work anymore.

Do you have a clue?

Hi Jonas

If you print the variable vennootschapsvorm. Does it contain any data?

If there is no data in that variable, you will probably still have to assign the company form to vennootschapsvorm.

{% assign vennootschapsvorm = company.company_form %}

Hi Robbe,

The assign tag was mentioned at the start of the template. My apologies for not mentioning this :slight_smile:

If we print the variable {{ vennootschapsvorm }} we get “VZW”.

Jonas

Hi Jonas

What is it exactly you want, or don’t want, to display regarding the if statement?

Robbe

Hi Robbe,

We try to display the info-tag whenever the company form is different from ‘VZW’ or ‘ASBL’.

We will use this if statement in lots of different templates as we want to differentiate templates and fields from the company_form.

Jonas

Hi Jonas

I have made a small edit to your code.
Instead of using an if statement. I would use an unless statement

So unless the company_form is a “VZW” or “ASBL”, we show the infotext

{% assign vennootschapsvorm = company.company_form %}

{% stripnewlines %}
|--------
|--------
{% newline %}
| {% t "Maakt dit dossier deel uit van een groepsstructuur?" %}
  {% unless vennootschapsvorm == "VZW" or vennootschapsvorm == "ASBL" %}
  {::infotext}{% t "Uw antwoord kan hier afwijken van de vraag onder de module Vennootschapsbelasting." %}{:/infotext}
{% endunless %}
|{% input custom.check.groepsstructuur as:select options:"Ja|Nee"%}
{% endstripnewlines %}

Regards
Robbe