In this code:
{% capture table 'the_form' %}
{% if custom.detail.accounts == blank %}{% assign account_range = '61' %}{% else %}{% assign account_range = custom.detail.accounts %}{% endif %}
| **KOSTEN WEERHOUDEN NIET-BEDRIJFSMATIG** {% input custom.detail.accounts as:account_collection range:6,7 default:account_range %} | Totaal rekening | % niet-bedrijfsmatig | Te verwerpen {% 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+ account.value %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{% input custom[account.number].nietbedrijfsmatig as:percentage %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{% if custom[account.number].nietbedrijfsmatig == blank %}{% assign nietbedrijfsmatig = 0 %}{% else %}{% assign nietbedrijfsmatig = custom[account.number].nietbedrijfsmatig %}{% endif %}{%=$1+ 1*nietbedrijfsmatig*account.value %}{% if forloop.last %}_{% endif %}{% endfor %}
**|-----------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 %}{% if forloop.last %}_{% endif %}{%endfori %}**
|-----------40%----------|------------15%------:|-----------25%-------:|-----------15%-------:+
| | {{ $0 | currency }} | | **{{ $1 | currency }}{% result 'te_verwerpen' $1 %}**
{% endcapture %}
{% result 'the_form' the_form %}
{% if custom.detail.goederen == blank %}{% assign goederen_range = '60'%}{% else %}{% assign goederen_range = custom.detail.goederen %}{% endif %}
{% assign goederen = period.accounts | range:goederen_range %}
{% assign period.custom.some.thing = $1 %}
{{ table }}
We get this if there are no manually added items
Can you tell me how I can only show this content when there is something filled in?
Hello @Fiduciaire.Eulaers ,
It seems like this problem is due to an incorrect use of the **
Could you please try removing all the **
in the following lines of code and see if that solves the problem?
**|-----------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 %}{% if forloop.last %}_{% endif %}{%endfori %}**
Kind regards,
Mathias
Now we have this result:
Is it possible to not show the content in the red box when nothing is filled in?
The code now:
{% capture table 'the_form' %}
{% if custom.detail.accounts == blank %}{% assign account_range = '61' %}{% else %}{% assign account_range = custom.detail.accounts %}{% endif %}
| **KOSTEN WEERHOUDEN NIET-BEDRIJFSMATIG** {% input custom.detail.accounts as:account_collection range:6,7 default:account_range %} | Totaal rekening | % niet-bedrijfsmatig | Te verwerpen {% 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+ account.value %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{% input custom[account.number].nietbedrijfsmatig as:percentage %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{% if custom[account.number].nietbedrijfsmatig == blank %}{% assign nietbedrijfsmatig = 0 %}{% else %}{% assign nietbedrijfsmatig = custom[account.number].nietbedrijfsmatig %}{% endif %}{%=$1+ 1*nietbedrijfsmatig*account.value %}{% if forloop.last %}_{% endif %}{% endfor %}
|-----------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 %}{% if forloop.last %}_{% endif %}{%endfori %}
|-----------40%----------|------------15%------:|-----------25%-------:|-----------15%-------:+
| | {{ $0 | currency }} | | **{{ $1 | currency }}{% result 'te_verwerpen' $1 %}**
{% endcapture %}
{% result 'the_form' the_form %}
{% if custom.detail.goederen == blank %}{% assign goederen_range = '60'%}{% else %}{% assign goederen_range = custom.detail.goederen %}{% endif %}
{% assign goederen = period.accounts | range:goederen_range %}
{% assign period.custom.some.thing = $1 %}
{{ table }}
sven
May 7, 2017, 1:54pm
4
Hello @Fiduciaire.Eulaers ,
You could not shown the content of the rex box (or better said, when there’s no content at all), just by adding following statement around the code that runs that red box:
{% ifi custom.verklaringen != empty %}
code rex box
{% endifi %}
What this does, is that the code between the ifi-statements are only being shown in an export is the (ifi) statement is true.
In our example: if custom.verklaringen is not empty, it will be shown in an export. Which is what you want to do.
Could you try this our and see it gives the desired result?
It worked! Thanks!
The new code:
{% capture table 'the_form' %}
{% if custom.detail.accounts == blank %}{% assign account_range = '61' %}{% else %}{% assign account_range = custom.detail.accounts %}{% endif %}
| **KOSTEN WEERHOUDEN NIET-BEDRIJFSMATIG** {% input custom.detail.accounts as:account_collection range:6,7 default:account_range %} | Totaal rekening | % niet-bedrijfsmatig | Te verwerpen {% 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+ account.value %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{% input custom[account.number].nietbedrijfsmatig as:percentage %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{% if custom[account.number].nietbedrijfsmatig == blank %}{% assign nietbedrijfsmatig = 0 %}{% else %}{% assign nietbedrijfsmatig = custom[account.number].nietbedrijfsmatig %}{% endif %}{%=$1+ 1*nietbedrijfsmatig*account.value %}{% 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 %}{% if forloop.last %}_{% endif %}{%endfori %}
{% endifi %}
|-----------40%----------|------------15%------:|-----------25%-------:|-----------15%-------:+
| | {{ $0 | currency }} | | **{{ $1 | currency }}{% result 'te_verwerpen' $1 %}**
{% endcapture %}
{% result 'the_form' the_form %}
{% if custom.detail.goederen == blank %}{% assign goederen_range = '60'%}{% else %}{% assign goederen_range = custom.detail.goederen %}{% endif %}
{% assign goederen = period.accounts | range:goederen_range %}
{% assign period.custom.some.thing = $1 %}
{{ table }}