Intermediate check

For a large checklist I want to make an intermediate check indicator. So for example after checking a series of checks, I want also a green dot before each head title. So the separation between different kind of head titles is more clear. Unfortunately I can make it work. This is my code:

{% stripnewlines %}
| 
|
|
|
{% newline %}
{% endstripnewlines %}


{% stripnewlines %}
{% if custom.[check].check23_mark == true %}
  {% assign ind = 0 %}
{% else %}
  {% assign ind = 1 %}
{% endif %}
{% unexplained ind as:indicator %}
{{ alginfo_checks[forloop.index0] }}
|_**{% t "_BLZ 7 - Uiteenzetting van de winst_" %}**_
{% newline %}
|----100%----+#
{% endstripnewlines %}


{% stripnewlines %}
| {% t "Overgedragen definitief belaste inkomsten" %}
{% newline %}
|----45%----
|----------+#
{% endstripnewlines %}


{% assign alginfo_checks = "Zie eventuele wijzigingen ingevolge fiscale controle vorige boekjaren;Overgedragen saldo vorig boekjaar;Zie ook vak overdracht aftrek definitief belaste inkomsten" | split:";" %}
{% assign alginfo_keys = "Zie eventuele wijzigingen ingevolge fiscale controle vorige boekjaren;Overgedragen saldo vorig boekjaar;Zie ook vak overdracht aftrek definitief belaste inkomsten" | split:";" %}
{% stripnewlines %}
{% newline %}
|----5%----
|----5%----
|----35%---
|----------+
{% for check in alginfo_keys %}
{% if custom.check.review == 'true' %}
  {% assign sf_show_inputs = false %}
{% endif %}
{% newline %}
| {% input custom.[check].check23_mark as:boolean %}
  {% comment %}Below will make the templates reconciliation needed{% endcomment %}
  {% if custom.[check].check23_mark == true %}
    {% assign check23_ind = 0 %}
  {% else %}
    {% assign check23_ind = 1 %}
  {% endif %}
| {% unexplained check23_ind as:indicator %}
| {{ alginfo_checks[forloop.index0] }} 
| {% input custom.[check].extra_info23 as:text size:mini placeholder:"Opmerkingen" %}
{% endfor %}
{% endstripnewlines %}
{% if custom.check.review == false %}
{% ifi custom.some.thing.document or custom.some.thing_23 != blank %}
{% stripnewlines %}
{% newline %}
| **{% t "Extra info" %}** 
| {% input custom.some.thing_23 as:file_collection %}
{% endstripnewlines %}
{% input custom.some.thing_23 as:text placeholder:'Eventuele verklaringsdocumenten' %}
{% endifi %}
{% else %}
{% assign sf_show_inputs = true %}
{% if custom.some.thing_23.document == blank %}
Geen verklaringsdocumenten toegevoegd
{% else %}
{% ifi custom.some.thing.document or custom.some.thing_23 != blank %}
{% stripnewlines %}
{% newline %}
| **{% t "Extra info"%}** 
| {% input custom.some.thing_23 as:file_collection %}
{% endstripnewlines %}
{% assign sf_show_inputs = false %}
{% input custom.some.thing_23 as:text placeholder:'Eventuele verklaringsdocumenten' %}
{% endifi %}
{% endif %}
{% endif %}

Hi @TomVDW,

This code already looks really good. To get the result you want, only a small adjustment in your code is necessary.

So now in the current structure, the namespace ‘check’ does not have a value. So custom.[check].check23_mark will give a blank result. To make sure the variable custom.[check].check23_mark has a result, we can loop through the alginfo_keys at the top of your template.

To do so, it’s important that you also move your array alginfo_keys to the top. Then you loop through as follows:

{% assign ind = 0 %}
{% for check in alginfo_keys %}
{% if custom.[check].check23_mark != true %}
{% assign ind = 1 %}
{% endif %}
{% endfor %}

So now we loop through all different checkboxes and we check whether they are false. In case one of the checkboxes is false, we set the variable ind to 1, otherwise the ind will remain 0. This variable ind can then be used in the unreconciled indicator (note that we should use unreconciled instead of unexplained).

Here is the complete code with amendments:

{% stripnewlines %}
|
|
|
|
{% newline %}
{% endstripnewlines %}

{% assign alginfo_checks = “Zie eventuele wijzigingen ingevolge fiscale controle vorige boekjaren;Overgedragen saldo vorig boekjaar;Zie ook vak overdracht aftrek definitief belaste inkomsten” | split:“;” %}
{% assign alginfo_keys = “Zie eventuele wijzigingen ingevolge fiscale controle vorige boekjaren;Overgedragen saldo vorig boekjaar;Zie ook vak overdracht aftrek definitief belaste inkomsten” | split:“;” %}

{% assign ind = 0 %}
{% for check in alginfo_keys %}
{% if custom.[check].check23_mark != true %}
{% assign ind = 1 %}
{% endif %}
{% endfor %}

{% stripnewlines %}
{% unexplained ind as:indicator %}
{{ alginfo_checks[forloop.index0] }}
|{% t “BLZ 7 - Uiteenzetting van de winst” %}
{% newline %}
|----100%----+#
{% endstripnewlines %}

{% stripnewlines %}
| {% t “Overgedragen definitief belaste inkomsten” %}
{% newline %}
|----45%----
|----------+#
{% endstripnewlines %}

{% stripnewlines %}
{% newline %}
|----5%----
|----5%----
|----35%—
|----------+
{% for check in alginfo_keys %}
{% if custom.check.review == ‘true’ %}
{% assign sf_show_inputs = false %}
{% endif %}
{% newline %}
| {% input custom.[check].check23_mark as:boolean %}
{% comment %}Below will make the templates reconciliation needed{% endcomment %}
{% if custom.[check].check23_mark == true %}
{% assign check23_ind = 0 %}
{% else %}
{% assign check23_ind = 1 %}
{% endif %}
| {% unexplained check23_ind as:indicator %}
| {{ alginfo_checks[forloop.index0] }}
| {% input custom.[check].extra_info23 as:text size:mini placeholder:“Opmerkingen” %}
{% endfor %}
{% endstripnewlines %}
{% if custom.check.review == false %}
{% ifi custom.some.thing.document or custom.some.thing_23 != blank %}
{% stripnewlines %}
{% newline %}
| {% t “Extra info” %}
| {% input custom.some.thing_23 as:file_collection %}
{% endstripnewlines %}
{% input custom.some.thing_23 as:text placeholder:‘Eventuele verklaringsdocumenten’ %}
{% endifi %}
{% else %}
{% assign sf_show_inputs = true %}
{% if custom.some.thing_23.document == blank %}
Geen verklaringsdocumenten toegevoegd
{% else %}
{% ifi custom.some.thing.document or custom.some.thing_23 != blank %}
{% stripnewlines %}
{% newline %}
| {% t “Extra info”%}
| {% input custom.some.thing_23 as:file_collection %}
{% endstripnewlines %}
{% assign sf_show_inputs = false %}
{% input custom.some.thing_23 as:text placeholder:‘Eventuele verklaringsdocumenten’ %}
{% endifi %}
{% endif %}
{% endif %}

Hope this is clear!

If you have any other questions, do not hesitate to contact us!

Kind regards,
Robin

1 Like

Thanks, that did it!
Learned again something :slight_smile: