How unreconciled works
No unreconciled tags are present
Account templates
The template will be reconciled in the database in the following way: Account Value - Sum of values entered in the template, as long as the values are in an input field named _detail.custom.value in the custom.details collection_:
{% fori detail in current_account.custom.details %}
{% input detail.custom.value as:currency %}
{% endfori %}
This way (comparing sum of text-property values with account values) is the fastest way to use this functionality and it’s how it was originally designed to be used in Silverfin. The {% unreconciled %}
tag was later added for reconciliation templates and some exceptional accounts but the reality is that they are used widely across the platform.
Reconciliation templates
The reconciliation will be following the logic selected on the edit reconciliation screen:
- Reconciliation necessary and invalid without data: the red triangle will appear if no data has been entered on the template and it will become a green circle when an input field has been edited.
- Reconciliation necessary, but also valid without data: the template will always be reconciled (green circle) since no
{% unreconciled %}
tags are present and data validation is not needed. - No reconciliation necessary : a grey square will show if the default data on the template has not been modified. A yellow square will appear if the default data has been altered.
Unreconciled tags are present
Account templates
When using the {% unreconciled %} tags inside an if statement the template will be set to reconciled (green circle) if the statement is false. If unreconciled tags are present, the template does not reconcile on the database and will follow the logic below.
If the {% unreconciled %}
tags are used outside an if statement or if the statement in which the tags are is true, then the logic on those tags will be applied.
{% assign test = 100 %}
{% comment %}Template will be set to reconciled (green circle){% endcomment %}
{% if test != 100 %}
{% unreconciled 1 %}
{% endif %}
{% comment %}Template will be set to unreconciled by 1 (red triangle){% endcomment %}
{% if test == 100 %}
{% unreconciled 1 %}
{% endif %}
If several {% unreconciled %}
tags are present, the template will add all of them up and set the template to reconciled or unreconciled depending on the sum of those values. In this case false if statements will be ignored.
{% assign test = 100 %}
{% assign test_2 = 200 %}
{% comment %}Template will be set to unreconciled by 251 (250+1){% endcomment %}
{% if test_2 != 200 %}
{% unreconciled 1000 %}
{% endif %}
{% if test == 100 %}
{% unreconciled 250 %}
{% endif %}
{% unreconciled 1 %}
Please note, when multiple {% unreconciled %}
tags are used in an account template and the template is unreconciled, the total difference displayed by the template in the top-right corner may appear to be different from the expected sum of the individual {% unreconciled %}
tags.
Example
Let us consider the example below:
Two {% unreconciled %}
tags are used, each calculating their value as the set figures of 100 and 500 respectively, less a user entered value. At first glance you would expect the total to come to 100, i.e. the sum of the two tags. However, the difference displayed in the top right of the template is 300.
The account template displays 300 as the total difference is calculated as the sum of the absolute value of all unreconciled tags. This method is used to avoid problems arising when the sum of the negative {% unreconciled %}
tags and positive {% unreconciled %}
tags are equal. If absolute values were not used, the total difference would be displayed as 0, which would be highly misleading. Using absolute values avoids such a scenario arising.
Reconciliation templates
The reconciliation will be following the below logic depending on what has been selected on the edit reconciliation screen:
- Reconciliation necessary and invalid without data:
{% unreconciled %}
tags are taking into consideration unless they are inside false if statements, in which case the validation of data will apply (green circle if data has been entered, red triangle if not). - Reconciliation necessary, but also valid without data:
{% unreconciled %}
tags are taking into consideration unless they are inside false if statements. - No reconciliation necessary :
{% unreconciled %}
tags are ignored. A grey square will show if the default data on the template has not been modified. A yellow square will appear if the default data has been altered.
Issues with unreconciled tags inside {% ic %}/{% nic %} and {% fori %}
For performance reasons the total reconciliation status of a template is stored in the cache. The value that is stored in the cache comes from rendering the template in input mode for reconciliation templates and from rendering the template in export mode for account templates.
We should avoid using unreconciled tags inside {% ic %} and {% nic %} as they might not work as expected. When using unreconciled tags inside {% ic %} and {% nic %} the result of the calculation of the reconciled status can be different between input and non-input modes. This can result in cache issues since the total reconciliation status of a template is stored in the cache by rendering the input mode for reconciliation templates and the export mode for account templates. We show a warning in the liquid editor to avoid this from happening.
There shouldn’t be a case where we need to use unreconciled tags in {% ic %} and {% nic %}, as they don’t show explicitly on export mode. So, there is no need to show/hide them this way.
Unreconciled tags used inside a fori-loop can also cause issues since a fori-loop will always foresee an extra empty loop in input mode to allow you to add an additional item to the collection. In export mode only the populated/existing items in the collection will be shown.
When you use the unreconciled tag or local variable used to perform the calculation for the unreconciled tag (more on that topic here) inside the fori-loop, the calculation of the reconciled status will be done including the empty loop potentially resulting in an incorrect reconciled status and result.
Here’s a simplified example of where this could go wrong:
{% assign test_value = 0 %}
{% fori test_item in custom.test_items %}
{% input test_item.description %}
{% if test_item.description == blank %}
{% assign test_value = test_value+1 %}
{% endif %}
{% endfori %}
{% unreconciled test_value as:indicator %}
Instead, you should be doing this to ensure a correct calculation of the result and reconciled status in this example:
{% assign test_value = 0 %}
{% fori item in custom.the_namespace %}
{% input item.description %}
{% endfori %}
{% for item in custom.the_namespace %}
{% if item.description != blank %}
{% assign test_value = test_value+1 %}
{% endif %}
{% endfor %}
{% unreconciled test_value as:indicator %}
Updated over 1 year ago