Rollforward shared header

Hi

I created a shared header like the one show in this topic CASE: make header with additional info in a recon template where I use custom checkboxes (boolean) and also show the info about who and when someone have used the checkboxes by using the updated_by.name and updated_at code for the custom fields.

The problem is when I do a rollforward the checkboxes should be cleared and this doesn’t happen. They stay on true (or false) even when I add the rollforward nil to the checkboxes. I have put this rollforward code in the shared part but also in the actual template that use this shared-part.
The only thing that happens is that the date and person is updated. I’ve used the code “rollforward false custom.prepared.check” or “rollforward nil custom.prepared.check” , but both doesn’t work.

Is there a solutions to make sure that the checkboxes are always cleared when they are copied to a other period?

Morning Peter,

Thanks for your question.

Could you send me over the relevant segments of your code please and I will take a look at what’s causing the issue?

Thanks
Kalpna

Hi Kalpna,

Here is the code from the shared header, almost the same as the example

Below code gives a header with an automatically check for an user to check-off, that will impact the reconciliation as well
{% endcomment %}
{% assign current_recon = current_reconciliation.handle %}
{% t= "headername" nl:"Naam klant" fr:"Nom du client" en:"Name customer" %}
{% t= "headerperiod" nl:"Periode" fr:"Période" en:"Period" %}
{% t= "headerprepared" nl:"Voorbereid door:" fr:"Preparé par:" en:"Prepared by:" %}
{% t= "headertimeprep" nl:"Voorbereid op:" fr:"Préparé le:" en:"Prepared on:" %}
{% if current_recon == 'bdo_check_venb' %}
  {% t= "headerfirstreview" nl:"Berekening nagekeken door:" fr:"Calcul vérifié par:" en:"Calculation checked by:" %}
  {% t= "headertimefirst" nl:"Berekening nagekeken op:" fr:"Calcul vérifié le:" en:"Calculation checked on:" %}
  {% t= "headerreview" nl:"Aangifte klaar voor indiening:" fr:"Déclaration prête à être soumise:" en:"Declaration ready for submission:" %}
  {% t= "headertimerev" nl:"Nagezien op:" fr:"Révisé le:" en:"Reviewed on:" %}
{% else %}
  {% t= "headerfirstreview" nl:"Nagezien door:" fr:"Revu par:" en:"Reviewed by" %}
  {% t= "headertimefirst" nl:"Nagezien op:" fr:"Révisé le:" en:"Reviewed on:" %}
  {% t= "headerreview" nl:"Finaal nagezien door:" fr:"Finale vérifiée par:" en:"Final checked by:" %}
  {% t= "headertimerev" nl:"Finaal nagezien op:" fr:"Enfin vérifié sur:" en:"Finally checked on:" %}
{% endif %}

{% capture preparecheck %}{% input custom.prepared.check as:boolean default:false assign:isprepared %}{% endcapture %}
{% capture firstcheck %}{% input custom.review.check as:boolean default:false assign:isfirst %}{% endcapture %}
{% capture reviewcheck %}{% input custom.final.check as:boolean default:false assign:isreviewed %}{% endcapture %}
{% comment %}if isreviewed then isfirst and isprepared are also true{% endcomment %}
{% if isreviewed %} {% assign isfirst = true %} {% assign check_review = 0 %} {% else %} {% assign check_review = 1 %} {% endif %}
{% if isfirst %} {% assign isprepared = true %} {% assign check_first = 0 %} {% else %} {% assign check_first = 1 %} {% endif %}
{% if isprepared %} {% assign check_prep = 0 %} {% else %} {% assign check_prep = 1 %} {% endif %}

{% assign last_final_user = "peter boeykens" | downcase %}
{% assign last_final_user = custom.final.check.updated_by.name | downcase %}
{% assign current_user = "Stefanie De Neve" | downcase %}
{% assign current_user = user.name | downcase  %}
{% if last_final_user == blank %}{% assign last_final_user = current_user %}{% endif %}
{% if isreviewed %}
  {% assign unlock = false %}{% comment %}if reviewed then unlock is false unless current user has reviewed (or Bart Anthonissen) {% endcomment %}
  {% if last_final_user == current_user %}{% assign unlock = true %}{% endif %}
  {% if current_user == "bart anthonissen" %}{% assign unlock = true %}{% endif %}
{% else %}{% assign unlock = true %}{% comment %}if not reviewed then unlock is always true{% endcomment %}
{% endif %}

