Reconciled accounts or not

We want to add the green spot or red triangle of the selected account in a custom template.

{% input custom.checklistMDA.accounts_to_select as:account_collection range:1,2,3,4,5,6,7,8,9 accounts_var:ChecklistMDA_collection %}

{% stripnewlines %}
| Rekeningnummer
| Waarde
| Check
{% newline %}
|------
|—20%—
|—50%—+
{% newline %}
{% for account in ChecklistMDA_collection %}
| {{ account.link }}
| {{ account.value | currency }}
{% newline %}
{% endfor %}
|^ Total ^
|^ {{ ChecklistMDA_collection | currency }} ^
{% endstripnewlines %}

Just like the one in fixed assets:

Hello Els,

To show a green dot or red triangle you need to use the unreconciled tag with the attribute as:indicator.

You usually pass a (numeric) variable to this tag, which will be use to evaluate if the status is reconciled (equals to zero) or unreconciled (different from zero).

So, you will need to establish first what is the condition you want to check here.

For example, in your example from the fixed assets template, the unreconciled tag compares the value of the account at the start of the year with the value entered in the first input field next to it to defined if it’s reconciled or not.

And it looks something like this:

{% assign account_invest_opening = custom[account_id].invest_opening | default:opening_value_inv %}
{% assign check_opening_inv = account_invest_opening-account.opening_value %}
{% unreconciled check_opening_inv as:indicator %}

Edit (some extra information):

In case you want to display if the underlying template used by each account is reconciled or not, I’m affraid that it is not possible to fetch the reconciled status of reconciliations or account templates. Depending on which account template you are using (if is a custom one or not for example) you could create a result in that specific account template used, that will replicate and store the it’s status as reconciled or not. And later on, in this new template, call that result stored in the account.

period.accounts.[account_number].results.[tag]

Also note that each account could be using a different template as well

Thank you for your reply. Now I’ve entered an extra field to check the value:
The value of the accounts selected should match te value of ‘Gecontroleerde waarde’

When I change the value in ‘Gecontroleerde waarde’ every field changes. I don’t remember how to fix this :innocent:

This is how the code changed now:

{% stripnewlines %}
| Rekeningnummer
| Waarde
| Gecontroleerde waarde
| Check
{% newline %}
|------
|—20%—
|—25%—
|—25%—+
{% newline %}
{% for account in ChecklistMDA_collection %}
| {{ account.link }}
| {{ account.value | currency }}
| {% =$1+input custom.collectionMDA_accounts.comment as:currency %}{% assign account_checklistMDA_collection = custom.collectionMDA_accounts.comment %}
| {% assign account_ChecklistMDA_collection = custom[account_id].ChecklistMDA_collection | default:account_value %}
{% assign check_account_value = account_checklistMDA_collection-account.value %}
{% unreconciled check_account_value as:indicator %}
{% newline %}
{% endfor %}
|^ Total ^
|^ {{ ChecklistMDA_collection | currency }} ^
|^^
|^^
{% endstripnewlines %}

Hi Els,

Sorry for my late reply, I missed your latest post

The issue is that the custom drop used in the input field {% =$1+input custom.collectionMDA_accounts.comment as:currency %} is not linked to the item in the loop, so every iteration of the loop is actually referring to the same input field.

Considering that your loop looks like {% for account in ChecklistMDA_collection %}, we can attach that custom drop to the account as: {% =$1+input account.custom.collectionMDA_accounts.comment %}

The updated code will look like this:

{% input custom.checklistMDA.accounts_to_select as:account_collection range:1,2,3,4,5,6,7,8,9 accounts_var:ChecklistMDA_collection %}
{% stripnewlines %}
| Rekeningnummer
| Waarde
| Gecontroleerde waarde
| Check
{% newline %}
|------
|–20%–
|–25%–
|–25%–+
{% newline %}
{% for account in ChecklistMDA_collection %}
| {{ account.link }}
| {{ account.value | currency }}
| {% =$1+input account.custom.collectionMDA_accounts.comment as:currency %}
{% assign account_checklistMDA_collection = account.custom.collectionMDA_accounts.comment %}
| {% assign check_account_value = account_checklistMDA_collection-account.value %}
{% unreconciled check_account_value as:indicator %}
{% newline %}
{% endfor %}
|^ Total ^
|^ {{ ChecklistMDA_collection | currency }} ^
|^^
|^^
{% endstripnewlines %}

I hope this new code solves your issue!