Urgent: rounding differences

The topic about the rounding differences is closed, so I opened a new one.
This is the code to get rid of the rouding differences, but now we have another problem with the “verworpen uitgaven”.

The code:

{% capture table %}
{% if custom.detail.accounts == blank %}{% assign account_range = '61' %}{% else %}{% assign account_range = custom.detail.accounts %}{% endif %}

| **VERWORPEN UITGAVEN** {% input custom.detail.accounts as:account_collection range:6,7 default:account_range %} | Totaal rekening | Aftrekbeperking | Verworpen {% assign accounts = period.accounts | range:account_range %}
|-----------40%---------------|---------------15%-----------:|---------------25%-----------:|---------------15%-----------:+{% for account in accounts %}
|{% if forloop.last %}_{% endif %}{{ account.name }}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{%=$0+ 1*account.value %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{% input custom[account.number].aftrekbeperking as:percentage %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{% if custom[account.number].aftrekbeperking == blank %}{% assign aftrekbeperking = 1 %}{% else %}{% assign aftrekbeperking = custom[account.number].aftrekbeperking %}{% endif %}{%=$1+ 1*aftrekbeperking*account.value | round | currency %}{% if forloop.last %}_{% endif %}{% endfor %}

{% ifi custom.verklaringen != empty %}
|-----------40%---------------|---------------15%-----------:|---------------25%-----------:|---------------15%-----------:+{%fori explanation in custom.verklaringen %}
|_{% input explanation.description %}_|_{% $2+input explanation.value as:currency %}_|{% if forloop.last %}_{% endif %}{% input explanation.verworpen as:percentage %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{% if explanation.verworpen == blank %}{% assign verworpen = 0 %}{% else %}{% assign verworpen = explanation.verworpen %}{% endif %}{%=$1+ 1*explanation.value*explanation.verworpen | round | currency %}{% if forloop.last %}_{% endif %}{%endfori %}
{% endifi %}

|----------40%----------|------------15%------:|-----------25%-------:|---------------15%-----------:+
|                    | {{ $0 | round | currency }} |  | **{{ $1 | round | currency }}{% result 'te_verwerpen1' $1 %}**
{% endcapture %}

{% if custom.detail.goederen == blank %}{% assign goederen_range = ''%}{% else %}{% assign goederen_range = custom.detail.goederen %}{% endif %}
{% assign goederen = period.accounts | range:goederen_range %}

{{ table }}

The result:

Normally, the result was 0,00 when we had no “Verworpen uitgaven”.

How do we need to solve this? This should be fixed tomorrow, because I’m going on a holiday…
When we do have “Verworpen uitgaven”, there is no problem.

Hello @Fiduciaire.Eulaers,

Not a problem to create a new topic; I prefer that for each (new) problem.

Because it’s urgent, I can give you a quick workaround but couldn’t find the reason (has something to do by converting zero value to a string, but it doesn’t make sense for now to me).

If you work with following if-statement behind the totals, you should be fine :

{% if accounts != empty %}
|----------40%----------|------------15%------:|-----------25%-------:|---------------15%-----------:+
|                    | {{ $0 | round | currency }} |  | **{{ $1 | round | currency }}{% result 'te_verwerpen1' $1 %}**{% endif %}

Does that work for you?

So, what you do here, is that the totals only will be displayed and/or executed if you have accounts selected.

This works, thanks for your quick respons!

For the future, we would like the 0,00 to be shown, but it’s less urgent.