List of renumerations and benefit in kind for each director

I want a list per director of renumeration and benefit in kind.
the code I have is

{% fori dir in custom.directors %}
{% input dir.name %}

{% stripnewlines %}
  {% newline %}
Als maandelijkse brutobezoldiging wordt uitbetaald:  
{% ifi period.custom.b.bestemminginfo != blank %}
{% input period.custom.b.bestemminginfo as:currency placeholder:'maandelijkse brutobezoldiging' size:maxi %}{% endifi %}
{% endstripnewlines %}

Tevens zijn volgende voordelen alle aard van toepassing:

{% stripnewlines %}
{% assign 
  arr_Serie1_StandardTasks_Descriptions 
  = "
  verwarming|
  elektriciteit|
  tablet|
  GSM toestel|
  GSM abonnement|
  telefoon abonnement|
  internet|
  PC|
  sociale bijdragen|
  VAPZ|
  intrest lening/rekening-courant|
  personenwagen|
  bewoning|
  andere" | split:"|"
%}
{% endstripnewlines %}

{% comment %}Stel output op{% endcomment %}

{% stripnewlines %}
{% for task in arr_Serie1_StandardTasks_Descriptions %}
  {% newline %}
  {% ifi custom.arr_Serie1_StandardTasks_Checkbox[forloop.index0] == 'true' %}{% nic %}- {% endnic %}
  {% ic %}{% input custom.arr_Serie1_StandardTasks_Checkbox[forloop.index0] as:boolean default:false %} {% endic %}
  {{arr_Serie1_StandardTasks_Descriptions[forloop.index0] | strip}}
  {% endifi %}
{% endfor %}
{% stripnewlines %}

{% endstripnewlines %}
  {% newline %}
{% newline %}
Andere voordelen alle aard kunnen geraamd worden op :   
{% ifi period.custom.b.bestemminginfo2 != blank %}

{% input period.custom.b.bestemminginfo2 as:currency placeholder:'andere voordelen alle aard' size:maxi %}{% endifi %}


{% endstripnewlines %}

{% endfori %}
<br>
<br>

problem is that when I fill in an amount or checkbox for 1 director, it will be copied to the other directors. Off course it has to be individual adaptable. What should be changed?

Hi @Birgit,

In your fori-statement looping over custom.directors, you use the same input object for each loop (= director): period.custom.b.bestemminginfo
So that’s the reason it will show the same thing for every director.

you don’t have to create input objects separated from your custom collection. Here you’ll find more info, but baiscally you can do something like:

{% fori dir in custom.directors %}
  {% input dir.bedrag_vaa as:currency %}
{% endfori %}

Care to give it a go? Let me know if we can insist further in your code, but I’d advise to handle that first, and see where it bring us, okay?

I’m sorry, it is not clear to me.
I don’t want to get data from any report.
I just want a list of benefit in kinds per director that I can give a check for the future.

I have now these code but the list is still the same for each director. How can I link it per director?

{% fori zv in custom.directors %}

**{% input zv.name %}**
{% ifi zv.name != blank %}

{% stripnewlines %}
  {% newline %}
Als maandelijkse brutobezoldiging wordt uitbetaald:  

{% input zv.bezoldiging as:currency placeholder:'maandelijkse brutobezoldiging' size:maxi %}
{% newline %}



{% endstripnewlines %}


{% stripnewlines %}
{% assign 
  arr_Serie1_StandardTasks_Descriptions 
  = "
  verwarming|
  elektriciteit|
  tablet|
  GSM toestel|
  GSM abonnement|
  telefoon abonnement|
  internet|
  PC|
  sociale bijdragen|
  VAPZ|
  intrest lening/rekening-courant|
  personenwagen|
  bewoning|
  andere" | split:"|"
%}
{% endstripnewlines %}

{% comment %}Stel output op{% endcomment %}

{% stripnewlines %}
{% for task in   arr_Serie1_StandardTasks_Descriptions   %}
  {% newline %}
  {% ifi custom.arr_serie1_StandardTasks_Checkbox[forloop.index0] == 'true' %}{% nic %}- {% endnic %}
  {% ic %}{% input custom.arr_serie1_StandardTasks_Checkbox[forloop.index0] as:boolean default:false %} {% endic %}
  {{arr_Serie1_StandardTasks_Descriptions[forloop.index0] | strip}}
  {% endifi %}
{% endfor %}
{% stripnewlines %}

{% endstripnewlines %}

  {% newline %}
{% newline %}

{% ifi zv.anderevaa != blank %}
Andere voordelen alle aard kunnen geraamd worden op :   

{% input zv.anderevaa as:currency placeholder:'andere voordelen alle aard' size:maxi %}{% endifi %}

{% endstripnewlines %}



{% endifi %}
{% endfori %}<br>

Hi @Birgit,

Let us help you out a bit.

I’ve tweaked parts of your code and added some extra comments as well:

{% comment %}create array that can be used to name the objects as well{% endcomment %}
{% assign arr_Serie1_StandardTasks_Descriptions = "verwarming|elektriciteit|tablet|GSM toestel|GSM abonnement|telefoon abonnement|internet|PC|sociale bijdragen|VAPZ|intrest lening/rekening-courant|personenwagen|bewoning|andere" | split:"|" %}