{% stripnewlines %}
||||
{% newline %}
|----20%----:
|----30%----
|----20%----:
|----30%----+#
{% newline %}
| {% t "headername" %}
| {{ company.name | upcase }}
| {% t "headerperiod" %}
| {{ period.end_date | date:"%d-%m-%Y" }}
{% newline %}
| {% t "headerprepared" %}  
  {% if isfirst == false %}{{ preparecheck }}{% endif %}
| {% unreconciled check_prep as:indicator %}
  {{ custom.prepared.check.updated_by.name }}
| {% t "headertimeprep" %}
| {{ custom.prepared.check.updated_at | date:"%d/%m/%Y %H:%M" }}
{% newline %}
| {% t "headerfirstreview" %}  
  {% if isprepared == true and isreviewed == false %}{{ firstcheck }}{% endif %}
| {% unreconciled check_first as:indicator  %}
  {{ custom.review.check.updated_by.name }}
| {% t "headertimefirst" %}
| {{ custom.review.check.updated_at | date:"%d/%m/%Y %H:%M" }}
{% newline %}
| {% t "headerreview" %} 
  {% if unlock == true and isfirst == true %}{{ reviewcheck }}{% endif %}
| {% unreconciled check_review as:indicator %}
  {{ custom.final.check.updated_by.name }}
| {% t "headertimerev" %}
| {{ custom.final.check.updated_at | date:"%d/%m/%Y %H:%M" }}
{% endstripnewlines %}

{% if isreviewed != true %}{% assign isreviewed = false %}{% endif %}
<br>
{% rollforward false custom.prepared.check %}
{% rollforward false custom.review.check %}
{% rollforward false custom.final.check %}

And here is the part of the code I added at the end of each template where I use this header

{% rollforward nil custom.prepared.check %}
{% rollforward nil custom.review.check %}
{% rollforward nil custom.final.check %}

Hi Peter,

Thanks for sending your code over.

After taking a look at your code, the second block of code sent over and the “nil” approach to the rollforward is correct, however the first segment of code you sent over can be updated, the case you sent over previously does not factor in rollforward, which could be the reason why this isn’t working as expected.

To ensure that the “updated_by.name” and “updated_at” is not displayed when the template is rollforward, if check should be added.

In this example check “custom.prepared.check == true” is added:

| {% t "headerprepared" %}  
  {% if isfirst == false %}{{ preparecheck }}{% endif %}
| {% unreconciled check_prep as:indicator %}
  {% if custom.prepared.check == true %}{{ custom.prepared.check.updated_by.name }}{% endif %}
| {% t "headertimeprep" %}
| {% if custom.prepared.check == true %}{{ custom.prepared.check.updated_at | date:"%d/%m/%Y %H:%M" }}{% endif %}
{% newline %}

Could you please give the above a go, please let me know if there is anything further I can help with :slight_smile:

Hi Kalpna,

Thanks for taking a look at it.
So, you mean that I should remove the rollforward code in the shared header part (first code) completely?

I think that it works now, probally the problem because the previous period where I wanted to copy from, has a slightly other shared header with only 2 custom booleans (where the period has been locked, so the template doesn’t update anymore) , and were I now have 3 custom booleans. Even when the first 2 custom booleans are the same as the old one, this doesn’t work. I have tried to copy from an open period and then the rollforward does a correct job.

Just a qeustion: the rollforward code has to be only in the final templates, correct? Or could I put it (only once) in the shared header. If not than I have to adapt all other templates that uses this header.

So, thanks for your help.

Hi Peter,

The rollforward can be used in shared parts for sure. This will avoid you repeating the code.

I hope this works as expected but if not please do let me know.

Kalpna

1 Like