Problem own template

Hi,

Since Silverfin’s (BE legal documents) new reporting, we have been experiencing problems with our own template.

  1. For ‘Director/manager and auditors’, the name of the legal entity appears twice. We do not experience this problem with the name of a natural person. Syneton has not changed anything in their system so we think the ‘error’ can be linked to the recent change in Silverfin. What needs to be adjusted in our template to stop getting this error?
  2. When we create an export from Silverfin adding this template, the alignment of the customer’s name at the top of the page is no longer correct. This might also be linked to the layout of our template. What needs to be changed in our template to stop getting this misalignment?

Can anyone help us with this?

Code of our template, as already formatted 2-3 years ago:

{% stripnewlines %}
{% newline %}
**{::font size="xl"} **_{{ company.name }}_** {{ company_form }}{:/font}**
{% endstripnewlines %}

<br><br>


{% stripnewlines %}
|Oprichtingsdatum:|{{ company.custom.establishment.date | date:"%d %B %Y"}}
{% newline %}
|Inbreng/kapitaal:|{{ -#1000-#1119-#1109| currency }} {{ custom.revenue.value }} EURO
{% newline %}
|Rechtsvorm:|{{ company.company_form }}
{% newline %}
|Adres:|{{ company.street }}, {{ company.city }}  ( {{ company.country }} )
{% newline %}
|Ondernemingsnummer:|{{ company.vat_identifier }}
{% newline %}
|Ondernemingsrechtbank:|{{ rpr_naam }}

{% comment %}Show the correct RPR{% endcomment %}
{% assign courts_array = "31;Brussel, Franstalige|32;Brussel, Nederlandstalige|3;Antwerpen, afdeling Antwerpen|10;Antwerpen, afdeling Hasselt|17;Antwerpen, afdeling Mechelen|25;Antwerpen, afdeling Tongeren|27;Antwerpen, afdeling Turnhout|30;Eupen|5;Gent, afdeling Brugge|7;Gent, afdeling Dendermonde|9;Gent, afdeling Gent|12;Gent, afdeling Ieper|13;Gent, afdeling Kortrijk|22;Gent, afdeling Oostende|23;Gent, afdeling Oudenaarde|29;Gent, afdeling Veurne|14;Leuven|4;Liège, afdeling Arlon|8;Liège, afdeling Dinant|11;Liège, afdeling Huy|15;Liège, afdeling Liège|16;Liège, afdeling Marche-en-Famenne|19;Liège, afdeling Namur|20;Liège, afdeling Neufchâteau|28;Liège, afdeling Verviers|6;Hainaut, afdeling Charleroi|18;Hainaut, afdeling Mons|26;Hainaut, afdeling Tournai|21;Waals-Brabant, afdeling Nijvel" | split:"|" %}

{% comment %}the string value RPR is pushed to company.custom.rpr.name while the XBRL code is to company.custom.rpr.naam{% endcomment %}
{% assign full_name_rpr = company.custom.rpr.name %}
{% assign code_rpr = company.custom.rpr.naam %}

{% comment %}RPR from the dropdown is shown, otherwise the string is shown{% endcomment %}
{% if code_rpr == blank %}
  {% assign rpr_naam = full_name_rpr %}
{% else %}
  {% if code_rpr != blank %}
    {% for court in courts_array %}
      {% assign court_array = court | split:";" %}
      {% assign code = court_array[0] %}
      {% assign name = court_array[1] %}
      
      {% if INT(code_rpr) == INT(code) %}
        {% assign rpr_naam = name %}
        {% break %}
      {% endif %}
    {% endfor %}
  {% endif %}
{% endif %}
{% if rpr_naam != blank %}
  {% assign rpr_naam = rpr_naam | prepend:"RPR. " %}
{% endif %}

{{ rpr_naam }}

{% endstripnewlines %}

<br>
<br>
<br>
_Bestuur_: 
<br>
{% comment %}have the GREY header in INPUT, while having the BLACK LINE header in export{% endcomment %}
{% comment %}GREY header{% endcomment %}
{% stripnewlines %}
{% newline %}
|Bestuurder(s) / Zaakvoerder(s)
|Functie
|Begin mandaat
|Einde mandaat 
{% newline %}
|----35%----
|----25%----
|----20%----:
|----20%----:
{% ic %}#{% endic %}  {% comment %}shows GREY header in INPUT mode{% endcomment %}
{% nic %}+{% endnic %}{% comment %}shows BLACK LINE header in OUTPUT mode{% endcomment %}

{% newline %}
|-
|-
|-
|-
{{ active_directors_bookyear | split:";" % }}
{% assign active_directors_bookyear = period.directors.active_as_director %}
{% for director in active_directors_bookyear%}
{% 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 %}
{% 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.represented_by_name != blank %}
  {% assign default_type = "legal" %}
{% else %}
  {% assign default_type = "nature" %}
{% endif %}
{% assign type = director.custom.type  | default:default_type %} 
{% if  type == "legal" %} met als vaste vertegenwoordiger {{ director.custom.represented_by_name }}{% endif %}
|{{ director.custom.function_title }}
|{{ director.director_start_date | date:"%d/%m/%Y" }}
|{{ director.director_end_date | date:"%d/%m/%Y" }}
{% endfor %}


{% endstripnewlines %}

You can find the incorrect alignment below :

image

Thanks in advance

Hi @Nadja ,

Apologies for the delay in our reply. We will look into your query today and provide you with our feedback asap.

Keep you posted!

Kind regards,
Robin

Hi @Nadja ,

Again sorry for the delay in our response. We have some feedback on both your questions below.

  1. Name of legal entity appearing twice

So looking at the way the data is currently synced and taking into account Syneton claiming nothing changed on their side I’m kinda surprised this Liquid code ever worked. I mean if really nothing changed both in the Liquid code of this document and the way the data is synced then this should have caused issues also 2-3 years ago :sweat_smile: .
Just as a side note, this issue also has definitely nothing to do with the new Silverfin Legal Documents.

Nevertheless I guess we can fix this in the Liquid code. We have to be careful though as I’m not sure which admin syncs you use apart from the Adminis one but I believe some minor code adjustment should fix the Adminis synced files and not cause any harm to files using other syncs (but again we should carefully check this before deploying the code change).

It seems that for legal entities the name of the entity is included twice, once under director.name and once under director.custom.last_name. In your code when creating the {{ current_signature }} we first loop through the elements of director.name to filter out a first and last name. This is totally fine when there is a natural person, and should also be fine when there is a legal person except that later in the code in case the natural person is missing a first or last name the filtered out first or last name from the director.name are added next to the synced director.custom.last_name or director.custom.first_name.

So in case you have a legal director you have filtered out the last_name from the director.name + you also add the synced director.custom.last_name. Are you still following? :sweat_smile:

Given that it seems to be the case that only the director.custom.last_name is included when there is a legal person, we could add an {% unless director.custom.first_name == blank %} around the part where we filter out a first and last name. So that in case of a legal person this additional logic is not run.

Your code would look something like this:


{% assign active_directors_bookyear = period.directors.active_as_director %}
{% for director in active_directors_bookyear%}
{% assign words = director.name | split:" " %}
{% assign lastname = “” %}
{% assign person_first_name = “” %}
{% assign current_signature = “” %}
{% unless director.custom.first_name == blank %}
{% 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 %}
{% endunless %}
{% newline %}

Like I mentioned, I believe this will work fine for files that are synced with the Adminis sync but definitely try this code in other files as well (if there are any) before committing the change!

  1. Misalignment of the customer’s name in PDF export

I had a look in the file where the print screen was taken from and I wasn’t able to replicate the issue. Are you sure it still persists? If so, happy to look into it in more detail!

Thanks and good luck with implementing the code changes!

Kind regards,
Robin