Issue: name manually added in Bedrijfsparameters is not appearing in the template

Hi

The user manually added a name to ‘Bedrijfsparameters’.
However this person (M. De Winter) is not appearing on the template ‘Infoblad’.

Client file

Code ‘Infoblad’:

Overzicht van de aandeelhouders
{% stripnewlines %}
{% newline %}
|Aandeelhouders
|Aantal aandelen
|Eigendom
|Klasse
|% t.o.v. totaal
{% newline %}

—:
—:
—:{% ic %}#{% endic %}{% nic %}+{% endnic %}{% for shareholder in period.shareholders %}
{% if shareholder.custom.represented_by_vat != blank %}
{% assign default_type =“legal” %}
{% else %}
{% assign default_type =“nature” %}
{% endif %}
{% comment %}create local var to indicate whether or not a legal person is selected{% endcomment %}
{% assign type_person = shareholder.custom.type
{% newline %}
{{ shareholder.name }}{% if shareholder.custom.type ==“legal” %} met als vaste vertegenwoordiger {{ shareholder.custom.represented_by_name }}{% endif %}
{{ shareholder.amount_of_shares }}
{{ shareholder.custom.kind_of_shares }}
{{ shareholder.custom.shares_classes }}
{{ shareholder.amount_of_shares/$0
{% endfor %}
{% newline %}
Totaal aantal aandelen
{{ $0
{% endstripnewlines %}



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

—:{% ic %}#{% endic %}{% nic %}+{% endnic %}{% for director in period.directors%}
{% newline %}
{{ director.name }}{% if director.custom.type ==“legal” %} met als vaste vertegenwoordiger {{ director.custom.represented_by_name }}{% endif %}
{{ director.director_start_date
{{ director.director_end_date
{% endfor %}
{% endstripnewlines %}

Hey @sylvia.debaeremaeker,

Are you sure the data was entered in shareholder.name ? Have a feeling the data perhaps was entered in the objects custom.first_name and custom.last_name, and if so, you’ll need to check on those fields and add them in your forloop (as now, you only show .name )

Hi Sven

All i can see, is this:

Which looks correct to me. Can they add a name elsewhere?

That’s what I thought @sylvia.debaeremaeker
They did not enter a name into the .name object but added it in .custom.first_name and .custom.last_name

So adapting your code is needed. This is what we do in our standard templates:

{% stripnewlines %}
| Aandeelhouders | Aandelen | Stemmen | Handtekeningen {% newline %}
|----- |---------:|--------:|:----40%----:+{% newline %}
{% for shareholder in period.shareholders  %}

{% assign default_type = "" %}  {% comment %}check when person is legal or not{% endcomment %}
{% if shareholder.custom.represented_by_name != blank %}
  {% assign default_type = "legal" %}
{% else %}
  {% assign default_type = "nature" %}
{% endif %}
{% assign type = shareholder.custom.type | default:default_type %}

  {% assign street_parts = shareholder.address_1 | split: ' ' %}
  {% assign number_part = false %}
  {% assign number = "" %}
  {% assign street = "" %}
  {% for part in street_parts %}
    {% assign part_down = part | downcase %}
    {% if part contains "1" or part contains "2" or part contains "3" or part contains "4" or part contains "5" or part contains "6" or part contains "7" or part contains "8" or part contains "9" or part contains "0" or part_down == "bus" %}
      {% assign number_part = true %}
    {% else %}
      {% assign number_part = false %}
    {% endif %}
    {% if number_part %}
      {% assign number = number | append:" " | append:part %}
    {% else %}
      {% assign street = street | append:" " | append:part %}  
    {% endif %}
{% endfor %}
{% capture address_street %}{{ street | strip }}{% endcapture %}
{% capture address_number %}{{ number | strip }}{% endcapture %}
{% assign person_city = shareholder.address_2 | remove:"1" | remove:"2" | remove:"3" | remove:"4" | remove:"5" | remove:"6" | remove:"7" | remove:"8" | remove:"9" | remove:"0" | remove:"bus" | remove:"Bus" | remove:"BUS" %}
{% assign person_postal_code = shareholder.address_2 | downcase | remove:"a" | remove:"b" | remove:"c" | remove:"d" | remove:"e" | remove:"f" | remove:"g" | remove:"h" | remove:"i" | remove:"j" | remove:"k" | remove:"l" | remove:"m" | remove:"n" | remove:"o" | remove:"p" | remove:"q" | remove:"r" | remove:"s" | remove:"t" | remove:"u" | remove:"v" | remove:"w" | remove:"x" | remove:"y" | remove:"z"  | remove:" " %}
{% if shareholder.shareholder == true %}
  {% assign words = shareholder.name | split: ' ' %}
  {% 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 %}
  {% if type == "legal" %}
    {% assign current_signature = shareholder.name %}
  {% else %}
    {% if shareholder.custom.first_name == blank and shareholder.custom.last_name == blank %}
      {% assign current_signature = shareholder.name %}
    {% elsif shareholder.custom.first_name == blank and shareholder.custom.last_name != blank %}
      {% assign current_signature = current_signature | append:person_first_name | append:" " | append:shareholder.custom.last_name %}
    {% elsif shareholder.custom.first_name != blank and shareholder.custom.last_name == blank %}
      {% assign current_signature = current_signature | append:shareholder.custom.first_name | append:" " | append:lastname %}
    {% else %}
      {% assign current_signature = current_signature | append:shareholder.custom.first_name | append:" " | append:shareholder.custom.last_name %}
    {% endif %}
  {% endif %}  
  {% if type == "legal" %}
    {% case shareholder.custom.company_form %}
      {% when 1 %}{% assign legal_type = 'SCE' %}
      {% when 2 %}{% assign legal_type = 'OFP' %}
      {% when 6 %}{% assign legal_type = 'CVOA' %}
      {% when 8 %}{% assign legal_type = 'CVBA' %}
      {% when 11 %}{% assign legal_type = 'VOF' %}
      {% when 12 %}{% assign legal_type = 'CV' %}
      {% when 13 %}{% assign legal_type = 'COMMVA' %}
      {% when 14 %}{% assign legal_type = 'NV' %}
      {% when 15 %}{% assign legal_type = 'BVBA' %}
      {% when 21 %}{% assign legal_type = 'OVM' %}
      {% when 17 %}{% assign legal_type = 'VZW' %}
      {% when 27 %}{% assign legal_type = 'SE' %}
      {% when 18 %}{% assign legal_type = 'ION' %}
      {% when 30 %}{% assign legal_type = 'Buitenlandse onderneming' %}
      {% when 60 %}{% assign legal_type = 'ESV' %}
      {% when 23 %}{% assign legal_type = 'Buitenlandse privaatrechtelijke vereniging met vestiging, agentschappen, kantoor of bijhuis in België' %}
      {% when 65 %}{% assign legal_type = 'EESV' %}
      {% when 26 %}{% assign legal_type = 'PRIV ST' %}
      {% when 265 %}{% assign legal_type = 'Europees economisch samenwerkingsverband zonder zetel met vestiging in België' %}
      {% when 506 %}{% assign legal_type = 'CVOA SO' %}
      {% when 29 %}{% assign legal_type = 'SON' %}
      {% when 508 %}{% assign legal_type = 'CVBA SO' %}
      {% when 511 %}{% assign legal_type = 'VOF SO' %}
      {% when 512 %}{% assign legal_type = 'GCV SO' %}
      {% when 513 %}{% assign legal_type = 'CVA SO' %}
      {% when 121 %}{% assign legal_type = 'Onderlinge verzekeringsmaatschappij, van publiek recht' %}
      {% when 514 %}{% assign legal_type = 'NV SO' %}
      {% when 125 %}{% assign legal_type = 'IVZW' %}
      {% when 510 %}{% assign legal_type = 'BVBA SO' %}
      {% when 560 %}{% assign legal_type = 'ESV SO' %}
    {% endcase %}
    {% assign current_signature = current_signature %}
  {% endif %}
  | {{ current_signature }} 
      {% if type == "legal" %}
          {% if shareholder.custom.represented_by_name != blank %}
            <br>met als vaste vertegenwoordiger {{ shareholder.custom.represented_by_name }} 
          {% endif %}
      {% endif %}
  {% if shareholder.custom.represented_by_vat != blank %}<br>{{ shareholder.custom.represented_by_vat }}{% endif %}<br>
  {% if shareholder.custom.street == blank and shareholder.custom.street_number == blank %}{{ shareholder.address_1 }}
  {% elsif shareholder.custom.street != blank and shareholder.custom.street_number == blank %}{{ shareholder.custom.street }} {{ address_number }}
  {% elsif shareholder.custom.street == blank and shareholder.custom.street_number != blank %}{{ address_street }} {{ shareholder.custom.street_number }}
  {% else %}{{ shareholder.custom.street }} {{ shareholder.custom.street_number }}{% endif %}<br>
  {% if shareholder.custom.postal_code == blank and shareholder.custom.city == blank %}{{ shareholder.address_2 }}
  {% elsif shareholder.custom.postal_code != blank and shareholder.custom.city == blank %}{{ shareholder.custom.postal_code }} {{ person_city }}
  {% elsif shareholder.custom.postal_code == blank and shareholder.custom.city != blank %}{{ person_postal_code }} {{ shareholder.custom.city }}
  {% else %}{{ shareholder.custom.postal_code }} {{ shareholder.custom.city }}{% endif %}
  | {{ shareholder.amount_of_shares | integer }}{% if custom.av.show_class %} {{ shareholder.custom.shares_classes }}{% endif %}{% if custom.av.show_nature %}<br>({{ shareholder.custom.kind_of_shares }}){% endif %}<br> 
    {% if shareholder.custom.kind_of_shares == "Naakte eigendom" or shareholder.custom.kind_of_shares == "Nue-propriété" or shareholder.custom.kind_of_shares == "Bare ownership" or shareholder.custom.kind_of_shares == "Usufruct" or shareholder.custom.kind_of_shares == "Usufruit" or shareholder.custom.kind_of_shares == "Vruchtgebruik"%}{% $0+ shareholder.amount_of_shares/2 %}{% else %}{% $0+ shareholder.amount_of_shares %}{% endif %}
  |{% =$1+ shareholder.amount_of_votes | integer %}
  |{% signmarker name:current_signature %}|{% endif %}{% newline %}{% endfor %}
|------------|------------------------|------------------------|{% newline %}
| **Totaal** | **{{ $0 | integer  }}**| **{{ $1 | integer  }}**
{% endstripnewlines %}

Look at this part:

{% assign words = shareholder.name | split: ' ' %}
  {% 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 %}

To give you some backstory:

In the past, data was synced from other programs (Adminis, Adsolut, FIDManager, …) and synced to one individual object .name. This included both first and last name in one individual object!

However, more templates required info like the first and last name in 2 separate objects, which is why we updated our text template Company Information and made it possible to input first and last name in 2 different objects.

If data (eg. Tim Vandecasteele) is synced from Adminis, this will be available in the object .name but it will also be split up (based on some logic code seen above) and offered as default values in .custom.first_name and .custom.last_name.
As you know, defaults don’t “input” the value into that object, and therefor .custom.first_name and .custom.last_name. will be empty while displaying those default values.

If nothing is synced however, and values are entered manually in Company Information (like in your case), that actual data is entered in .custom.first_name and .custom.last_name while the object .name will actually be empty (as this is not made possible to enter data manually - only by sync).

I understand this is confusing, but just keep in mind there are 3 objects to take into account:

  • .name = this objects will have the data that is synced
  • .custom.first_name = this objects will be empty in case of a sync but offered a default value OR it has data that was entered if the name isn’t synced
  • .custom.last_name = this objects will be empty in case of a sync but offered a default value OR it has data that was entered if the name isn’t synced

to make sure you want all the names that are known for shareholders, you’ll need to check on which objects are not empty, like this eg:

    {% if shareholder.custom.first_name == blank and shareholder.custom.last_name == blank %}
      {% assign current_signature = shareholder.name %}
    {% elsif shareholder.custom.first_name == blank and shareholder.custom.last_name != blank %}
      {% assign current_signature = current_signature | append:person_first_name | append:" " | append:shareholder.custom.last_name %}
    {% elsif shareholder.custom.first_name != blank and shareholder.custom.last_name == blank %}
      {% assign current_signature = current_signature | append:shareholder.custom.first_name | append:" " | append:lastname %}
    {% else %}
      {% assign current_signature = current_signature | append:shareholder.custom.first_name | append:" " | append:shareholder.custom.last_name %}
    {% endif %} 

Hope this works out for you.

Hi Sven

This now works for the shareholders however not yet for the directors.
Do i just replace “shareholder” by “director” in the code?

Yes, you could do that (as documented here)

So period.people are all shareholders and directors in one drop, while period.shareholders is the same as period.people but filtered if it is a shareholder (same goes for period.directors).
So the name of all objects are exactly the same as they all come from period.people

Hi Sven

I replaced shareholder by director and changed current_signature by current_signature_1 but this is the result:

image .

Code:

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

—:{% ic %}#{% endic %}{% nic %}+{% endnic %}{% for director in period.directors%}
{% newline %}
{% if director.custom.first_name == blank and director.custom.last_name == blank %}
  {% assign current_signature_1 = director.name %}
{% elsif director.custom.first_name == blank and director.custom.last_name != blank %}
  {% assign current_signature_1 = 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_1 = current_signature_1 | append:director.custom.first_name | append:" " | append:lastname %}
{% else %}
  {% assign current_signature_1 = current_signature_1 | append:director.custom.first_name | append:" " | append:director.custom.last_name %}
{% endif %} 

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

Why did you change the local var current_signature to current_signature_1?
You can of course, but then it’s better to replace all current_signature to current_signature_1 which is not the case here:

{% elsif director.custom.first_name == blank and director.custom.last_name != blank %}
{% assign current_signature_1 = current_signature | append:person_first_name | append:" " | append:director.custom.last_name %}

On the next line of code you did it correct:

{% elsif director.custom.first_name != blank and director.custom.last_name == blank %}
{% assign current_signature_1 = current_signature_1 | append:director.custom.first_name | append:" " | append:lastname %} 

Can you try with that?

Hi Sven

Still the same result - also when i remove the _1.

There’s a local var in there called person_first_name; how is that defined in your code? I cannot see that.

Think you forgot this part in your code:

{% assign words = director.name | split: ' ' %}
  {% 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 %}

This needs to be added in your forloop over the period.directors drop.

Hi Sven

Yes, now it works.

Thx
Sylvia