Thank you for posting @Andrew (it was not complete however; this is :
{% fori detail in current_account.details %}
|------20%------|-----------65%-----------|------15%--------:+
| **{% t "Huurder" %}** | **{% input detail.custom.huurder %}**
| | {% input detail.custom.adres_huurder %}
| | {% input detail.custom.bijlage as:file %}
|
| {% t "Ligging" %} | {% input detail.custom.ligging %}
|
| {% t "Periode" %} | {% input detail.custom.start_datum as:date %} {% ifi detail.custom.eind_datum != blank %}- {% input detail.custom.eind_datum as:date %}{% endifi %}
|
| {% t "Betaalde huur" %} |{% input detail.custom.title placeholder:'extra info' %} |{% input detail.custom.value as:n_currency %}{% endfori %}
The missing part being the opening of your fori-loop.
Now, back to your question: you want to be able to give in mutiple numbers of rent, right, for each “verhuurder” ?
So, we’ll need to create a fori-loop around an object that’s unique in the main fori-loop (because we do a fori within fori ).
and what is unique, is the object detail.custom.huurder
What’s even more unique, is that every loop will create an unique id for each object.
So, detail.custom.huurder.key gives a unique number for each loop in the original fori-loop.
Why would we prefer to do this? Because you can always accidentally give the name “Jordan” in the first loop, and in the second loop also “Jordan”. In your second fori-loop then, everything will be “attached” to your first loop AND second, which is wrong.
Now, we can create our second fori-loop like this :
{% fori huur in custom[detail.custom.huurder.key] %}{% unless forloop.first %}<br>{% endunless %}{% input huur.bedrag as:currency %}{% endfori %}
So,
this code :
{% input detail.custom.title placeholder:'extra info' %} |{% input detail.custom.value as:n_currency %}
can be replaced by this:
{% fori huur in custom[detail.custom.huurder.key] %}{% unless forloop.first %}<br>{% endunless %}{% input huur.bedrag as:currency %}{% endfori %}
I’ve added the <br>
because visually, you’ll want to input the first amount on the same line as “Betaalde huur”.
Also, you’ll need to add the second object as well, if you want that.
Could you give it a go @Andrew? Let us know if you’re stuck!