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?
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’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.
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.
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 %}
{% 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