Template "holiday pay"

Hi there

I’ve tried to create a template for provision holiday pay.
See my code below.
I’ve tried this in an file but I don’t get an green sphere when it’s reconciled.

"{% stripnewlines %}
|Omschrijving
|Bezoldiging
| x
|Percentage
| =
|Provisie
{% newline %}
|—25%—
|—25%—
|—5%—
|—15%—
|—5%—:
|—25%—:+
{% fori detail in current_account.details %}
{% newline %}
|{% input detail.custom.Omschrijving %}
|{% $18+input detail.custom.Bezoldiging as:currency %}
|
|{% $19+input detail.custom.Percentage as:percentage %}
|
|{{$18*$19 | currency}}
|{% endfori %}
{% endstripnewlines %}

{% comment %}reconcile value $18*$19{% endcomment %}
{% unreconciled current_account.value+($18*$19)%}"

image

Is there something wrong with my code?

Thanks for your help!

Kind regards
Yana van Landegem

Hi @Yana,

I noticed in your code that you are not resetting the registers $18 and $19 to 0 for every loop in your code. This means that for every new line created in your loop the previous values that were saved in the registers $18 and $19 will be taken into account as well for the calculation for the new line.

I made some adjustments to your code:

|Omschrijving
|Bezoldiging
| x
|Percentage
| =
|Provisie
{% newline %}
|-----25%----
|-----25%----
|-----5%----
|-----15%----
|-----5%----:
|-----25%----:+
{% fori detail in current_account.details %}
{% newline %}
{% assign $18 = 0 %}
{% assign $19 = 0 %}
|{% input detail.custom.Omschrijving %}
|{% $18+input detail.custom.Bezoldiging as:currency %}
|
|{% $19+input detail.custom.Percentage as:percentage %}
|
|{%=$20+ $18*$19 | currency%}
|{% endfori %}
{% endstripnewlines %}

{% comment %}reconcile value $20{% endcomment %}
{% unreconciled current_account.value-$20%}

I hope this works for you now.

Kind regards,
Kimberly