Hi
We are trying to create a new export file, nevertheless we are experiencing issues with printing the original account number. We’ve tried acc.original_number and it works fine If we don’t use the code in between, but if we do it doesn’t work anymore. We tried to capture it as ‘original_number’ and it also only works fine if the code underneath isn’t there. Nevertheless we are never changing this value and still it is empty.
{% capture code %}
{% capture var_newline %}
{% endcapture %}
Original account number;Mapped account number;ACR account number;ACR account name;Original account description;Mapped account description;Current year;Previous year
{% capture code %}
{% capture var_newline %}
{% endcapture %}
Original account number;Mapped account number;new account number;new account name;Original account description;Mapped account description;Current year;Previous year
{% include “parts/translations” %}
{% for acc in period.accounts.include_zeros %}
{% assign original_number = acc.original_number %}
{% comment %}Get first digit of mapped number{% endcomment %}
{% assign mapped_first_digit = acc.mapped_number | slice:0,1 %}
{% assign mapped_three_digit = acc.mapped_number | slice:0,3 %}
{% if acc.opening_value != 0 or acc.value != 0 or period.minus_1y.accounts.[acc.mapped_number].value != 0 %}
{% assign new_number = “” %}
{% capture new_range_account_numbers %}new_{{ mapped_first_digit }}account_numbers{% endcapture %}
{% for item in [new_range_account_numbers] %}
{% capture new_account_translation %}t{{ item }}{% endcapture %}
{% capture translations %}{% locale “default” %}{% t new_account_translation %}{% endlocale %} - {% locale “fr” %}{% t new_account_translation %}{% endlocale %} - {% locale “nl” %}{% t new_account_translation %}{% endlocale %}{% endcapture %}
{% assign translations = translations | downcase %}
{% assign original_name_lower = acc.original_name | downcase %}
{% if translations contains original_name_lower %}
{% assign new_number = item %}
{% break %}
{% endif %}
{% endfor %}
{% if new_number == “” %}
{% for item in [new_range_account_numbers] %}
{% capture new_account_translation %}t_{{ item }}{% endcapture %}
{% assign new_three_digit = item | slice:0,3 %}
{% if new_three_digit == mapped_three_digit %}
{% assign new_number = item %}
{% break %}
{% endif %}
{% endfor %}
{% endif %}
{% unless new_number == “” %}
{% capture new_number_translation %}t_{{ new_number }}{% endcapture %}
{% endunless %}
{{ original_number }};{{ acc.mapped_number }};{{ new_number }};{% t new_number_translation %};{{ acc.original_name }};{{ acc.mapped_name }};{{ acc.value }};{{ period.minus_1y.accounts.[acc.mapped_number].value }}
{% endif %}
{% endfor %}
{% endcapture %}{{ code | strip_newlines | replace:“”,var_newline }}
Also if we don’t use the code in between, some original account numbers are not filled while they are in fact not empty.
Can you help us out?
Thanks!
Kind regards
Jelle
