Sort template 'eigen vermogen' on date

Question…

This is the code of the reconciliation of ‘eigen vermogen’ in ‘standaardsjablonen’.

Is it possible to sort the lines on date ? I think I have to put some something between addnewinputs and endaddnewinputs ? {% assign lijnen = custom.lijnen %} and then sort, but sort on which variable ?

Thx for the answer!

{% t= "Totaal" fr:"Total" en:"Total" %}
{% t= "Datum" fr:"Date" en:"Date" %}
{% t= "Boekhouding" fr:"Comptabilité" en:"Bookkeeping" %}
{% t= "Aantal aandelen" fr:"Nombre d'actions" en:"Number of shares" %}
{% t= "Intrinsieke waarde per aandeel" fr:"Valeur intrinsèque par action" en:"Intrinsic value of the shares" %}


{% addnewinputs %}
{% assign lijnen = custom.lijnen %}
{% endaddnewinputs %}


|{% input custom.accounts.range as:account_collection range:1 default:10,11,12,13,14,15 accounts_var:accounts%}{% assign accounts = accounts.include_zeros %}| {% t "Datum" %} {% for account in accounts %}| {% linkto account %}{{account.number}}{% endlinkto %}<br>{{account.name}}{% endfor %}| {% t "Totaal" %}
|---|------{% for account in accounts %}|------:{% endfor %}|-----:+{% fori l in lijnen %}{% assign $0 = 0 %}
|{% input l.omschrijving %} {% input l.doc as:file size:mini %}|{% input l.datum as:date %}{% for account in accounts %}|{%$0+input l[account.number] as:currency placeholder:"" %}{% endfor %}|{%=$1+ $0 %}{% endfori %}
| **{% t "Totaal" %}** | {% for account in accounts %}{% assign $0 = 0 %}|{% for l in lijnen %}{%$0+ l[account.number] %} {% endfor %}{% unexplained account.value+$0 as:indicator %} **{{ $0 | currency }}**{% assign $0 = 0 %}{% endfor %}| **{{ $1 | currency }}**{% ic %}
| {% t "Boekhouding" %} | {% for account in accounts %}|{%=$20+ -1*account.value %}{% endfor %}|**{{ $20 | currency }}**{% endic %}


|---------25%-----|-----------+
|
| {% t "Aantal aandelen" %} | {% input custom.aantal.aandelen %}
| {% t "Intrinsieke waarde per aandeel" %} | {{ -1*accounts.value/custom.aantal.aandelen | currency }}

Hi @Andrew,

You are almost correct.

The answer lies in this code :

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

That’s just an example of how we sort every input for our template “rekening courant”. That template has a collection of inputs (called ‘details’) and one of those inputs is a variable ‘date’).

In your case, you’ll have to assign ‘lijnen’ to a new variable and sort it on a certain variable (datum).

Could you give it a try?

I gave it a try, but I dont find the variable I have to assign ‘lijnen’ to …

Can you help me with that ?

Sure thing @Andrew.

The only code you need to adjust is this :

{% addnewinputs %}
{% assign lijnen = custom.lijnen | sort:'datum' %}
{% endaddnewinputs %}

Hope you’ll understand how it works? If not, just let it know.