White spaces in detail Erelonen

Hallo,

Our template with name Erelonen is linked to different accounts (613100__613101, 60, 22, 618, 300__370 and 20).

If you have a look to the file 309708, you can see we have a big blank space and I don’t why?

Can you have a look for me please?

Thanks,

Sylvie

Hello @svalais,

In order to help you, I am going to need the part of the code you want us to change. We want the community to become a place where the users can interact and learn some new things by reading each other posts and questions.

I can check the code for you but that way, it will not be visible to the next person who is going to read this post. You can also read this post. You will find it pretty handy.

Regards,
Michail

Hallo,

This is the code for the detail Erelonen:

‘’’{% assign accounts = #613100__613101 %}
{% assign accounts2 = #60 %}
{% assign accounts3 = #22 %}
{% assign accounts4 = #618 %}
{% assign accounts5 = #300__370 %}
{% assign accounts6 = #20 %}
{% assign $11 = 0 %}{% assign $10 = 0 %}{% assign $20 = 0 %}{% assign $0 = 0 %}

{% ic %}Version 2.0 dd 06/03/2017{% endic %}

|{% ic %}{{ current_account.link }}{% endic %} | {% for year in period.calendar_years %}{% if forloop.first %}{% capture first_date %}{{ year.start_date | date:’%d/%m’ }}{% endcapture %}{% unless first_date == ‘01/01’ %} 01/01/{{ year.start_date | date:’%Y’ }} - {{ year.start_date-1 | date:’%d/%m/%Y’ }}|{% assign first_date_not_broken = true %}{% endunless %}{% endif %}{{ year.start_date | date:’%d/%m/%Y’ }} - {{ year.end_date | date:’%d/%m/%Y’ }}|{% endfor %}{% t “Totaal boekjaar” %} |
|-----------------------------------------+|-------------------15%-----------------------------------:|-------------15%---------------------------------:|-----------------------15%------------------------:|---------------------15%--------------------:|-----------------------------------------:{% for current_account in accounts6.include_zeros_with_details %}|{% for detail in current_account.details %}
| {% if detail.custom.name != blank %}{{ detail.custom.name }} | {% assign $15 = 0 %}{% for year in period.calendar_years %}{% stripnewlines %}
{% if forloop.last %}{% assign drop = detail.custom.value %}{% else %}{% assign drop = detail.custom[forloop.index] %}{% endif %}
{% if forloop.first and first_date_not_broken %}
{%=$11+ detail.custom[‘first_year’] as:currency placeholder:’’ %}|{% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$30+ detail.custom[‘first_year’]%}{% endif %}
{% endif %}
{% $15+ drop %}
{% case forloop.index0 %}
{% when 0 %}
{%=$0+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$31+ drop%}{% endif %}
{% when 1 %}
{%=$10+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$32+ drop%}{% endif %}
{% when 2 %}
{%=$20+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$33+ drop%}{% endif %}
{% endcase %}
|
{% endstripnewlines %}{% endfor %}{{ $15 | currency }} {% if detail.custom.adres1 != blank %}
| {{ detail.custom.adres1 }}{% endif %}{% if detail.custom.postcode or detail.custom.gemeente != blank %}
| {{ detail.custom.postcode }} {{ detail.custom.gemeente }}{% endif %}{% if detail.custom.vatnr != blank %}
| {{ detail.custom.vatnr }}{% endif %}{% if type_opties != blank%}{% assign type_int = detail.custom.type | integer | minus:6 %}
| {% t “soort” %} {{ type_opties[type_int] }}{% endif %}{% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}
| {% t “fiche” %} {% t “Ja” %} {% endif %}
|{% endif %}{% endfor %}{% for vrije in current_account.custom.vrije_tekst %}
|{{ vrije.text }} |{% assign $15 = 0 %}{% for year in period.calendar_years %}{% if forloop.first and first_date_not_broken %}{%=$11+ vrije[‘first_year’] as:currency placeholder:’’ %}|{% endif %}{% $15+ vrije[forloop.index] %}{% case forloop.index0 %}{% when 0 %}{%=$0+ vrije[forloop.index] as:currency placeholder:’’ %}{% when 1 %}{%=$10+ vrije[forloop.index] as:currency placeholder:’’ %}{% when 2 %}{%=$20+ vrije[forloop.index] as:currency placeholder:’’ %}{% endcase %}|{% endfor %}{{ $15 | currency }}{% endfor %}{% endfor %}{% unexplained current_account.value-($10+$20+$0) %}{% for current_account in accounts3.include_zeros_with_details %}|{% for detail in current_account.details %}
| {% if detail.custom.name != blank %}{{ detail.custom.name }} | {% assign $15 = 0 %}{% for year in period.calendar_years %}{% stripnewlines %}
{% if forloop.last %}{% assign drop = detail.custom.value %}{% else %}{% assign drop = detail.custom[forloop.index] %}{% endif %}
{% if forloop.first and first_date_not_broken %}
{%=$11+ detail.custom[‘first_year’] as:currency placeholder:’’ %}|{% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$30+ detail.custom[‘first_year’]%}{% endif %}
{% endif %}
{% $15+ drop %}
{% case forloop.index0 %}
{% when 0 %}
{%=$0+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$31+ drop%}{% endif %}
{% when 1 %}
{%=$10+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$32+ drop%}{% endif %}
{% when 2 %}
{%=$20+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$33+ drop%}{% endif %}
{% endcase %}
|
{% endstripnewlines %}{% endfor %}{{ $15 | currency }} {% if detail.custom.adres1 != blank %}
| {{ detail.custom.adres1 }}{% endif %}{% if detail.custom.postcode or detail.custom.gemeente != blank %}
| {{ detail.custom.postcode }} {{ detail.custom.gemeente }}{% endif %}{% if detail.custom.vatnr != blank %}
| {{ detail.custom.vatnr }}{% endif %}{% if type_opties != blank%}{% assign type_int = detail.custom.type | integer | minus:6 %}
| {% t “soort” %} {{ type_opties[type_int] }}{% endif %}{% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}
| {% t “fiche” %} {% t “Ja” %} {% endif %}
|{% endif %}{% endfor %}{% for vrije in current_account.custom.vrije_tekst %}
|{{ vrije.text }} |{% assign $15 = 0 %}{% for year in period.calendar_years %}{% if forloop.first and first_date_not_broken %}{%=$11+ vrije[‘first_year’] as:currency placeholder:’’ %}|{% endif %}{% $15+ vrije[forloop.index] %}{% case forloop.index0 %}{% when 0 %}{%=$0+ vrije[forloop.index] as:currency placeholder:’’ %}{% when 1 %}{%=$10+ vrije[forloop.index] as:currency placeholder:’’ %}{% when 2 %}{%=$20+ vrije[forloop.index] as:currency placeholder:’’ %}{% endcase %}|{% endfor %}{{ $15 | currency }}{% endfor %}{% endfor %}{% unexplained current_account.value-($10+$20+$0) %}{% for current_account in accounts5.include_zeros_with_details %}|{% for detail in current_account.details %}
| {% if detail.custom.name != blank %}{{ detail.custom.name }} | {% assign $15 = 0 %}{% for year in period.calendar_years %}{% stripnewlines %}
{% if forloop.last %}{% assign drop = detail.custom.value %}{% else %}{% assign drop = detail.custom[forloop.index] %}{% endif %}
{% if forloop.first and first_date_not_broken %}
{%=$11+ detail.custom[‘first_year’] as:currency placeholder:’’ %}|{% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$30+ detail.custom[‘first_year’]%}{% endif %}
{% endif %}
{% $15+ drop %}
{% case forloop.index0 %}
{% when 0 %}
{%=$0+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$31+ drop%}{% endif %}
{% when 1 %}
{%=$10+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$32+ drop%}{% endif %}
{% when 2 %}
{%=$20+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$33+ drop%}{% endif %}
{% endcase %}
|
{% endstripnewlines %}{% endfor %}{{ $15 | currency }} {% if detail.custom.adres1 != blank %}
| {{ detail.custom.adres1 }}{% endif %}{% if detail.custom.postcode or detail.custom.gemeente != blank %}
| {{ detail.custom.postcode }} {{ detail.custom.gemeente }}{% endif %}{% if detail.custom.vatnr != blank %}
| {{ detail.custom.vatnr }}{% endif %}{% if type_opties != blank%}{% assign type_int = detail.custom.type | integer | minus:6 %}
| {% t “soort” %} {{ type_opties[type_int] }}{% endif %}{% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}
| {% t “fiche” %} {% t “Ja” %} {% endif %}
|{% endif %}{% endfor %}{% for vrije in current_account.custom.vrije_tekst %}
|{{ vrije.text }} |{% assign $15 = 0 %}{% for year in period.calendar_years %}{% if forloop.first and first_date_not_broken %}{%=$11+ vrije[‘first_year’] as:currency placeholder:’’ %}|{% endif %}{% $15+ vrije[forloop.index] %}{% case forloop.index0 %}{% when 0 %}{%=$0+ vrije[forloop.index] as:currency placeholder:’’ %}{% when 1 %}{%=$10+ vrije[forloop.index] as:currency placeholder:’’ %}{% when 2 %}{%=$20+ vrije[forloop.index] as:currency placeholder:’’ %}{% endcase %}|{% endfor %}{{ $15 | currency }}{% endfor %}{% endfor %}{% unexplained current_account.value-($10+$20+$0) %}{% for current_account in accounts2.include_zeros_with_details %}|{% for detail in current_account.details %}
| {% if detail.custom.name != blank %}{{ detail.custom.name }} | {% assign $15 = 0 %}{% for year in period.calendar_years %}{% stripnewlines %}
{% if forloop.last %}{% assign drop = detail.custom.value %}{% else %}{% assign drop = detail.custom[forloop.index] %}{% endif %}
{% if forloop.first and first_date_not_broken %}
{%=$11+ detail.custom[‘first_year’] as:currency placeholder:’’ %}|{% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$30+ detail.custom[‘first_year’]%}{% endif %}
{% endif %}
{% $15+ drop %}
{% case forloop.index0 %}
{% when 0 %}
{%=$0+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$31+ drop%}{% endif %}
{% when 1 %}
{%=$10+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$32+ drop%}{% endif %}
{% when 2 %}
{%=$20+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$33+ drop%}{% endif %}
{% endcase %}
|
{% endstripnewlines %}{% endfor %}{{ $15 | currency }} {% if detail.custom.adres1 != blank %}
| {{ detail.custom.adres1 }}{% endif %}{% if detail.custom.postcode or detail.custom.gemeente != blank %}
| {{ detail.custom.postcode }} {{ detail.custom.gemeente }}{% endif %}{% if detail.custom.vatnr != blank %}
| {{ detail.custom.vatnr }}{% endif %}{% if type_opties != blank%}{% assign type_int = detail.custom.type | integer | minus:6 %}
| {% t “soort” %} {{ type_opties[type_int] }}{% endif %}{% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}
| {% t “fiche” %} {% t “Ja” %} {% endif %}
|{% endif %}{% endfor %}{% for vrije in current_account.custom.vrije_tekst %}
|{{ vrije.text }} |{% assign $15 = 0 %}{% for year in period.calendar_years %}{% if forloop.first and first_date_not_broken %}{%=$11+ vrije[‘first_year’] as:currency placeholder:’’ %}|{% endif %}{% $15+ vrije[forloop.index] %}{% case forloop.index0 %}{% when 0 %}{%=$0+ vrije[forloop.index] as:currency placeholder:’’ %}{% when 1 %}{%=$10+ vrije[forloop.index] as:currency placeholder:’’ %}{% when 2 %}{%=$20+ vrije[forloop.index] as:currency placeholder:’’ %}{% endcase %}|{% endfor %}{{ $15 | currency }}{% endfor %}{% endfor %}{% unexplained current_account.value-($10+$20+$0) %}{% for current_account in accounts4.include_zeros_with_details %}|{% for detail in current_account.details %}
| {% if detail.custom.name != blank %}{{ detail.custom.name }} | {% assign $15 = 0 %}{% for year in period.calendar_years %}{% stripnewlines %}
{% if forloop.last %}{% assign drop = detail.custom.value %}{% else %}{% assign drop = detail.custom[forloop.index] %}{% endif %}
{% if forloop.first and first_date_not_broken %}
{%=$11+ detail.custom[‘first_year’] as:currency placeholder:’’ %}|{% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$30+ detail.custom[‘first_year’]%}{% endif %}
{% endif %}
{% $15+ drop %}
{% case forloop.index0 %}
{% when 0 %}
{%=$0+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$31+ drop%}{% endif %}
{% when 1 %}
{%=$10+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$32+ drop%}{% endif %}
{% when 2 %}
{%=$20+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$33+ drop%}{% endif %}
{% endcase %}
|
{% endstripnewlines %}{% endfor %}{{ $15 | currency }} {% if detail.custom.adres1 != blank %}
| {{ detail.custom.adres1 }}{% endif %}{% if detail.custom.postcode or detail.custom.gemeente != blank %}
| {{ detail.custom.postcode }} {{ detail.custom.gemeente }}{% endif %}{% if detail.custom.vatnr != blank %}
| {{ detail.custom.vatnr }}{% endif %}{% if type_opties != blank%}{% assign type_int = detail.custom.type | integer | minus:6 %}
| {% t “soort” %} {{ type_opties[type_int] }}{% endif %}{% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}
| {% t “fiche” %} {% t “Ja” %} {% endif %}
|{% endif %}{% endfor %}{% for vrije in current_account.custom.vrije_tekst %}
|{{ vrije.text }} |{% assign $15 = 0 %}{% for year in period.calendar_years %}{% if forloop.first and first_date_not_broken %}{%=$11+ vrije[‘first_year’] as:currency placeholder:’’ %}|{% endif %}{% $15+ vrije[forloop.index] %}{% case forloop.index0 %}{% when 0 %}{%=$0+ vrije[forloop.index] as:currency placeholder:’’ %}{% when 1 %}{%=$10+ vrije[forloop.index] as:currency placeholder:’’ %}{% when 2 %}{%=$20+ vrije[forloop.index] as:currency placeholder:’’ %}{% endcase %}|{% endfor %}{{ $15 | currency }}{% endfor %}{% endfor %}{% unexplained current_account.value-($10+$20+$0) %}{% for current_account in accounts.include_zeros_with_details %}|{% for detail in current_account.details %}
| {{ detail.custom.name }} | {% assign $15 = 0 %}{% for year in period.calendar_years %}{% stripnewlines %}
{% if forloop.last %}{% assign drop = detail.custom.value %}{% else %}{% assign drop = detail.custom[forloop.index] %}{% endif %}
{% if forloop.first and first_date_not_broken %}
{%=$11+ detail.custom[‘first_year’] as:currency placeholder:’’ %}|{% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$30+ detail.custom[‘first_year’]%}{% endif %}
{% endif %}
{% $15+ drop %}
{% case forloop.index0 %}
{% when 0 %}
{%=$0+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$31+ drop%}{% endif %}
{% when 1 %}
{%=$10+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$32+ drop%}{% endif %}
{% when 2 %}
{%=$20+ drop as:currency placeholder:’’ %} {% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}{%$33+ drop%}{% endif %}
{% endcase %}
|
{% endstripnewlines %}{% endfor %}{{ $15 | currency }} {% if detail.custom.adres1 != blank %}
| {{ detail.custom.adres1 }}{% endif %}{% if detail.custom.postcode or detail.custom.gemeente != blank %}
| {{ detail.custom.postcode }} {{ detail.custom.gemeente }}{% endif %}{% if detail.custom.vatnr != blank %}
| {{ detail.custom.vatnr }}{% endif %}{% if type_opties != blank%}{% assign type_int = detail.custom.type | integer | minus:6 %}
| {% t “soort” %} {{ type_opties[type_int] }}{% endif %}{% if detail.custom.fichejanee == 1 or detail.custom.fichejanee == “true” %}
| {% t “fiche” %} {% t “Ja” %} {% endif %}
|{% endfor %}{% for vrije in current_account.custom.vrije_tekst %}
|{{ vrije.text }} |{% assign $15 = 0 %}{% for year in period.calendar_years %}{% if forloop.first and first_date_not_broken %}{%=$11+ vrije[‘first_year’] as:currency placeholder:’’ %}|{% endif %}{% $15+ vrije[forloop.index] %}{% case forloop.index0 %}{% when 0 %}{%=$0+ vrije[forloop.index] as:currency placeholder:’’ %}{% when 1 %}{%=$10+ vrije[forloop.index] as:currency placeholder:’’ %}{% when 2 %}{%=$20+ vrije[forloop.index] as:currency placeholder:’’ %}{% endcase %}|{% endfor %}{{ $15 | currency }}{% endfor %}{% endfor %}{% unexplained current_account.value-($10+$20+$0) %}
|
|_ {% t “Totaal” %} | {% for year in period.calendar_years %}{% if forloop.first and first_date_not_broken %}{{ $11 | currency }} |{% endif %}{% case forloop.index0 %}{% when 0 %}{{ $0 | currency }} {% when 1 %}{{ $10 | currency }} {% when 2 %}{{ $20 | currency }}{% endcase %}|{% endfor %}{{ $0+$10+$20 | currency }}_|{% result ‘totaal_y1’ $30 %} {% result ‘totaal_y2’ $31 %} {% result ‘totaal_y3’ $32 %} {% result ‘totaal_y4’ $33 %}’’’

Hi Sylvie,

I had a look, and in this specific case, it seems due to the fact that you do

| {% if detail.custom.name != blank %}{{ detail.custom.name }} | in the block for accounts3.

accounts3 contains accounts, with filled in details, but the details are filled in with a default template. This means they don’t have a custom.name. You would think this would prevent the code to be executed (as detail.custom.name != blank is false) and that’s correct, but the fact that the | is before the if statement, means that a new table row will be created anyway.

Moving the | in the if statement could resolve the whitespace (but you should probably also move the start of the if statement to the previous line then, otherwise your table will be broken.

Hi Tim,

Problem is solved.

Thanks,

Sylvie