Rollforward and input-field in for loop

Hi Community,

I have some issues with my code and wonder if anyone could give me a few tips?

I would like to have row five as an input-field which is rollforwarded to next year’s row 4. Right now, it is an input-field but I am not able to type any values in (they just disappear when pressing enter). Since the input field isn’t working, I can not ensure that the rollforward works either.

{% stripnewlines %}
  |{% t "reserveringar" %}
  |{% t "ingaende_balans" %}
  |{% t "icke_skattepliktigt" %}
  |{% t "utgaende_balans" %}
  |{% t "ej_avdragsgillt" %}{% ic %}{::infotext as='hover'}{% t "Q&A" %}{:/infotext}{% endic %}
  
{% newline %}
  |---30%-------
  |---17%-----
  |---17%------
  |---17%-----
  |----19%----:#
{% newline %}
  {% for account in accounts_closing_balance %}
    |{% linkto account %}{{ account.mapped_number }} {{ account.mapped_name }}{% endlinkto %}
    |{{ account.opening_value | currency }}
    
    {% assign ej_skattepliktig = account.id %}
      |{% $1+input account.custom.nontax[ej_skattepliktig] as:integer placeholder:0 %}
        {% assign $1 = 0 %}
    |{{ account.value | currency }}
    
    {% assign ej_avdragsgill = account.identity %}
      |{% $2+input account.custom.nontaxded[ej_avdragsgill] as:integer placeholder:0 %}
        {% assign $2 = 0 %}
          {% rollforward $2 account.custom.nontax[ej_skattepliktig] %}
        
    {% newline %}
  {% endfor %} 

On the same topic, in the next column of the same table, I would like the fourth row to be an input-field which by default is last year’s value in row five. Currently, row five is rollforwarded to the same row next year (i.e. row five instead of to row four).

  |{% t "key" %}{% ic %}{::infotext as="hover"}{% t "key" %} {:/infotext}{% endic %}
 |
  {% comment %}Default is last year's adjustment{% endcomment %}
  |{{ custom.othernon.taxable }}
  |
  {% comment %}Non-tax deductible being RF to next FY's non-taxable{% endcomment %}
  |{% input custom.othernon.deductible as:integer placeholder:0 %}
    {% rollforward othernon.deductible custom.othernon.taxable %}
{% endstripnewlines %}

Thank you in advance

Hi Emmy

I believe the issue of the value dissappearing is because of the use of {% assign ej_avdragsgill = account.identity %} instead of {% assign ej_avdragsgill = account.id %}. So using .id should make it work again.

In regards to setting the default/rollforward based on the value of the next row, the custom.othernon.taxable would now have the same value for every row, so this needs a dynamic name if it can have a different value on every row. But I’m not sure if I completely understand what you need, so do these inputs need to be linked to the account and then you would like to rollforward to an input related to another account (i.e. in the inputs of the account above it)?