# New template "Bonus"

**URL:** <https://community.silverfin.com/t/new-template-bonus/1450>\
**Category:** Templates\
**Created:** [April 4, 2019, 9:59am UTC](https://community.silverfin.com/t/new-template-bonus/1450 "2019-04-04T09:59:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![TinekedeKeyser](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@TinekedeKeyser](https://community.silverfin.com/u/TinekedeKeyser)\
**Post date:** [April 4, 2019, 9:59am UTC](https://community.silverfin.com/t/new-template-bonus/1450/1 "2019-04-04T09:59:27Z")

</div>

Hi,

I would lik to have an total of each person at the end of the year but it doesn’t work  
Below you find my code

{% input custom.bonusemp.range as:account\_collection range:“6” accounts\_var:bonusemployees%}

{% stripnewlines %}

| -----200%---- |
| --- |

{% for acc in bonusemployees %}  
{% newline %}  
|{{ acc.link }}  
|{{ acc.value | currency }}  
{% newline %}  
| Total  
|_^{{ bonusemployees.value | currency }}^_  
{% endfor %}  
{% endstripnewlines %}

  

{% stripnewlines %}  
| Name  
| January  
| February  
| March  
| April  
| May  
| June  
| July  
| August  
| September  
| October  
| November  
| December  
| Total  
{% newline %}  
|----40%----  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|-----------:+  
{% fori bonusemployees in company.custom.bonus %}  
{% newline %}  
| {% input bonusemployees.name as:text %}  
| {% $0+input bonusemployees.bonusjan as:currency %}  
| {% $1+input bonusemployees.bonusfeb as:currency %}  
| {% $2+input bonusemployees.bonusmar as:currency %}  
| {% $3+input bonusemployees.bonusapr as:currency %}  
| {% $4+input bonusemployees.bonusmay as:currency %}  
| {% $5+input bonusemployees.bonusjun as:currency %}  
| {% $6+input bonusemployees.bonusjul as:currency %}  
| {% $7+input bonusemployees.bonusaug as:currency %}  
| {% $8+input bonusemployees.bonussep as:currency %}  
| {% $9+input bonusemployees.bonusoct as:currency %}  
| {% $10+input bonusemployees.bonusnov as:currency %}  
| {% $11+input bonusemployees.bonusdec as:currency %}  
{{+bonusemployees.bonusjan+bonusemployees.bonusfeb+bonusemployees.bonusmar+bonusemployees.bonusapr+bonusemployees.bonusmay+bonusemployees.bonusjun+bonusemployees.bonusjul+bonusemployees.bonusaug+bonusemployees.bonussep+bonusemployees.bonusoct+bonusemployees.bonusnov+bonusemployees.bonusdec}}  
{% endfori %}  
{% newline %}  
|_^^_  
|_^ {{ $0 as:currency }}^_  
|_^ {{ $1 as:currency }}^_  
|_^ {{ $2 as:currency }}^_  
|_^ {{ $3 as:currency }}^_  
|_^ {{ $4 as:currency }}^_  
|_^ {{ $5 as:currency }}^_  
|_^ {{ $6 as:currency }}^_  
|_^ {{ $7 as:currency }}^_  
|_^ {{ $8 as:currency }}^_  
|_^ {{ $9 as:currency }}^_  
|_^ {{ $10 as:currency }}^_  
|_^ {{ $11 as:currency }}^_  
|_^ {{ $0+$1+$2+$3+$4+$5+$6+$7+$8+$9+$10+$11 }}^_

{% endstripnewlines %}

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/58aa9d63b3635844f0dec32e46cc0856f4dc2832.png)

You will see that there is now total in the vertical lines.  
Can you check the liquid code please?

Regards,

Tineke

---

<div class="post-metadata">

**Author:** ![borjaGonzalez](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/borjagonzalez/32/825_2.png) [@borjaGonzalez](https://community.silverfin.com/u/borjaGonzalez)\
**Post date:** [April 4, 2019, 10:11am UTC](https://community.silverfin.com/t/new-template-bonus/1450/2 "2019-04-04T10:11:04Z")

</div>

Hi Tineke,

Welcome to Silverfin Community!

The horizontal total is not working as there is an extra ‘+’ at the beginning of your formula. It should be like this instead:

```auto
{{ bonusemployees.bonusjan+bonusemployees.bonusfeb+bonusemployees.bonusmar+bonusemployees.bonusapr+bonusemployees.bonusmay+bonusemployees.bonusjun+bonusemployees.bonusjul+bonusemployees.bonusaug+bonusemployees.bonussep+bonusemployees.bonusoct+bonusemployees.bonusnov+bonusemployees.bonusdec }}

```

Let me know you need any further assistance.

Regards,  
Borja

---

<div class="post-metadata">

**Author:** ![TinekedeKeyser](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@TinekedeKeyser](https://community.silverfin.com/u/TinekedeKeyser)\
**Post date:** [April 4, 2019, 2:19pm UTC](https://community.silverfin.com/t/new-template-bonus/1450/3 "2019-04-04T14:19:20Z")

</div>

Thanks !

The unreconciled doesn’t work also

{% input custom.bonusemp.range as:account\_collection range:“6” accounts\_var:bonusemployees %}

{% stripnewlines %}

| -----200%---- |
| --- |

{% for acc in bonusemployees %}  
{% newline %}  
|{{ acc.link }}  
|{{ acc.value | currency }}  
{% newline %}  
| Total  
|_^{{ bonusemployees.value | currency }}^_  
{% endfor %}  
{% endstripnewlines %}

  

{% stripnewlines %}  
| Name  
| January  
| February  
| March  
| April  
| May  
| June  
| July  
| August  
| September  
| October  
| November  
| December  
| Total  
{% newline %}  
|----40%----  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|----10%----:  
|-----------:+  
{% fori bonusemployees in company.custom.bonus %}  
{% newline %}  
| {% input bonusemployees.name as:text %}  
| {% $0+input bonusemployees.bonusjan as:currency %}  
| {% $1+input bonusemployees.bonusfeb as:currency %}  
| {% $2+input bonusemployees.bonusmar as:currency %}  
| {% $3+input bonusemployees.bonusapr as:currency %}  
| {% $4+input bonusemployees.bonusmay as:currency %}  
| {% $5+input bonusemployees.bonusjun as:currency %}  
| {% $6+input bonusemployees.bonusjul as:currency %}  
| {% $7+input bonusemployees.bonusaug as:currency %}  
| {% $8+input bonusemployees.bonussep as:currency %}  
| {% $9+input bonusemployees.bonusoct as:currency %}  
| {% $10+input bonusemployees.bonusnov as:currency %}  
| {% $11+input bonusemployees.bonusdec as:currency %}  
| {{bonusemployees.bonusjan+bonusemployees.bonusfeb+bonusemployees.bonusmar+bonusemployees.bonusapr+bonusemployees.bonusmay+bonusemployees.bonusjun+bonusemployees.bonusjul+bonusemployees.bonusaug+bonusemployees.bonussep+bonusemployees.bonusoct+bonusemployees.bonusnov+bonusemployees.bonusdec }}  
{% endfori %}  
{% newline %}  
|_^^_  
|_^ {{ $0 as:currency }}^_  
|_^ {{ $1 as:currency }}^_  
|_^ {{ $2 as:currency }}^_  
|_^ {{ $3 as:currency }}^_  
|_^ {{ $4 as:currency }}^_  
|_^ {{ $5 as:currency }}^_  
|_^ {{ $6 as:currency }}^_  
|_^ {{ $7 as:currency }}^_  
|_^ {{ $8 as:currency }}^_  
|_^ {{ $9 as:currency }}^_  
|_^ {{ $10 as:currency }}^_  
|_^ {{ $11 as:currency }}^_  
|_^ {{ $0+$1+$2+$3+$4+$5+$6+$7+$8+$9+$10+$11 }}^_

{% endstripnewlines %}

  

{{ bonusemployees.value | currency }} {% unreconciled bonuesemployees.value-($0+$1+$2+$3+$4+$5+$6+$7+$8+$9+$10+$11) as:indicator %}

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/a483ee859dc132503e6aa7ab4f512f306617e31f.png)

Kind regards,

Tineke

---

<div class="post-metadata">

**Author:** ![borjaGonzalez](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/borjagonzalez/32/825_2.png) [@borjaGonzalez](https://community.silverfin.com/u/borjaGonzalez)\
**Post date:** [April 4, 2019, 2:50pm UTC](https://community.silverfin.com/t/new-template-bonus/1450/4 "2019-04-04T14:50:48Z")

</div>

Hi Tineke,

Try adding the bonusemployees.value into a variable before you write your formula in your unreconciled tag. The following should work:

```auto
{% assign total = bonusemployees.value %}

{{ bonusemployees.value | currency }} {% unreconciled (total-($0+$1+$2+$3+$4+$5+$6+$7+$8+$9+$10+$11)) as:indicator %}

```

Best,  
Borja

---

<div class="post-metadata">

**Author:** ![TinekedeKeyser](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@TinekedeKeyser](https://community.silverfin.com/u/TinekedeKeyser)\
**Post date:** [April 12, 2019, 9:08am UTC](https://community.silverfin.com/t/new-template-bonus/1450/5 "2019-04-12T09:08:38Z")

</div>

HI,

If the template is filled in, in month x+1, the month x+1 is also filled in in the template of month x. So the unreconciled of month x is red because of the month x+1 (what is not necessary for the month).

What is wrong with the template?

Kind regards  
Tineke

---

<div class="post-metadata">

**Author:** ![Michiel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/michiel/32/2364_2.png) [@Michiel](https://community.silverfin.com/u/Michiel)\
**Post date:** [April 12, 2019, 9:41am UTC](https://community.silverfin.com/t/new-template-bonus/1450/6 "2019-04-12T09:41:29Z")

</div>

> [@TinekedeKeyser](#):
>
> n, in month x+1, the month x+1 is also filled in in the template of month x. So the unreconciled of month x is red because of the month x+1 (what is not necessary for the month).

Hi Tineke,

If I understand your question correctly, you want to see all months up to the period you are in. So if you are in the case above in April you want to see January-February-March-April. Correct?

One thing you can try here is to use period.month\_end\_dates to define your columns (and column headers- (instead of fixed names “January, etc.”). For each column you will need to check if the column is in scope in that period:

```auto
{% for month in period.month_end_dates %} {% comment %}period.month_end_dates contains all months in your bookyear{% endcomment %}
  {% if month <= period.end_date %}
   {{ month | date:"%m/%Y" }}
  {% endif %}
{% endfor %}

```

This way the template can also handle broken bookyears.

I hope this helps!

Michiel

---

<div class="post-metadata">

**Author:** ![TinekedeKeyser](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@TinekedeKeyser](https://community.silverfin.com/u/TinekedeKeyser)\
**Post date:** [July 10, 2019, 12:16pm UTC](https://community.silverfin.com/t/new-template-bonus/1450/7 "2019-07-10T12:16:51Z")

</div>

Hi,

I have changed the input of the bonus template, but now he takes all months in 1 collum.  
Can you please help me? Below you see the code.

Kind regards,

Tineke

```auto
{% input custom.bonusemp.range as:account_collection range:"6" accounts_var:bonusemployees %}

{% stripnewlines %}

{% for acc in bonusemployees %}
{% newline %}
|{{ acc.link }}
|{{ acc.value | currency }}
{% newline %}
| Total
|_^{{ bonusemployees.value | currency }}^_
{% endfor %}
{% endstripnewlines %}

<br>

{% stripnewlines %}
| Name
| {% for month in period.month_end_dates %} {% comment %}period.month_end_dates contains all months in your bookyear{% endcomment %}
  {% if month <= period.end_date %}
   {{ month | date:"%m/%Y" }}
  {% endif %}
{% endfor %}
| period.month_end_dates
| period.month_end_dates
| period.month_end_dates
| period.month_end_dates
| period.month_end_dates
| period.month_end_dates
| period.month_end_dates
| period.month_end_dates
| period.month_end_dates
| period.month_end_dates
| period.month_end_dates
| period.month_end_dates
| Total
{% newline %}
|----40%----
|----10%----:
|----10%----:
|----10%----:
|----10%----:
|----10%----:
|----10%----:
|----10%----:
|----10%----:
|----10%----:
|----10%----:
|----10%----:
|----10%----:
|-----------:+
{% fori bonusemployees in company.custom.bonus %}
{% newline %}
| {% input bonusemployees.name as:text %}
| {% $0+input bonusemployees.bonusjan as:currency %}
| {% $1+input bonusemployees.bonusfeb as:currency %}
| {% $2+input bonusemployees.bonusmar as:currency %}
| {% $3+input bonusemployees.bonusapr as:currency %}
| {% $4+input bonusemployees.bonusmay as:currency %}
| {% $5+input bonusemployees.bonusjun as:currency %}
| {% $6+input bonusemployees.bonusjul as:currency %}
| {% $7+input bonusemployees.bonusaug as:currency %}
| {% $8+input bonusemployees.bonussep as:currency %}
| {% $9+input bonusemployees.bonusoct as:currency %}
| {% $10+input bonusemployees.bonusnov as:currency %}
| {% $11+input bonusemployees.bonusdec as:currency %}
| {{bonusemployees.bonusjan+bonusemployees.bonusfeb+bonusemployees.bonusmar+bonusemployees.bonusapr+bonusemployees.bonusmay+bonusemployees.bonusjun+bonusemployees.bonusjul+bonusemployees.bonusaug+bonusemployees.bonussep+bonusemployees.bonusoct+bonusemployees.bonusnov+bonusemployees.bonusdec }}
{% endfori %}
{% newline %}
|_^^_
|_^ {{ $0 as:currency }}^_
|_^ {{ $1 as:currency }}^_
|_^ {{ $2 as:currency }}^_
|_^ {{ $3 as:currency }}^_
|_^ {{ $4 as:currency }}^_
|_^ {{ $5 as:currency }}^_
|_^ {{ $6 as:currency }}^_
|_^ {{ $7 as:currency }}^_
|_^ {{ $8 as:currency }}^_
|_^ {{ $9 as:currency }}^_
|_^ {{ $10 as:currency }}^_
|_^ {{ $11 as:currency }}^_
|_^ {{ $0+$1+$2+$3+$4+$5+$6+$7+$8+$9+$10+$11 }}^_

{% endstripnewlines %}

<br>

{% assign total = bonusemployees.value %}

{{ bonusemployees.value | currency }} {% unreconciled (total-($0+$1+$2+$3+$4+$5+$6+$7+$8+$9+$10+$11)) as:indicator %}

```

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [July 10, 2019, 12:42pm UTC](https://community.silverfin.com/t/new-template-bonus/1450/8 "2019-07-10T12:42:26Z")

</div>

Hello @TinekedeKeyser,

I’ve tweaked your code a little bit, and actually, it is rather a more complicated template, as you’ll need to loop over your `period.month_end_dates` to create columns.  
eg if you only have 3 months, you need to create only 3 input database variables (and not all 12).

Here’s just an example:

```auto
{% input custom.bonusemp.range as:account_collection range:"6" accounts_var:bonusemployees %}

{% stripnewlines %}

{% for acc in bonusemployees %}
{% newline %}
|{{ acc.link }}
|{{ acc.value | currency }}
{% newline %}
| Total
|_^{{ bonusemployees.value | currency }}^_
{% endfor %}
{% endstripnewlines %}

<br>

{% stripnewlines %}
| Name
  {% for month in period.month_end_dates %} {% comment %}period.month_end_dates contains all months in your bookyear{% endcomment %}
    {% if month <= period.end_date %}
     | {{ month | date:"%m/%Y" }}
    {% endif %}
  {% endfor %}
| Total
{% newline %}
|----40%----
{% for month in period.month_end_dates %}
{% if month <= period.end_date %}
|-------
{% endif %}
{% endfor %}
|-----------:+
{% fori bonusemployees in company.custom.bonus %}
{% newline %}
| {% input bonusemployees.name as:text %}
  {% assign $0 = 0 %} {% comment %}reset register so it can be used for each loop{% endcomment %}
{% for month in period.month_end_dates %}
{% if month <= period.end_date %}
  {% comment %}use the name of the local var month as part of your database variable{% endcomment %}
  {% assign month_name = month | date:"%m" %}
  {% capture month_id %}month_{{ month_name }}{% endcapture %} {% comment %}we will use this as a dynamic variable{% endcomment %}
  | {% $0+input bonusemployees.[month_id] as:currency %}
{% endif %}
{% endfor %}
| **{{ $0 | currency }}** 
{% endfori %}
{% endstripnewlines %} 

```

does this makes any sense to you, as it is somewhat more complicated as you have a for-loop within a fori.

Could you try to update your template with this logic?

Happy to help

---

<div class="post-metadata">

**Author:** ![TinekedeKeyser](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@TinekedeKeyser](https://community.silverfin.com/u/TinekedeKeyser)\
**Post date:** [July 10, 2019, 1:24pm UTC](https://community.silverfin.com/t/new-template-bonus/1450/9 "2019-07-10T13:24:20Z")

</div>

Hi Sven,

Thanks!  
That look well! Just the triangel in the end is green and that need te be red 🤔.  
Can you look for that part?

Kind regards,

Tineke

{% input custom.rent.range as:account\_collection range:“6” accounts\_var:renting %}

{% stripnewlines %}

{% for acc in renting %}  
{% newline %}  
|{{ acc.link }}  
|{{ acc.value | currency }}  
{% newline %}  
| Total  
|_^{{ renting.value | currency }}^_  
{% endfor %}  
{% endstripnewlines %}

  

{% stripnewlines %}  
| Name  
{% for month in period.month\_end\_dates %} {% comment %}period.month\_end\_dates contains all months in your bookyear{% endcomment %}  
{% if month \<= period.end\_date %}  
| {{ month | date:"%m/%Y" }}  
{% endif %}  
{% endfor %}  
| Total  
{% newline %}  
|----40%----  
{% for month in period.month\_end\_dates %}  
{% if month \<= period.end\_date %}  
|-------  
{% endif %}  
{% endfor %}  
|-----------:+  
{% fori renting in company.custom.rent %}  
{% newline %}  
| {% input renting.name as:text %}  
{% assign $0 = 0 %} {% comment %}reset register so it can be used for each loop{% endcomment %}  
{% for month in period.month\_end\_dates %}  
{% if month \<= period.end\_date %}  
{% comment %}use the name of the local var month as part of your database variable{% endcomment %}  
{% assign month\_name = month | date:"%m" %}  
{% capture month\_id %}month\_{{ month\_name }}{% endcapture %} {% comment %}we will use this as a dynamic variable{% endcomment %}  
| {% $0+input renting.[month\_id] as:currency %}  
{% endif %}  
{% endfor %}  
| **{{ $0 | currency }}**  
{% endfori %}

{% endstripnewlines %}

  

{% assign total = renting.value %}

{{ renting.value | currency }} {% unreconciled (total-($0+input renting.[month\_id])) as:indicator %}

---

<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:** [July 11, 2019, 8:10am UTC](https://community.silverfin.com/t/new-template-bonus/1450/10 "2019-07-11T08:10:51Z")

</div>

Hi @TinekedeKeyser

I’ve changed your code to fix your unreconciled-tag and I have added a new register `$1` to add up the total in the last column of each row.

`Renting.value` is then being checked against the value of `$1` in your unreconciled-tag.

Here you can find the entire code with my tweaks:

```auto
{% input custom.rent.range as:account_collection range:"6" accounts_var:renting %}

{% stripnewlines %}

{% for acc in renting %}
{% newline %}
|{{ acc.link }}
|{{ acc.value | currency }}
{% newline %}
| Total
|^{{ renting.value | currency }}^
{% endfor %}
{% endstripnewlines %}

{% stripnewlines %}
| Name
{% for month in period.month_end_dates %} {% comment %}period.month_end_dates contains all months in your bookyear{% endcomment %}
{% if month <= period.end_date %}
| {{ month | date:"%m/%Y" }}
{% endif %}
{% endfor %}
| Total
{% newline %}
|----40%----
{% for month in period.month_end_dates %}
{% if month <= period.end_date %}
|-------
{% endif %}
{% endfor %}
|-----------:+
{% fori renting in company.custom.rent %}
{% newline %}
| {% input renting.name as:text %}
{% assign $0 = 0 %} {% comment %}reset register so it can be used for each loop{% endcomment %}
{% for month in period.month_end_dates %}
{% if month <= period.end_date %}
{% comment %}use the name of the local var month as part of your database variable{% endcomment %}
{% assign month_name = month | date:"%m" %}
{% capture month_id %}month_{{ month_name }}{% endcapture %} {% comment %}we will use this as a dynamic variable{% endcomment %}
| {% $0+input renting.[month_id] as:currency %}
{% endif %}
{% endfor %}
| {% =$1+ $0 | currency %}
{% endfori %}

{% endstripnewlines %}

{% assign total = renting.value %}

{{ renting.value | currency }} {% unreconciled (total-$1) as:indicator %}

```

Kind regards,  
Kimberly

---

<div class="post-metadata">

**Author:** ![TinekedeKeyser](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@TinekedeKeyser](https://community.silverfin.com/u/TinekedeKeyser)\
**Post date:** [July 11, 2019, 11:46am UTC](https://community.silverfin.com/t/new-template-bonus/1450/11 "2019-07-11T11:46:39Z")

</div>

🙌 thanks!

---

<div class="post-metadata">

**Author:** ![TinekedeKeyser](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@TinekedeKeyser](https://community.silverfin.com/u/TinekedeKeyser)\
**Post date:** [July 11, 2019, 12:48pm UTC](https://community.silverfin.com/t/new-template-bonus/1450/12 "2019-07-11T12:48:46Z")

</div>

Hi,

Is it possible to make a total under each month also?

Kind regards,

Tineke

---

<div class="post-metadata">

**Author:** ![Thomas\_Thomsen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/thomas_thomsen/32/1046_2.png) [@Thomas\_Thomsen](https://community.silverfin.com/u/Thomas_Thomsen)\
**Post date:** [July 11, 2019, 2:26pm UTC](https://community.silverfin.com/t/new-template-bonus/1450/13 "2019-07-11T14:26:22Z")

</div>

Hi Tineke  
Yes it is certainly possible, you can for example do it like this.

```auto
{% input custom.rent.range as:account_collection range:"6" accounts_var:renting %}
{% stripnewlines %}
{% for acc in renting %}
{% newline %}
|{{ acc.link }}
|{{ acc.value | currency }}
{% newline %}
| Total
|^{{ renting.value | currency }}^
{% endfor %}
{% endstripnewlines %}
{% stripnewlines %}
| Name
{% for month in period.month_end_dates %} {% comment %}period.month_end_dates contains all months in your bookyear{% endcomment %}
{% if month <= period.end_date %}
| {{ month | date:"%m/%Y" }}
{% endif %}
{% endfor %}
| Total
{% newline %}
|----40%----
{% for month in period.month_end_dates %}
{% if month <= period.end_date %}
|-------
{% endif %}
{% endfor %}
|-----------:+
{% fori renting in company.custom.rent %}
{% newline %}
| {% input renting.name as:text %}
{% assign $0 = 0 %} {% comment %}reset register so it can be used for each loop{% endcomment %}
{% for month in period.month_end_dates %}
{% if month <= period.end_date %}
{% comment %}use the name of the local var month as part of your database variable{% endcomment %}
{% assign month_name = month | date:"%m" %}
{% capture month_id %}month_{{ month_name }}{% endcapture %} {% comment %}we will use this as a dynamic variable{% endcomment %}
{% capture month_total %}total_{{ month_name }}{% endcapture %}
| {% $0+input renting.[month_id] as:currency %}
{% assign [month_total] = [month_total]+renting.[month_id] %}
{% endif %}
{% endfor %}
| {% =$1+ $0 | currency %}
{% endfori %}
{% newline %}
|Total
{% for month in period.month_end_dates %}
{% if month <= period.end_date %}
  {% assign month_name = month | date:"%m" %}
  {% capture month_total %}total_{{ month_name }}{% endcapture %}
  |{{ [month_total] | currency }}
{% endif %}
{% endfor %}
|{{ $1 | currency }}
{% newline %}
{% endstripnewlines %}
{% assign total = renting.value %}
{{ renting.value | currency }} {% unreconciled (total-$1) as:indicator %}

```
