Rollforward details with date

Hi Pascal

thank you for your use case of the rollforward, combined with dates. In fact, you can use the rollforward together with the functionality to calculate with dates. More about this calculation here: CASE: calculate with dates

In your case you can do the following:

{% fori detail in current_account.custom.details %}
{% input detail.custom.omschrijving as:date %}
{% endfori %}

{% assign fy_from = period.fiscal_year %}
{% assign fy_to = rollforward.period.fiscal_year %}

{% if fy_to > fy_from %}
  {% for detail in current_account.custom.details %}
  {% assign prev_date = detail.custom.omschrijving | as:date  %}
  {% assign new_date = prev_date | advance_years:1  %}
    {% rollforward new_date detail.custom.omschrijving %}
  {% endfor %}
{% endif %}

You see that the input field custom.omschrijving is a date , which allows us to calculate with it.
We assign the date entered in the field as the previous date and the date + 1 year as the new date. Like this, it will calculate without having to update the code after 2030.

Thank you for your suggestion to improve our templates. I added it to the changes for the near future to make the user experience better .

Kind regards
Sofie