How to copy input from a reconciliation to another period?

I prepared a reconciliation Template for capital grants which works well for the current period.
I will have to update it each period.
As I don’t want to re-enter each line every year, I would like to copy it in the new period and only modify some lines.
For a client, I tried to copy it to another period.
It did not work. But since I tried this the reconciliation is no more working in the previous period (error message:Liquid error: undefined method []’ for 0.6e5:BigDecimal|Liquid error: undefined method []’ for 0.6e5:BigDecimal)
How should I adapt my code to allow it to be used each year without deleting the previous period ?

My code is the following :



->DETAIL DES TRANSFERTS DE SUBSIDES AU RESULTAT<-



{% nic %}
{::group}
{:/group}
{% endnic %}

|:--------------|:------------|:-------------|
{%ic%}Sélection des comptes liés aux subsides en capital :{%endic%}|{% input custom[current_account.number].dette.account_15subside as:account_collection range:15 default:15%}{%ic%}#15 Subsides{%endic%}{%assign account_15subside=period.accounts.include_zeros|range:custom[current_account.number].dette.account_15subside%}|{% input custom[current_account.number].dette.account_16ID as:account_collection range:168 default:168%}{%ic%}#16 Impôts différés liés aux subsides{%endic%}{%assign account_16ID=period.accounts.include_zeros|range:custom[current_account.number].dette.account_16ID%}

{%assign $1=0%}{%assign $2=0%}{%assign $3=0%}{%assign $4=0%}{%assign $5=0%}{%assign $6=0%}{%assign $7=0%}{%assign $8=0%}{%assign $9=0%}

Subsides Région wallonne (Exonérés à l’impôt des sociétés)

|Date attribution Subside|N° dossier du subside|Montant du subside reçu|Investissements subsidiés|Amort cum. des biens subs.|Taxation du subside début de l’exercice|Transfert au résultat de l’exercice|Corrections éventuelles|Taxation du subside fin de l’exercice|Solde|
|----10%—|–10%—|–10%—|–10%—|–10%—|–10%—|–10%—|–10%—|–10%—|-----|+{%fori subside in period.custom.subside%}
{%stripnewlines%}
|{% input subside.date as:date%}|
{% input subside.dossier%}|
{% input subside.montantrecu as:currency%}{%assign montantrecu=subside.montantrecu%}{%$2+ montantrecu%}|
{% input subside.invsub as:currency%}|
{% input subside.amortinvsub as:currency%}{%assign amortinvsub=subside.amortinvsub%}{%$3+ amortinvsub%}|
{% input subside.taxdeb as:currency%}{%assign taxdeb=subside.taxdeb%}{%$4+ taxdeb%}|
{%assign transfert=subside.montantrecu*subside.amortinvsub/subside.invsub-subside.taxdeb%}{%=$5+ transfert|currency%}|
{% input subside.corr as:currency%}{%assign corr=subside.corr%}{%$6+ corr%}|
{%assign taxfin=subside.taxdeb+transfert+subside.corr%}{%=$7+ taxfin|currency%}|
{%=$1+ subside.montantrecu-taxfin|currency%}|{%endstripnewlines%}{%endfori%}

|----10%-----------|-10%-|--------10%--------|–10%—|--------10%--------|-------10%---------|---------10%-------|--------10%--------|--------10%--------|-----|+
|TOTAL SUBSIDES| |{{$2|currency}}| |{{$3|currency}}|{{$4|currency}}|{{$5|currency}}|{{$6|currency}}|{{$7|currency}}|{{$1|currency}}|

|–10%–|:—+
|{%ic%}Subsides en capital :{%endic%}|{%if account_15subside.value=$1%}{%unexplained 0 as:indicator%}{%else%}{%unexplained account_15subside.value+$1 as:indicator%}{%endif%}|{%ic%}{{$1|currency}}{%endic%}|{%ic%}{{account_15subside.value|currency}}{%endic%}|{%ic%}{{account_15subside.value+$1|currency}}{%endic%}

Hi Alexandra

Only error I see so far in your code is the following:

{%if account_15subside.value=$1%}

When comparing 2 variables with eachother, you need to use 2 equals signs.
Using one equal sign is exclusively to assign a value to a variable.

If this fix doesn’t solve the problem, let me know.

Kind regards
Sam

Thank you for your answer.

I fixed the problem by canceling “period” in my fori loop.
{%fori subside in period.custom.subside%}

Hi Alexandra

Good thing you found it yourself.
Reconciliations are automatically attached to periods so they indeed don’t need the period part.
Nice work!

Kind regards
Sam

Hi,

@SamVanEenoo

Is it (with a workaround) possible to copy data to another period with the period.custom drop?

Removing period in period.custom did indeed the trick, but i my case there is already to many data that will be lost if period in period.custom will be removed.

Any solutions?

Many thanks!

Hi @Thijs,

Sorry for getting back to you only now.

As you’ve might’ve noticed, using the period. in an account or reconciliation template will cause the “copy data” function to not work at all.

So never use period.custom in those templates.

to get back to your question :

Is it (with a workaround) possible to copy data to another period with the period.custom drop?

Actually, there is.

You could create a text template where you have your period.custom drop but you’ll add a rollforward to it that will copy data from your period.custom to the new period custom drop.

The rollfoward is explained here:

Hope this helps and I’m not too theoretically - let me know if you are stuck and perhaps I can create a case for this as well

Hi @sven,

Thanks for the response!
Seems cool, I’ll get into it!

1 Like

Hi @sven

This does not seem te work?

{% for overeenstemming in period.custom.overeenstemmingen %}
{% input overeenstemming.bedrijfsleider %}
{% rollforward overeenstemming.bedrijfsleider overeenstemming.bedrijfsleider %}
{% endfor %}

Or do I need to assign something?

Many thanks!

Great case, isn’t it @Thijs?

I created a separate case for this, as some others might benefit from this as well:

Hope you can adapt this internally with you - if not, you know how to reach out.
Apologies again for the delay in answer :pensive:

How to become that when you press enter in an inputbox, that you receive a new line?

How to become that when you press enter in an inputbox, that you receive a new line?

Hi there,

What you are triying to do can be achieved by creating a custom drop with a foriloop like this:

{% fori item in custom.the_namespace %}
  {{ item.some_data}}
{% endfori %}

Please have a look at our developer website for more information: Iterations

Also feel free to create a new topic next time in the community as I can see this question was not linked to the original post.

Best,
Borja

Ok thanks i will test it