{% comment %}create custom directors{% endcomment %}
{% stripnewlines %}
  {% fori zv in custom.directors %}
    {% newline %}
    Naam zv = {% input zv.name %}
    {% newline %}
    Bezoldiging {{ zv.name }} = {% input zv.bezoldiging placeholder:"maandelijkse bezold." as:currency %}
    {% newline %}
    {% comment %}create list of booleans{% endcomment %}
    {% for vaa in arr_Serie1_StandardTasks_Descriptions %}
      {% comment %}strip everything weird from the array type (which is stored in the var "vaa") and use that as part of the name of the object for the boolean{% endcomment %}
      {% assign type_vaa = vaa | remove:" " | remove:"/" | remove:"-" | downcase %}
      {% newline %}
      {% input zv.[type_vaa] as:boolean %}  {{ vaa }}
    {% endfor %}
    {% newline %}
    {% newline %}  
  {% endfori %}
{% endstripnewlines %}

So the main issue was, that your input object used to display a boolean was in each loop named the same thing.

Now it isn’t anymore because of this:

    {% for vaa in arr_Serie1_StandardTasks_Descriptions %}
      {% comment %}strip everything weird from the array type (which is stored in the var "vaa") and use that as part of the name of the object for the boolean{% endcomment %}
      {% assign type_vaa = vaa | remove:" " | remove:"/" | remove:"-" | downcase %}
      {% newline %}
      {% input zv.[type_vaa] as:boolean %}  {{ vaa }}
    {% endfor %}

So inside each “zv” (basically, in each loop) we are gonna loop over the array you created for the types of booleans (=vaa).
The value of each loop in that array, can be used to name your objects (so that each objects is not only linked to each “zv” but also are different objects from one another).

So this

zv.[type_vaa] is actually zv.verwarming for the very first boolean. AND it is also linked to your custom.directors because of the “zv” part.

Care to go at it one more time? :slightly_smiling_face:

thank you for the solutions but the lay out is not what I want.
In your code all the benefit of kinds are listed with a small check sign for these which were selected.
I would like to list only the selected benefit in kinds.

image

in my code I had this layout
image

I know @Birgit, it was just to give you an easy example, to explain why those booleans were the same for every director. :slightly_smiling_face:

Are you stuck now implementing the visual needs to your code? And if so, where?

yes I’m stuck. I don’t know how I can list only the benefit in kinds that are checked.

Ah, okay, I see.

You can do that with an ifi-statement as documented here.

So in your code it’ll be something like (based on my shared code previously) :

{% ifi zv.[type_vaa] == true %}
  {% input zv.[type_vaa] as:boolean %}  {{ vaa }}
{% endifi %}

Up for to implement that in your code? Don’t hesitate to ask if you’re stuck.

we are almost there :slight_smile:
if a benefit of kind is not selected, it will result in a blank space.
how can I remove the blank space?

image

Probably your newline tag is missing from your ifi-statement, i guess?
Hard to tell without seeing your code though :wink: @Birgit

Something like tht perhaps :

{% ifi zv.[type_vaa] == true %}
{% newline %}
  {% input zv.[type_vaa] as:boolean %}  {{ vaa }}
{% endifi %}

that’s much better :slight_smile:

is there a way that I have dots instead of the check signs?:grin: then it would be perfect for me.

image

You can add “-” just at the beginning of your line, but put it between a nic tags (more info on that here)

So something like:

{% ifi zv.[type_vaa] == true %}
{% newline %}
  {% nic %}-{% endnic %}{% input zv.[type_vaa] as:boolean %}  {{ vaa }}
{% endifi %}

So those dashes should become a dot in export (and the nic tag is only visible in export mode)

but the checks sign remains…

Then put that too between the nic-statement, something we do in our standard templates as well. That should do it :slightly_smiling_face:

that makes everything disappear.

but this is a minor issue so I’ll let it go

thanks for the help

@Birgit,

Willing to help as everything shouldn’t disappear.

If you share the code, I’m eager to dive in with you

with this code the list of benefit of kinds disappear in het input and the v-sign is still there in de output

{% comment %}create custom directors{% endcomment %}
{% stripnewlines %}
  {% fori zv in custom.directors %}
    {% newline %}
 _**{% input zv.name %}**_
    {% newline %}
      {% newline %}
    Als maandelijkse brutobezoldiging wordt uitbetaald: {% input zv.bezoldiging placeholder:"maandelijkse bezold." as:currency %}€
     {% newline %}
      {% newline %}
    De volgende voordelen alle aard maken deel uit van het loonpakket:
    {% comment %}create list of booleans{% endcomment %}
    {% for vaa in arr_Serie1_StandardTasks_Descriptions %}
      {% comment %}strip everything weird from the array type (which is stored in the var "vaa") and use that as part of the name of the object for the boolean{% endcomment %}
      {% assign type_vaa = vaa | remove:" " | remove:"/" | remove:"-" | downcase %}
      {% newline %}
 {% ifi zv.[type_vaa] == true %}
{% newline %}
 {% nic %}-{% endnic %}{% nic %}{% input zv.[type_vaa] as:boolean %}  {{ vaa }}{% endnic %}
{% endifi %}
   {% endfor %}
   {% ifi zv.anderevaa != blank %}
{% input zv.anderevaa as:text placeholder:'andere voordelen alle aard' size:maxi %}{% endifi %}
    {% newline %}
    {% newline %} 
 {% endfori %}
 {% endstripnewlines %}

Ah, I see.

You need to do this @Birgit:

{% nic %}-{% endnic %}{% ic %}{% input zv.[type_vaa] as:boolean %}{% endic %}  {{ vaa }}

{% nic %}-{% endnic %} : this will only be seen in export mode
{% ic %}{% input zv.[type_vaa] as:boolean %}{% endic %} : this will only be seen in input mode

I think i mislead you there in my previous statement though, but I wasn’t checking as I didn’t had the code so hope you forgive me on that Birgit :relieved:

these is perfect
you’re forgiven :wink: