Template huurinkomsten

In the template ‘huurinkomsten’ you can just input 1 amount of rent.

Is it possible to add another input field if you have changing rentamounts ? Or give me the code so I can change it myself.

Ex. Huur januari - juni 2017 (6 x 100€) 600,00 €
Huur juli - december 2017 (6 x 125€) 750,00 €

Now you have to input this in 1 line. In multiple lines I think it’s more clear.

Hello @Andrew,

Is the current one (who had an update this week, to put in more lines in 1 input box) not clear enough, like this :

?

I’ve seen this request already, but IMHO a fori around that particular input field makes the template more complicated.

So for now, we don’t have any plans changing it.

If you want the code that generates this template, you can find that on office level; just click on the template and the grey area is the code.

Do you have plans changing this yourself? If you do, you know how to find us if you want any help.

PS this is the current code :

{% t= "REVALORISATIE COEFFICIENTEN" fr:"REVOLARISATION COEFFICIENTS" en:"REVOLARISATION COEFFICIENT" %}
{% t= "Ligging" fr:"Lieu" en:"Location" %}
{% t= "Periode" fr:"Période" en:"Period" %}
{% t= "Verhuurder" fr:"Propriétaire" en:"Renter" %}
{% t= "KI" fr:"RC" en:"CR" %}
{% t= "Beroeps%" fr:"professionel %" en:"professional %" %}
{% t= "BeroepsKI" fr:"RC professionel" en:"professional CR" %}
{% t= "Eigendoms% verhuurder" fr:"% participation loueur" en:"% participation renter" %}
{% t= "niet geïndexeerd" fr:"pas indexé" en:"not indexed" %}
{% t= "Betaalde huur" fr:"Loyer payé" en:"Paid rent" %}
{% t= "Normale huur" fr:"Loyer normal" en:"normal rent" %}
{% t= "Te herkwalificeren" fr:"À requalifier" en:"for requalification" %}
{% t= "herkwalificatie" fr:"Requalification" en:"requalification" %}
{% t= "Grens huurherkwalificatie" fr:"Limite réqualification du loyer" en:"Limit of requalification of the rent" %}
{% t= "verhuurder" fr:"propriétaire" en:"renter" %}
{% t= "adres verhuurder" fr:"adresse propriétaire" en:"address renter" %}
{% t= "herkwalificatie" fr:"requalification" en:"requalification" %}
{% t= "ligging" fr:"lieu" en:"location" %}
{% t= "start datum" fr:"date début" en:"start date" %}
{% t= "eind datum" fr:"date fin" en:"end date" %}
{% t= "KI" fr:"RC" en:"CR" %}
{% t= "beroeps" fr:"professionel" en:"professional" %}
{% t= "eigendoms" fr:"participation" en:"property" %}
{% t= "value" fr:"valeur" en:"value" %}
{% t= "Deel bedrijfsleider:" fr:"Part du gérant" en:"Part of company director" %}


{% comment %}{% t "REVALORISATIE COEFFICIENTEN" %} --- whenever a new year is added or updated, be sure to add the next year too, but with the same numbers as the year you just added/updated{% endcomment %}
{% assign rev_2018 = 4.39 %}
{% assign rev_2017 = 4.39 %}
{% assign rev_2016 = 4.31 %}
{% assign rev_2015 = 4.23 %}
{% assign rev_2014 = 4.23 %}
{% assign rev_2013 = 4.19 %}
{% assign rev_2012 = 4.10 %}
{% assign rev_2011 = 3.97 %}
{% assign rev_2010 = 3.87 %}


{% fori detail in current_account.details %}{% assign $1 = 0 %}{% assign $2 = 0 %}{% assign $3 = 0 %}

|------20%------|-----------65%-----------|------15%--------:+
| **{% t "Verhuurder" %}** | {% if detail.custom.verhuurder != blank %}**{% endif %}{% input detail.custom.verhuurder  %}{% if detail.custom.verhuurder != blank %}**{% endif %}
|            | {% input detail.custom.adres_verhuurder %}
|            | {% input detail.custom.bijlage as:file %}{% ic %}
|            | {% input detail.custom.herkwalificatie as:boolean %} {% t "herkwalificatie" %}{% endic %}
|
| {% 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 %}
|{% if detail.custom.herkwalificatie == 'true' %}
| {% t "KI" %}         |  {% input detail.custom.KI as:currency %} ({% t "niet geïndexeerd" %})
| {% t "Beroeps%" %}   |  {% input detail.custom.beroeps as:percentage %}
| {% t "Eigendoms% verhuurder" %}   |  {% input detail.custom.eigendoms as:percentage %}{% assign beroeps_ki = detail.custom.eigendoms*detail.custom.beroeps*detail.custom.KI %}
| {% t "BeroepsKI" %}  |  {{ beroeps_ki | currency }} ({% t "niet geïndexeerd" %}) 
|{% for year in period.calendar_years %}{% assign start_date = MAX(year.start_date;detail.custom.start_datum) %}{% if detail.custom.eind_datum != blank %}{% assign end_date = MIN(year.end_date;detail.custom.eind_datum) %}{% else %}{% assign end_date = year.end_date %}{% endif %}{% assign amount_of_days = end_date+1-start_date %}{% if amount_of_days > 0 %}{% capture revalorisatie_key %}rev_{{ year.end_date | date:'%Y' }}{% endcapture %}
|{% t "Grens huurherkwalificatie" %} {{ year.end_date | date:'%Y' }} | = {{ beroeps_ki | currency }} x 5/3 x {{ [revalorisatie_key] | currency }} x {{ amount_of_days | integer }}/{{ year.amount_of_days_in_full_year | integer}}|{%=$1+ beroeps_ki*5/3*[revalorisatie_key]*amount_of_days/year.amount_of_days_in_full_year | round | currency %}{% endif %}{% endfor %}
|               | |**{{ $1 | currency }}**
|{% endif %}

