Issue: one of the managing directors is not recognized as a legal person

Hi

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.

Overzicht van de bedrijfsleiding
{% stripnewlines %}
{% newline %}
|Bedrijfsleiders
|Begin mandaat
|Einde mandaat
{% newline %}

—:{% ic %}#{% endic %}{% nic %}+{% endnic %}{% for director in period.directors%}
{% assign words = director.name
{% assign lastname = “” %}
{% assign person_first_name = “” %}
{% assign current_signature = “” %}
{% for word in words %}
{% if forloop.last %} {% comment %}correct for syncs like adminis{% endcomment %}
  {% assign person_first_name = word %}
{% else %}
  {% assign lastname = lastname | append:" " | append:word %}
{% endif %}

{% endfor %}
{% newline %}
{% if director.custom.first_name == blank and director.custom.last_name == blank %}
{% assign current_signature = director.name %}
{% elsif director.custom.first_name == blank and director.custom.last_name != blank %}
{% assign current_signature = current_signature | append:person_first_name | append:" " | append:director.custom.last_name %}
{% elsif director.custom.first_name != blank and director.custom.last_name == blank %}
{% assign current_signature = current_signature | append:director.custom.first_name | append:" " | append:lastname %}
{% else %}
{% assign current_signature = current_signature | append:director.custom.first_name | append:" " | append:director.custom.last_name %}
{% endif %}
|{{ current_signature }}{% if director.custom.type ==“legal” %} met als vaste vertegenwoordiger {{ director.custom.represented_by_name }}{% endif %}
|{{ director.director_start_date | date:“%d/%m/%Y” }}
|{{ director.director_end_date | date:“%d/%m/%Y” }}
{% endfor %}
{% endstripnewlines %}

‘Bedrijfsparameters’:

Hi Sylvia

Please change this part of code

{% if director.custom.type ==“legal” %}

to

{% assign default_type = "" %}
{% if director.name != blank %}
  {% if director.custom.represented_by_vat != blank %}
    {% assign default_type = "legal" %}
  {% else %}
    {% assign default_type = "nature" %}
  {% endif %}
{% endif %}

{% assign type = director.custom.type | default:default_type %}
		{% if type == "legal" %}

Please let me know if it works.

Regards,
Jelena

Hi Jelena

Unfortunately not.

Gr.
Sylvia

Hey @sylvia.debaeremaeker,

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

Hi Sven

So i added this to the original code, but now none of the ‘vertegenwoordigers’ appear.

Overzicht van de bedrijfsleiding
{% stripnewlines %}
{% newline %}
|Bedrijfsleiders
|Begin mandaat
|Einde mandaat
{% newline %}

—:{% ic %}#{% endic %}{% nic %}+{% endnic %}{% for director in period.directors%}
{% assign words = director.name
{% assign lastname = “” %}
{% assign person_first_name = “” %}
{% assign current_signature = “” %}
{% for word in words %}
{% if forloop.last %} {% comment %}correct for syncs like adminis{% endcomment %}
  {% assign person_first_name = word %}
{% else %}
  {% assign lastname = lastname | append:" " | append:word %}
{% endif %}

{% endfor %}
{% newline %}
{% if director.custom.first_name == blank and director.custom.last_name == blank %}
{% assign current_signature = director.name %}
{% elsif director.custom.first_name == blank and director.custom.last_name != blank %}
{% assign current_signature = current_signature | append:person_first_name | append:" " | append:director.custom.last_name %}
{% elsif director.custom.first_name != blank and director.custom.last_name == blank %}
{% assign current_signature = current_signature | append:director.custom.first_name | append:" " | append:lastname %}
{% else %}
{% assign current_signature = current_signature | append:director.custom.first_name | append:" " | append:director.custom.last_name %}
{% endif %}
{% 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 %}
|{{ current_signature }}{% if default_type ==“legal” %} met als vaste vertegenwoordiger {{ director.custom.represented_by_name }}{% endif %}
|{{ director.director_start_date | date:“%d/%m/%Y” }}
|{{ director.director_end_date | date:“%d/%m/%Y” }}
{% endfor %}
{% endstripnewlines %}

Hi
Is someone still looking at this?

Hi @sylvia.debaeremaeker

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 %}

Kind regards,
Kimberly