Hi everyone,
in the code underneath I made an overview of the loans of the client.
If a loan has expired (detail.custom.einddatum) in the current year, it should not be shown anymore in my overview next year in the printed version of the template.
In the workversion of the template - we would like to keep the history of the loans - so there it should still be shown.
I was thinking about using if and ic, but I can’t figure out which is the right way to do it.
Can someone help me?
´´´
->Kredieten<-
{% stripnewlines %}
{% fori detail in custom.details %}
{% if forloop.first %}
| {% t “Doel lening” %}
| {% t “Bank” %}
| {% t “Contractnummer” %}
| {% t “Begindatum” %}
| {% t “Einddatum” %}
| {% t “Totaal kapitaalbedrag”%}
| {% t “Reeds afgelost”%}
| {% t “Aflossing huidig jaar”%}
| {% t “Resterend kapitaal”%}
| {% t “Intrest huidig jaar” %}
| {% t “Beroeps%” %}
| {% t “Beroepsmatige intrest” %}
{% ic %}| {% t “Privé intrest” %}{% endic %}
{% ic %}| {% t “Aflossingstabel” %}{% endic %}
{% newline %}
|:----------10%-----------:
|:---------10%------:
|:—10%—:
|:—10%—:
|:—10%—:
|—10%—:
|—10%—:
|—10%—:
|—10%—:
|—10%—:
|----10%----:
|–5%–:
|–10%–:
|----10%–:+#
{% endif %}
{% newline %}
| {% input detail.custom.doel lening %}
| {% input detail.custom.bank %}
| {% input detail.custom.contractnummer %}{% assign contractnummer = detail.custom.contractnummer %}{% result ‘contractnummer’ contractnummer %}
| {% input detail.custom.begindatum | date: “%d/%m/%Y”%}{% assign begindatum = detail.custom.begindatum | date: “%d/%m/%Y” %}
| {% input detail.custom.einddatum | date: “%d/%m/%Y” %}
| {% $3+input detail.custom.totaal_kapitaalbedrag as:currency%}
| {% $4+input detail.custom.reeds_afgelost as:currency%}
| {% $5+input detail.custom.aflossing_huidig_jaar as:currency %}
{% rollforward detail.custom.reeds_afgelost+detail.custom.aflossing_huidig_jaar detail.custom.reeds_afgelost %}
{% rollforward nil detail.custom.aflossing_huidig_jaar %}
| {%=$1+ detail.custom.totaal_kapitaalbedrag-detail.custom.reeds_afgelost-detail.custom.aflossing_huidig_jaar %}
| {% $7+input detail.custom.totale_intrest as:currency %}
{% rollforward nil detail.custom.totale_intrest %}
| {% input detail.custom.beroeps as:percentage %}
| {%=$0+ detail.custom.totale_intrestdetail.custom.beroeps %}{% assign beroepsintresten = detail.custom.totale_intrestdetail.custom.beroeps %}
| {%=$2+ detail.custom.totale_intrest-beroepsintresten %}
| {% input detail.custom.bijlage as:file %}
{% if forloop.last %}
{% newline %}
|
|
|
|
|
|{{ $3 | abs | currency }}
|{{ $4 | abs | currency }}
|{{ $5 | abs | currency }}
|{{ $1 | abs | currency }}
|{{ $7 | abs | currency }}
|
**|{{ $0 | abs | currency }}{% if ABS(#650000-$0) < 0.01 %}{% unreconciled 0 as:indicator %}{% else %}{% unreconciled #650000-$0 as:indicator %}{% endif %}
|{{ $2 | abs | currency }}
|
{% endif %}
{% if detail.custom.begindatum >= period.year_start_date and detail.custom.begindatum <= period.year_end_date %}
{% $6+ detail.custom.totaal_kapitaalbedrag %}
{% endif %}
{% endfori %}
{% endstripnewlines %}
{% result ‘priveintresten’ $2 %}
{% result ‘totaalkapitaal’ $3 %}
{% result ‘afgelost’ $4 %}
{% result ‘huidige’ $5 %}
{% result ‘nieuwelening’ $6 %}
->Banksaldo’s<-
{% stripnewlines %}
{% fori bank in custom.bank_saldo %}
{% if forloop.first %}
| {% t “Rekeningnummer” %}
| {% t “Bank” %}
| {% t "Saldo per " %}{{ period.minus_2y.year_end_date | date: “%d/%m/%Y”}}
| {% t "Saldo per " %}{{ period.minus_1y.year_end_date | date: “%d/%m/%Y”}}
| {% t "Saldo per " %}{{ period.year_end_date | date: “%d/%m/%Y”}}
{% newline %}
|:----------20%-----------:
|:---------20%------:
|:—20%—:
|:—20%—:
|:—20%—:#
{% endif %}
{% newline %}
| {% input bank.rekeningnummer %}
| {% input bank.kredietinstelling %}
| {% input bank.saldoy2 placeholder:“Saldo Y-2” as:currency %}{% assign saldoy2 = bank.saldoy2 %}
| {% $8+input bank.saldoy1 placeholder:“Saldo Y-1” as:currency %}{% result ‘beginsaldo’ $8 %}
| {% $9+input bank.saldoy placeholder:“Saldo Y” as:currency %}{% result ‘eindsaldo’ $9 %}
{% rollforward bank.saldoy1 bank.saldoy2 %}
{% rollforward bank.saldoy bank.saldoy1 %}
{% rollforward nil bank.saldoy %}
{% if forloop.last %}
{% newline %}
|
|
|
| {{ $8 }}
|{{ $9 }}
{% endif %}
{% endfori %}
{% endstripnewlines %}´´´