# Template "holiday pay"

**URL:** <https://community.silverfin.com/t/template-holiday-pay/1373>\
**Category:** Templates\
**Tags:** unreconciled, register, custom\_template\
**Created:** [February 5, 2019, 8:25am UTC](https://community.silverfin.com/t/template-holiday-pay/1373 "2019-02-05T08:25:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yana](https://avatars.discourse-cdn.com/v4/letter/y/a9a28c/32.png) [@Yana](https://community.silverfin.com/u/Yana)\
**Post date:** [February 5, 2019, 8:25am UTC](https://community.silverfin.com/t/template-holiday-pay/1373/1 "2019-02-05T08:25:27Z")

</div>

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](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/ba7515cba969a5b6ee2020cde7f4f87b26b087e9.png)

Is there something wrong with my code?

Thanks for your help!

Kind regards  
Yana van Landegem

---

<div class="post-metadata">

**Author:** ![Kimberly\_Vlietinck](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/kimberly_vlietinck/32/1496_2.png) [@Kimberly\_Vlietinck](https://community.silverfin.com/u/Kimberly_Vlietinck)\
**Post date:** [February 5, 2019, 3:46pm UTC](https://community.silverfin.com/t/template-holiday-pay/1373/2 "2019-02-05T15:46:44Z")

</div>

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:

```auto
|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
