Hi,
We are having a problem with a custom text document: “info blad”
We are trying to give an overview of shareholers and directors but we ar strugling with the kind of shares.
Code
**Overzicht van de aandeelhouders**
{% stripnewlines %}
{% newline %}
|**Aandeelhouders**
|**Aantal aandelen**
|**Met stemrecht**{% ic %}{::infotext as="hover"}Deze data wordt opgehaald uit de bedrijfsparameters{:/infotext}{% endic %}
|**Eigendom**
|**Klasse**
|**Stemrechten t.o.v. totaal**
{% newline %}
|---
|---:
|---:
|---:
|---:
|---:{% ic %}#{% endic %}{% nic %}+{% endnic %}{% for shareholder in period.shareholders %}
{% 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 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 | default:default_type %}
{% newline %}
{% 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 = shareholder.name %}
{% elsif shareholder.custom.first_name != blank and shareholder.custom.last_name == blank %}
{% assign current_signature = shareholder.name %}
{% else %}
{% assign current_signature = current_signature | append:shareholder.custom.first_name | append:" " | append:shareholder.custom.last_name %}
{% endif %}
|{{ current_signature }}
|{{ shareholder.amount_of_shares | integer }}
|{{ shareholder.amount_of_votes | integer }}
|{{ shareholder.custom.kind_of_shares }}
|{{ shareholder.custom.shares_classes }}
|{% $2+ shareholder.amount_of_votes/$1 %}{{ shareholder.amount_of_votes/$1 | percentage }}
{% endfor %}
{% newline %}
|**Totaal aantal aandelen**
|**{{ $0 | integer }}**
|**{{ $1 | integer }}**
|
|
|**{{ $2 | percentage }}**
{% endstripnewlines %}
output
the value in |{{ shareholder.custom.kind_of_shares }}
doesn’t contain any value
however if we overwrite the dropdown in “bedrijfsparameters”
then |{{ shareholder.custom.kind_of_shares }}
has a value.
At first, it seemed like a caching issue. We got this anwer via support:
The issue here is that the custom template is not supporting the default value coming from the sync for the ‘Eigendom’ field.
The custom template only displays person.custom.kind_of_shares, but the company parameters also check if there’s a stock type available from the sync in person.custom.stock_type.
See below for the code snippet we use to map the sync value to this dropdown in the ‘Bedrijfsparameters’:
| **{% t "Aard aandelen" %}** {% assign stock_type_from_sync = person.custom.stock_type %} {% assign def_stock_type = "" %} {% case stock_type_from_sync %} {% when 1 %} {% assign def_stock_type = "Volle eigendom" %} {% when 2 %} {% assign def_stock_type = "Naakte eigendom" %} {% when 3 %} {% assign def_stock_type = "Vruchtgebruik" %} {% when 4 %} {% assign def_stock_type = "Onverdeeldheid" %} {% endcase %} | {% input person.custom.kind_of_shares as:select default:def_stock_type options:"Volle eigendom|Naakte eigendom|Vruchtgebruik|Onverdeeldheid" %}
but I don’t really know how to implement this in our custom text. maybe because it’s fridayafternoon, i don’t know
Can anyone help me with this?
Thanks!