Line with ‘1’ gives the desired result (4.31), the second doesn’t give anything. What am I doing wrong here? I want the script to pick the right value according to the year.
As you see, if a new coefficient has to be added, you only have to add one line of code in your template where the result tags are in!
So less code is our goal to go for.
Can you try with this information, and let uw know if it did the trick?
Great case!
You had 2 mistakes in your own code though :
You need to use the date-filter | date:"%Y"
I’d suggest never to use spaces in a capture, because you can’t have variables with a space in it
PS mind to use the corresponding topic “Templates” in the future, with your code in quotes (more info here, thanks!
Found it … This only works when I add the ‘Parameters’ template to the period in question for the customer. Is there a way to avoid this (in the sense that the parameters file is always included in every period for every client without having to do this manually?
It’s pretty normal the template with all the parameters should be added to the working period. But once it’s added, there’s no need to erase it.
You can even activate a warning-tag if the template is missing, like this :
{% if period.reconciliation.parameters != blank %}
code of all the results
{% else %}
{% ic %}
{::warningtext}
Please add reconciliation template "Parameters" in order to link certain results
{:/warningtext}
{% endic %}
{% endif %}
Thanks for the very nice tip Sven … tried to implement it but it’s not working … Even for customers where the template ‘Parameters’ has been included, he always shows the warning (as such, period.reconciliation.parameters is always blank) … Any ideas?
Sven made a little mistake (it has to be reconcilations with an s at the end). That’s why it’s not working. Also try to be consistent. If you put a capital P in your handle (Parameters). Try to use a capital P when you are referring to it as well.
{% if period.reconciliation**s**.**P**arameters != blank %}
code of all the results
{% else %}
{% ic %}
{::warningtext}
Please add reconciliation template "Parameters" in order to link certain results
{:/warningtext}
{% endic %}
{% endif %}
A related question: is it also possible to refer to an accounts template (like ‘Kapitaal’) like this? I would like to put an alert in a reconciliation template and a text when the accounts template ‘Kapitaal’ is not available for a given client.
It’s not possible since a single account template can be used for multiple accounts. You can however link to an account using {% linkto account.link %}The thing you want to link{% endlinkto %} or just {{account.link}}