Let’s say you have some data stored on the account details drop in the account 201060.001 like this:
{% fori detail in current_account.custom.details %}
{% input detail.custom.invoice_number %}
{% endfori %}
To access to this data on the same account template you can do the following:
Current Year data:
{% for detail in current_account.custom.details %}
{{ detail.custom.invoice_number }}
{% endfor %}
Previous Year data:
{% assign current_account = period.minus_1y.accounts | range:current_account.number %}
{% for detail in current_account.details %}
{{ detail.custom.invoice_number }}
{% endfor %}
Finally you can also access to this information from a reconciliation template, document or a different account template with the same code but only after assigning current_account to the account number that we want to access. In our example it would be:
Current Year:
{% assign current_account = period.accounts | range:'201060.001' %}
{% for detail in current_account.details %}
{{ detail.custom.invoice_number }}
{% endfor %}
Previous Year:
{% assign current_account = period.minus_1y.accounts | range:'201060.001' %}
{% for detail in current_account.details %}
{{ detail.custom.invoice_number }}
{% endfor %}