Fori-loop with account collection

I created a reconciliation which is finally included in our accounting report.

For each account selected, this reconciliation shows details which have been input in account details.
For each account selected, I would like to show the name of the account, the details and the total.
My code works in a first time.
My problem is that if I change my mine and decide not showing the details for an account, it is no more possible to delete the account collection created. I tried to click on the rubbish icon but it does not work. Consequently, I have zero lines when I export my reconciliation.
Where am I wrong ? Why is it impossible to delete an “account collection” input created in a fori-loop when it is possible to delete a “text” input in a fori-loop ?

Here is an extract for “Other receivables” (same code for other areas) :

{%ifi custom.actifs_account_41 != empty%}

|–60%–|-20%–:|-5%-:|-20%-:+|
|Autres créances : Détail de certains postes||||
|{%ic%}    Autres créances à détailler ? {%endic%}

|–60%–|-20%–:|-5%-:|-20%-:+|{%fori actif in custom.actifs_account_41%}
|{% input actif.account_41 as:account_collection range:41%}{% assign account_range41 = actif.account_41 %}{%assign account_41=period.accounts|range:account_range41%}
{% assign current_account = account_41 %}
|   {{ current_account.name|upcase }}|||

|–60%–|-20%–:|-5%-:|-20%-:+{% for detail in current_account.details %}{%unless detail.custom.value ==0%}
|         {{ detail.custom.title }} | {{ detail.custom.value|currency }}||| {%endunless%}{% endfor %}
||_ _|||
||{{ account_41|currency }} |||

{%endfori%}


{%endifi%}

Hi Alexandra

I looked at your code and indeed, everything works fine. Can you post the code that doesn’t work, so we can identify what goes wrong?

PS. don’t forget to place your code between brackets

Kind regards
Sofie