{% if detail.custom.eigendoms == 1.0 or detail.custom.eigendoms == blank %}{% capture header %}|------20%------|-----------65%-----------|------15%--------:+{% endcapture %}{% else %}{% capture header %}|------20%------|-----------50%-----------|------15%--------:|------15%--------:+{% endcapture %}{% endif %}

{{ header }}
| {% t "Betaalde huur" %} |{% ic %}{% input detail.custom.title placeholder:'extra info' as:text size:mini %}{% endic %}{% nic %}{{ detail.custom.title | multiline_table }}{% endnic %}{% if detail.custom.eigendoms == 1.0 or detail.custom.eigendoms == blank  %} |{% $3+input detail.custom.value as:currency %}{% else %}| {% input detail.custom.value as:currency %}{% endif %}{% if detail.custom.herkwalificatie == 'true' %}
| {% if detail.custom.eigendoms == 1.0 or detail.custom.eigendoms == blank  %}{% else %}    *{% t "Deel bedrijfsleider:" %}* |  *{{ detail.custom.value | currency }} x {{ detail.custom.eigendoms | percentage  }}*  | {% assign deel_bl = detail.custom.value*detail.custom.eigendoms %}  | {%=$3+ deel_bl %}{% endif %}
|     *{% t "Te herkwalificeren:" %}* |{% unless detail.custom.eigendoms == 1.0 %} | {% endunless %}  |*{% if detail.custom.eigendoms == 1.0 %}{{ MAX(0;$3-$1) | currency }}{% else %}{{ MAX(0;$3-$1) | currency }}{% endif %}*{% endif %}{% $4+ $3 %}
| 

{% endfori %}{% unexplained current_account.value-$4 %}

Template = “huur gebouwen” that is; taken from our template collection.

Thx for the update !!

I would like to change it myself.

I just want an extra inputfield bij ‘betaalde huur’ voor omschrijving en bedrag. For the moment code below is the code. Can i you us a fori-loop that automatically generates new line under betaalde huur ?

Hello @Andrew,

Can you post your code in the topic (instead of a screenshot)? Better for us to work on it :wink:

More info here

Thanks.


|------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 %}```

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!

Thx for your help !

If I replace the code I get ‘Liquid syntax error (line 42): ‘fori’ tag was never closed’

Do i have to add another {% endfori %} ?

Probably @Andrew on line 42 of your code your fori-loop isn’t closed.

If you can’t find it, it’s best to paste your whole code here so I can have a look at.


|------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" %} | {% fori huur in custom[detail.custom.huurder.key] %}{% unless forloop.first %}<br>{% endunless %}{% input huur.bedrag as:currency %}{% endfori %}

That’s not the complete code @Andrew

Where is your first part of the original fori-loop for current_account.details? There’s a part before the table.

Also, there should be 2 endfori at the end of the code, because there are 2 fori-loops.

Hopefully you can understand what I am trying to say? If not, don’t hesitate to say this, and I’ll explain it more detailled for you.

Hallo Sven,

after implementing the code i’m getting this with ‘betaalde huur’

Problem is that their isn’t a total anymore after each line …

I’d like to have for example:

8 x 50€ = 400,00 --> total in new inputfield
4 x 55€ = 220,00

Total of 400,00 + 220,00 = 620,00 € automatically calculated below

Do you understand ?

Sure thing @Andrew

Can you post your code?

What you could do, is save the amounts in a register :

{% $0+input huur.bedrag as:currency %}

For each iteration of a loop, the amount will be added to that register.

So, where you want to display the total, you could do this :

{{ $0 | currency }}

Could you try it?

Hi, I’m also interested in this topic.
Btw is it mandatory to write in english, or can we do this in dutch?
I also like to explain rental income by using number of months x monthly rent and then an automatically calculated total. And possibility of multiple lines because possibly different tenants and/or different monthly rents (e.g. indexation). Is this template already avaible or do I have to change the code myself?
A generic template with possibility of adding multiple lines with description, number, amount and total (=number x amount) would also be helpful, not only for rental income…
Thanks, Sabrina

Hello @svyverman,

This is not possible in our standard template I’m afraid. So you’ll need to adapt in your own custom template.

Is this something you are willing to do? We definitely can look to help you along the way (not sure if you already know the Silverfin Templating Language? If so, might be a good idea to look here to get started for instance).

Thank you Sven. I am willing to do that. I don’t now STL yet. Is this what you learn in the technical workshops?

Indeed @svyverman,

Every quarter we give 3 technical workshops. More info here ; hope you’ll join us soon :+1:

Thank you Sven. I’m waiting for a new series of the technical workshops to start.

1 Like