I think one of the managing directors is not recognized as a ‘Rechtspersoon’ in the case of ‘Lantman NV’. As a result, the sentence ‘met als vaste vertegenwoordiger…’ is not appearing.
It’s probably related to the fact that the database variable director.custom.type is in fact blank, while a default will be assigned to.
In other words: in that dropdown that is presented, you’ll see a value filled in by default, while actually the database will be empty (because it is a default).
In our standard templates we do this:
{% comment %}it is the db var "represented_by_name" that decides if a person is legal or not - needed for default dropdown LEGAL OR NOT{% endcomment %}
{% assign default_type = "" %}
{% if person.custom.represented_by_name != blank %}
{% assign default_type = "legal" %}
{% else %}
{% assign default_type = "nature" %}
{% endif %}
{% comment %}look at the dropdown to check whether someone is LEGAL or not{% endcomment %}
{% assign type = person.custom.type | default:default_type %}
And then check on the local var type instead of the database variable person.custom.type. This way the code will always work correctly
The check if a director is a legal person is not working because it’s currently not linked to your forloop {% for director in period.directors %}.
Instead of:
{% comment %}it is the db var “represented_by_name” that decides if a person is legal or not - needed for default dropdown LEGAL OR NOT{% endcomment %}
{% assign default_type = “” %}
{% if person.custom.represented_by_name != blank %}
{% assign default_type = “legal” %}
{% else %}
{% assign default_type = “nature” %}
{% endif %}
{% comment %}look at the dropdown to check whether someone is LEGAL or not{% endcomment %}
{% assign type = person.custom.type | default:default_type %}
Please try this:
{% comment %}it is the db var “represented_by_name” that decides if a person is legal or not - needed for default dropdown LEGAL OR NOT{% endcomment %}
{% assign default_type = “” %}
{% if director.custom.represented_by_name != blank %}
{% assign default_type = “legal” %}
{% else %}
{% assign default_type = “nature” %}
{% endif %}
{% comment %}look at the dropdown to check whether someone is LEGAL or not{% endcomment %}
{% assign type = director.custom.type | default:default_type %}