Signature not working

Hi,

I’d like to add the signature of the statutory auditor in my file (if there’s one) and also add the name and representing person. I have the below code for this as it was in one of the Silverfin templates as well, but it’s not working… And I also guess there should be a much simpeler way to do this instead of the below code. Can you please advice?

{% comment %}get date_av in correct date format{% endcomment %}
{% assign date_av = date_av | date:"%Y-%m-%d" %}

{% stripnewlines %}
{% for person in period.people %}
{% assign show_begin_mandat = false %}
{% assign show_end_mandat = false %}
{% assign begin_mandat = person.director_start_date | date:"%Y-%m-%d" %}
{% assign end_mandat = person.director_end_date | date:"%Y-%m-%d" %}
{% if date_av >= begin_mandat or begin_mandat == blank %}
{% assign show_begin_mandat = true %}
{% endif %}
{% if date_av <= end_mandat or end_mandat == blank %}
{% assign show_end_mandat = true %}
{% endif %}
{% if show_begin_mandat and show_end_mandat and person.custom.function == 61 %}
{% assign current_signature = “” %}
{% assign default_type = “” %} {% comment %}check when person is legal or not{% endcomment %}
{% if person.custom.represented_by_name != blank %}
{% assign default_type = “legal” %}
{% else %}
{% assign default_type = “nature” %}
{% endif %}
{% assign type = person.custom.type | default:default_type %}

{% assign street_parts = person.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 %}
{% assign street = street | strip %}
{% assign number = number | strip %}
{% capture address_street %}{{ street | strip }}{% endcapture %}
{% capture address_number %}{{ number | strip }}{% endcapture %}
{% assign person_city = person.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” | strip %}
{% assign person_postal_code = person.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:" " | strip %}

{% assign words = person.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 = person.name %}
{% else %}
{% if person.custom.first_name == blank and person.custom.last_name == blank %}
{% if after_year_2020 %}
{% assign current_signature = current_signature | append:person_first_name | append:" " | append:lastname %}
{% else %}
{% assign current_signature = person.name %}
{% endif %}
{% elsif person.custom.first_name == blank and person.custom.last_name != blank %}
{% assign current_signature = current_signature | append:person_first_name | append:" " | append:person.custom.last_name %}
{% elsif person.custom.first_name != blank and person.custom.last_name == blank %}
{% assign current_signature = current_signature | append:person.custom.first_name | append:" " | append:lastname %}
{% else %}
{% assign current_signature = current_signature | append:person.custom.first_name | append:" " | append:person.custom.last_name %}
{% endif %}
{% endif %}

{% assign current_signature = current_signature %}

|{{ current_signature }} {% if type == “legal” %}{% if person.custom.represented_by_name != blank %}
met als vaste vertegenwoordiger {{ person.custom.represented_by_name }} {% endif %}{% endif %}{% if person.custom.represented_by_vat != blank %}
{{ person.custom.represented_by_vat }}{% endif %}
{% if person.custom.street == blank and person.custom.street_number == blank %}{{ person.address_1 }}{% elsif person.custom.street != blank and person.custom.street_number == blank %}{{ person.custom.street }} {{ address_number }}{% elsif person.custom.street == blank and person.custom.street_number != blank %}{{ address_street }} {{ person.custom.street_number }}{% else %}{{ person.custom.street }} {{ person.custom.street_number }}{% endif %}
{% if person.custom.postal_code == blank and person.custom.city == blank %}{{ person.address_2 }}{% elsif person.custom.postal_code != blank and person.custom.city == blank %}{{ person.custom.postal_code }} {{ person_city }}{% elsif person.custom.postal_code == blank and person.custom.city != blank %}{{ person_postal_code }} {{ person.custom.city }}{% else %}{{ person.custom.postal_code }} {{ person.custom.city }}{% endif %}
{% if person.custom.country == blank %}{% if person.custom.city != blank or person.address_2 != blank or person_city != blank %}{% unless current_signature == blank %}België{% endunless %}{% endif %}{% else %}{{ person.custom.country }}{% endif %}
|{% signmarker name:current_signature email:person.custom.email phone:person.custom.phone_number role:person.custom.function on_behalf_of:person.custom.represented_by_name %}
{% newline %}
{% endif %}
{% endfor %}
{% endstripnewlines %}
{% comment %}end custom.av.show_auditors{% endcomment %}

{{ warning_signatures }}
{{ signature_av }}

{% comment %}PENNEO DOCUMENT LABEL{% endcomment %}
{% result “signing_doc_name” “Ordinary shareholders meeting” %}

Hi @lieels01 ,

Happy you tried to find a solution based on our Silverfin code :smiley: , a bit unfortunate you couldn’t make it work.

Maybe before we dive into the code, could detail a bit more what you would like to accomplish? So in your template you would like to represent the statutory auditor name and representing person, together with a signmarker? You want it to look exactly like the template where you took the code from?

Also, I assume this code you shared is from the BE market? So the period.people drop will be populated by sync or via the template Bedrijfsparameters right?

Thanks for the feedback!

Kind regards,
Robin

Hi @robindeclercq

That’s correct…
Actually I’d like something really simple: a signature block where the name and representative of the statutory commissioner appears automatically.

Hi @robindeclercq ,

In the meantime I was able to make it a lot shorter and found this code that I can use. However, how can I make sure that only the statutory commissionor’s signature appears and not all of the people mentioned? I wanted to use {% if person.custom.function == 61 %}, but that doesn’t seem to do anything…

{% for person in period.people %}
{% capture name %}{{ person.name }}{% endcapture %}
{% assign names = names | append:name %}
{% if person.custom.represented_by_name != blank %}
{% assign names = names | append:"
" | append:“Represented by " | append:person.custom.represented_by_name %}
{% endif %}
{% unless forloop.last %}
{% assign names = names | append:”|" %}
{% endunless %}
{% endfor %}

@lieels01

I have added the code which checks if person is Statutory auditor ( {% if person.custom.function == 61 %} ).
If person is statutory auditor, the name and address is displayed:

Hi @Jelena_Sutova

Also solved by your reply in my other question. Thank you again!