Template works by costs but not by incomes

Hi,

I’ve created a template for making a detail of the “regular costs and incoms”, but now I see that I only can ad an attachment (file) by costs and not by incoms…
Can somebody help me with this?

{% t= "Bedrag" fr:"Montant" en:"Amount" %}
{% t= "Datum" fr:"Date" en:"Date" %}
{% t= "Leverancier/Klant" fr:"Fournisseur" en:"Supplier" %}
{% t= "Omschrijving" fr:"Libellé" en:"Description" %}
{% t= "title" fr:"titre" en:"tittle" %}
{% t= "datum" fr:"date" en:"date" %}
{% t= "value" fr:"valeur" en:"value" %}
{% t= "journaal" fr:"journale" en:"journal" %}
{% t= "journaaltype" fr:"type de journale" en:"journaltype" %}



{% addnewinputs %}
{% assign details = current_account.details | sort:'date' %}
{% endaddnewinputs %}


|{% t "Datum" %} |{% t "Journaaltype" %}  | {% t "Journaal" %}   | Nr. | {% t "Leverancier/Klant" %} | {% t "Omschrijving" %} |   | 
|------|---|---|---|-------|-------------|--------------|----------|-------:+{% fori detail in current_account.details %}|   
|{% input detail.custom.datum as:date %}|{% input detail.custom.journaaltype as:journaaltype %}|{% input detail.custom.journaal as:journaal %}|{% input detail.custom.nr %}|{% input detail.custom.leverancier %}|{% input detail.custom.omschrijving %}|{% if current_account.liability_or_income %}{%$0+input detail.custom.value as:n_currency%}{% else %}{%$0+input detail.custom.value as:currency%}|{% input detail.custom.doc as:file %}{% endif %}{% endfori %}{% ic %}
|      |         ||         |         |               |       |   | **{{ multiplier*$0 | currency }}**{% endic %}

Kind regards,
Evelyne

Hi @Evelyne,

Your attachment code falls in the second (else) statement of your if-statement (to check if it’s a cost or income account):

{% if current_account.liability_or_income %}
{%$0+input detail.custom.value as:n_currency%}
{% else %}
{%$0+input detail.custom.value as:currency%}
|
{% input detail.custom.doc as:file %}
{% endif %} 

So you could add {% input detail.custom.doc as:file %} in the first part of your if-statement as well.

Let us know if it works for you.

Hi @sven

It works perfectly now!
Thanks a lot!

Kind regards,
Evelyne