Unwanted accumulation - register madness

Hi,

Would like to have your assistance on this one. I’ve already searched other topics on registers but can’t seem to wrap my head around this one.

The last column of this template is the difference between column 4 and 5. But because of the use of registers, the amount of the first line in column 5 is also deducted on line 2, the amount of the first and second line in column 5 are also deducted on line 3, and so on.

Below the code:

{% t= "Rekening" fr:"Compte" en:"Account" %}
{% t= "Aangelegd in boekjaar" fr:"Aangelegd in année comptable" en:"Aangelegd in book year" %}
{% t= "Verlaagde uitkering vanaf" fr:"Distribution réduite à partir de" en:"Reduced pay out from" %}
{% t= "Liquidatiereserve" fr:"Réserve de liquidation" en:"Liquidation reserve" %}
{% t= "RV 5%" fr:"PM 5%" en:"Tax 5%" %}
{% t= "Netto uitkeerbaar" fr:"Net payable" en:"Net payable" %}


{% ic %}*{% t "Dit sjabloon wordt automatisch opgebouwd via de rekeningsjablonen op de 13-rekeningen" %}:*{% endic %} {% input custom.accounts.numbers_13 as:account_collection range:13 accounts_var:accounts_13 %}

| {% t "Rekening" %}                                      | {% t "Aangelegd in boekjaar" %}                 | {% t "Verlaagde uitkering vanaf" %}           | {% t "Liquidatiereserve" %}          | {% t "RV 5%" %}   | {% t "Netto uitkeerbaar" %} |
|---------------------------------------------------------|-------------------------------------------------|-----------------------------------------------|-------------------------------------:|------------------:|-----------------------------:+{% for account in accounts_13.include_zeros_with_details %}{% assign details = account.details | sort:'date' %}
| {% linkto account %}{{ account.number }}   {{ account.name }}{% endlinkto %}  | {% input custom.boekjaar_input[account.number] placeholder:'Year' | date:'%Y' %} | {% input custom.uitkering_input[account.number] placeholder:'Reduced pay out from' as:date %} | {%=$0+ account.value | n_currency %} | {%=$1+ $0*0.05 | currency %} | {%=$2+ account.value+$1 | n_currency %}|{% endfor %}
|                                                         |                                                 | **{% t "Totaal" %}**                          | **{{ $0 | currency }}**              |  **{{ $1 | currency }}**              | **{{ $2 | currency }}**  |´´´ 


Any input would be appreciated.

Many thanks.
Kind regards,


Tim

SF%20-%20template%20liquidatiereserve

Hi @twynant,

The purpose of a register is to accumulate the line’s value with the value on the next line and so on. Therefore, the accumulated amount of column 5 is deducted in the last column instead of the value of the line.

You could easily resolve this by assigning a new variable for the calculation. You can use this variable to calculate the amount of the fifth and last column. The register still calculates the total amount.

{% t= “Rekening” fr:“Compte” en:“Account” %}
{% t= “Aangelegd in boekjaar” fr:“Aangelegd in année comptable” en:“Aangelegd in book year” %}
{% t= “Verlaagde uitkering vanaf” fr:“Distribution réduite à partir de” en:“Reduced pay out from” %}
{% t= “Liquidatiereserve” fr:“Réserve de liquidation” en:“Liquidation reserve” %}
{% t= “RV 5%” fr:“PM 5%” en:“Tax 5%” %}
{% t= “Netto uitkeerbaar” fr:“Net payable” en:“Net payable” %}

{% ic %}{% t “Dit sjabloon wordt automatisch opgebouwd via de rekeningsjablonen op de 13-rekeningen” %}:{% endic %} {% input custom.accounts.numbers_13 as:account_collection range:13 accounts_var:accounts_13 %}

| {% t “Rekening” %} | {% t “Aangelegd in boekjaar” %} | {% t “Verlaagde uitkering vanaf” %} | {% t “Liquidatiereserve” %} | {% t “RV 5%” %} | {% t “Netto uitkeerbaar” %} |
|---------------------------------------------------------|-------------------------------------------------|-----------------------------------------------|-------------------------------------:|------------------:|-----------------------------:+{% for account in accounts_13.include_zeros_with_details %}{% assign details = account.details | sort:‘date’ %}
| {% linkto account %}{{ account.number }} {{ account.name }}{% endlinkto %} | {% input custom.boekjaar_input[account.number] placeholder:‘Year’ | date:’%Y’ %} | {% input custom.uitkering_input[account.number] placeholder:‘Reduced pay out from’ as:date %} | {%=$0+ account.value | n_currency %} | {% assign var = $0*0.05 %}{%=$1+ var | currency %} | {%=$2+ account.value+var | n_currency %}|{% endfor %}
| | | {% t “Totaal” %} | {{ $0 | currency }} | {{ $1 | currency }} | {{ $2 | currency }} |

Hope this is clear for you.

Do not hesitate to contact us in case of further questions.

Kind regards,
Robin

Thanks Robin! Very clear!

Many thanks.
Kind regards,

Tim