CASE: extra Liquid-code by Silverfin

Sure, we use quite a lot of the known coding of Liquid, but in some cases, we’ll invent our own code that use a logic behind it, we need.

The purpose of this case, is to make an overview of all these codings. So you won’t find it anywhere if you google it.

This list will be updated from time to time.

1. is_first_bookyear

As the name explains, this is a boolean (true or false) we can use to check if the period we’re in, is in the first book year (as defined in the client information).

example of use

{% if period.is_first_year %}
First book year here
{% else %}
Not the first...  
{% endif %}


{% assign first_book_year = period.is_first_year %}

{% if first_book_year %}
This is the first book year 
{% else %}
NOT the first book year  
{% endif %}

2. exists

This boolean checks if the period exists, but in most of the cases, we’ll use it to check if the period exists of last year.

example of use

{% assign previous_period = period.minus_1y %}

{% if previous_period.exists %}
{{ #10:1y %}

3. active_as_director

The drop {{ period.directors }} shows a list of all directors, no matter what the end date of the mandat is.

So following code gives you all the directors :

{% for director in period.directors %}
{{ }}
{% endfor %}

If you want to filter on only the active directors during the book year then you can add a filter on the drop period.directors, like this :

{% for director in period.directors.active_as_director %}
{{ }}
{% endfor %}

This will result in a list of all the directors that have an end date of their mandat during the book year, or have no end date at all.

Hi @sven,
With what administration syncs does the active_as_director-filter work?
We are not able to successfully apply this functionality on dossiers that get their directors from through Kluwer CDB admin sync…
Thanks in advance,

Hey @robin.bailleul,

That’s because that’s only generated when the begin- and end-mandat is synced. And in CDB admin sync that is not yet synced.

I’ll update our sync-team know to update this sync (if possible) to sync that data also.

PS @robin.bailleul : in our general text templates we avoid this, and generate an array that’s generated from the period.people drop and that begin- and end-date. I expect to make a case out of it, this week!


fyi :