Documents - Lay out

Hi,

We created a template ‘Winstmargeberekening’

Problem:
Our colleagues have to select a range of accounts.
But when they select more than one account, the output shows the accounts next to each other instead of below each other.

Probably something is missing in our code.

{% newline %}
| {% ic %}{::infotext as=“hover”}
Selecteer hier de 70 met verkopen aan aankoopprijs
{:/infotext}
{% endic %}
{% input custom.verkopen.BWM as account_collection range:“70” accounts_var:bwm %}
{% for acc in bwm %}
{{ acc.link }}
|{% =$7+ acc.value as:currency %}
|
|
|
|
{% endfor %}

Can you help us?
Thanks!

Kind regards

Stefanie

Hi @Stefanie!

About this case, I assume that the code you are showing here is between ‘stripnewlines’ tags, right?

If so, the only thing that would be missing is a ‘newline’ tag inside the for loop, to display each account selected in a different line. And your code could look like this now:

{% newline %}
| {% ic %}{::infotext as=“hover”}
Selecteer hier de 70 met verkopen aan aankoopprijs
{:/infotext}
{% endic %}
{% input custom.verkopen.BWM as account_collection range:“70” accounts_var:bwm %}
{% for acc in bwm %}
{% newline %}
{{ acc.link }}
|{% =$7+ acc.value as:currency %}
|
|
|
|
{% endfor %}

I hope this solves your issue!

Kind regards
Agustin

The problem isn’t solved.

With the adjustment you suggested, the result is (not below each other):

A copy of the new code:

{% newline %}
| {% ic %}{::infotext as=“hover”}
Selecteer hier de 70 met verkopen aan aankoopprijs
{:/infotext}
{% endic %}
{% input custom.verkopen.BWM as account_collection range:“70” accounts_var:bwm %}
{% for acc in bwm %}
{{ acc.link }}
{% newline %}
|{% =$7+ acc.value as:currency %}
|
|
|
|
{% endfor %}

A copy of the entire code:

Aankopen handelsgoederen en voorraadwijziging

{% stripnewlines %}
|----40%----
|----15%----:
|----10%----:
|----10%----:
|----10%----:
|--------:+|
{% for item in aankopen %}
{% newline %}
|{{ item.link }}
|{% =$6+ item.value as:currency%}
|
|
|
|
{% endfor %}
{% newline %}
| {% ic %}{::infotext as=“hover”}
Selecteer hier de 70 met verkopen aan aankoopprijs
{:/infotext}
{% endic %}
{% input custom.verkopen.BWM as account_collection range:“70” accounts_var:bwm %}
{% for acc in bwm %}
{{ acc.link }}
{% newline %}
|{% =$7+ acc.value as:currency %}
|
|
|
|
{% endfor %}
{% newline %}
|
|
|
|{% =$10+ $6+$7 as:currency %}
|
|
{% newline %}
|
{% newline %}
|Beginvoorraad
|{% =$8+ BV as:currency %}
|
|
|
|
{% newline %}
|Eindvoorraad
|{% =$9+ -EV as:currency %}
|
|
|
|
{% newline %}
|
|
|
|{% =$11+ $8+$9 as:currency %}
|
|
{% newline %}
|
|
|
|
|
|{% =$12+ $10+$11 as:currency %}
{% endstripnewlines %}

Margeberekening

{% stripnewlines %}
{% newline %}
|----50%----
|----10%----

----20%----:

{% newline %}
| Gecorrigeerde verkopen
|
| {{ -$13 | currency}}
| {{ -$13/$12 | currency }}
{% newline %}
|^ Aankopen HG en voorraadwijziging ^
|
|^ {{ $12 | currency }}^
{% endstripnewlines %}

So, the problem is in this part of the code. That way, you are displaying “acc.link” in a different line than “acc.value” because the “newline” tag (where the line break is included) is between them.

If you move the “newline” tag at the beginning of the for loop, the “acc.link” to the first column and the “acc.value” to the second one, your code should look like this now:

{% for acc in bwm %}
{% newline %}
| {{ acc.link }}
| {% =$7+ acc.value as:currency %}
|
|
|
{% endfor %}

I hope this solves it now.

Kind regards,
Agustin.

Thank you very much!
It works :slight_smile:

1 Like