Imagine you’d like to create a simple overview with every reconciliation that is starred in the working period:
You can now do that easily as we added an extra method to the reconciliations drop starred
Before, you needed to loop over all reconciliations, and access each reconciliation and check whether or not the reconciliation was starred or not:
{% comment %}show links to all starred reconciliations{% endcomment %}
{% stripnewlines %}
| {% t "Name reconciliation" %}
{% newline %}
|-----#
{% for recon in period.reconciliations %}
{% if recon.starred? %}
{% newline %}
| {% linkto recon %}{{ recon.name }}{% endlinkto %}
{% endif %}
{% endfor %}
{% endstripnewlines %}
Obviously, that meant accessing each reconciliation to check, while that is not needed as you only need the starred ones anyway (so it has an impact on the execution of your code - you won’t notice this though, but it is there, a delay in execution).
Now we added the starred
method, so you can access the reconciliations needed more easily in code (less code), while also being executed more fast:
{% comment %}now it is possible to directly loop over ONLY THE STARRED ONES{% endcomment %}
{% stripnewlines %}
| {% t "Name reconciliation" %}
{% newline %}
|-----#
{% for recon in period.reconciliations.starred %}
{% newline %}
| {% linkto recon %}{{ recon.name }}{% endlinkto %}
{% endfor %}
{% endstripnewlines %}
Link developer site here