Urgent : Adapting Jaarverslag > P&L not correct anymore

Dear All,

I’ve changed the “Jaarverslag” by replacing the "Resultatenrekening’ below the ‘balans’.
Now I get other totals.

If I place the ‘Resultatenrekening’ on top of the ‘Balans’, the totals are correct.
I dont understand why this is.
I’ve seen someting like $10 and $11 in the totals and believe this has someting to do with it, but dont quit understand the code itself.

Kind regards
Sven

Hello @Sven.G,

Could you post your code of the template?

I’m guessing it will have something to do with the “registers” (those are the dollar signs) not being placed correctly.

Those registers store numbers (amounts if you will) and by going down in the code of the template, they add new amounts to it. And sometimes it’s needed to assign them to zero again ( by simply doing {% assign $0 = 0 %} for instance )

But as I said, if I can have a quick look at your code, I might be able to help you more.

|:—10%—|:-------------50%----------------|-----20%------:|—20%—:+
| |Resultatenrekening |{{period.year_end_date | date: ‘%d/%m/%Y’}}|{% if previous_period.exists %}{{previous_period.year_end_date | date: ‘%d/%m/%Y’}}|
|{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Omzet |{%=$0+ -1*#70 %} |{% if previous_period.exists %}{%=$1+ -1*#70:1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Handelsgoederen |{%=$0+ -1*#60 %} |{% if previous_period.exists %}{%=$1+ -1*#60:1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Andere bedrijfsopbrengsten |{%=$0+ -1*#71__74 %} |{% if previous_period.exists %}{%=$1+ -1*#71__74:1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% if new_mar %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Niet-recurrente bedrijfsopbrengsten |{%=$0+ -1*(#760+#7620+#7630+#764__768) %} |{% if previous_period.exists %}{%=$1+ -1*(#760+#7620+#7630+#764__768):1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% endif %}
| |
| |Brutomarge: |{{ $10 | currency }} |{% if previous_period.exists %}{{ $11 | currency }}|{% endif %}
|{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Diensten & diverse goederen |{%=$0+ -1*#61 %} |{% if previous_period.exists %}{%=$1+ -1*#61:1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Personeelskosten |{%=$0+ -1*#62 %} |{% if previous_period.exists %}{%=$1+ -1*#62:1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Niet-recurrente bedrijfskosten |{%=$0+ -1*(#660+#6620+#663+#664__667+#6690) %} |{% if previous_period.exists %}{%=$1+ -1*(#660+#6620+#663+#664__667+#6690):1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% endif %}
|
| |Bedrijfsresultaat |{{ $10 | currency }} |{% if previous_period.exists %}{{ $11 | currency }}|{% endif %}
|

|:—10%—|:-------------50%----------------|-----20%------:|—20%—:+{% unless new_mar_date >= ‘2016’ %}
|{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Financiële kosten en opbrengsten |{%=$0+ -1*(#75+#65) %} |{% if previous_period.exists %}{%=$1+ -1*(#75+#65):1y %} |{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Uitzonderlijke kosten en opbrengsten |{%=$0+ -1*(#76+#66) %} |{% if previous_period.exists %}{%=$1+ -1*(#76+#66):1y %}| {% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% endunless %}{% if new_mar %}
|{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Financiële kosten en opbrengsten |{%=$0+ -1*(#75+#65+#761+#7621+#7631+#769+#661+#6621+#6631+#668+#6691) %} |{% if previous_period.exists %}{%=$1+ -1*(#75+#65+#761+#7621+#7631+#769+#661+#6621+#6631+#668+#6691):1y %} |{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% endif %}
|
| |Winst (verlies) van het boekjaar |{{ $10 | currency }} |{% if previous_period.exists %}{{ $11 | currency }}|{% endif %}
|{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Mutatie uitgestelde belastingen|{%=$0+ -1*(#680+#780) %} |{% if previous_period.exists %}{%=$1+ -1*(#680+#780):1y %} |{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Belastingen |{%=$0+ -1*(#67+#77) %} |{% if previous_period.exists %}{%=$1+ -1*(#67+#77):1y %} |{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Mutatie belastingvrije reserves |{%=$0+ -1*(#689+#789) %} |{% if previous_period.exists %}{%=$1+ -1*(#689+#789):1y %} |{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}
|
| |Winst (verlies) na belasting |{{ $10 | currency }} |{% if previous_period.exists %}{{ $11 | currency }}|{% endif %}
|

So, I’m guessing this is the whole code you use :

{% assign previous_period = period.minus_1y %}

|:-------------40%----------------|-----15%------:|-----15%------:|------15%-------:|---15%---:+
|
|**_Balans_** {% assign $10 = 0 %}{% assign $11 = 0 %} |{% if previous_period.exists %}**{{period.year_end_date | date: '%d/%m/%Y'}}**|**{{period.minus_1y.year_end_date | date: '%d/%m/%Y'}}**|**Verschil EUR**|**Verschil %**{% endif %}
|{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
|Vaste activa                  |{%=$0+ #20__28 %}     |{% if previous_period.exists %}{%=$1+ #20__28:1y %}|{{ $0-$1 | currency }}|{{ ($0-$1)/$1 | percentage }}{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
|Voorraden                     |{%=$0+ #30__37 %}     |{% if previous_period.exists %}{%=$1+ #30__37:1y %}|{{ $0-$1 | currency }}|{{ ($0-$1)/$1 | percentage }}{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
|Vorderingen > 1 jaar          |{%=$0+ #29 %}         |{% if previous_period.exists %}{%=$1+ #29:1y %}    |{{ $0-$1 | currency }}|{{ ($0-$1)/$1 | percentage }}{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
|Vorderingen < 1 jaar          |{%=$0+ #40__41 %}     |{% if previous_period.exists %}{%=$1+ #40__41:1y %}|{{ $0-$1 | currency }}|{{ ($0-$1)/$1 | percentage }}{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
|Geldbeleggingen en liquide middelen|{%=$0+ #5 %}     |{% if previous_period.exists %}{%=$1+ #5:1y %}|{{ $0-$1 | currency }}|{{ ($0-$1)/$1 | percentage }}{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
|Overlopende rekeningen        |{%=$0+ #490__491 %}   |{% if previous_period.exists %}{%=$1+ #490__491:1y %}    |{{ $0-$1 | currency }}|{{ ($0-$1)/$1 | percentage }}{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}
|
|**Activa**                    |{{ $10 | currency }}  |{% if previous_period.exists %}{{ $11 | currency }}   |{{ $10-$11| currency }}|{{ ($10-$11)/$11 | percentage }}{% endif %}
|{% assign $10 = 0 %}{% assign $11 = 0 %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
|Eigen vermogen                |{%=$0+ -1*#10__15 %}  |{% if previous_period.exists %}{%=$1+ -1*#10__15:1y %}|{{ $0-$1 | currency }}|{{ ($0-$1)/$1 | percentage }}{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
|Voorzieningen en uitgestelde belastingen    |{%=$0+ -1*#16 %}      |{% if previous_period.exists %}{%=$1+ -1*#16:1y %}|{{ $0-$1 | currency }}|{{ ($0-$1)/$1 | percentage }}{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
|Schulden > 1jaar              |{%=$0+ -1*#17 %}      |{% if previous_period.exists %}{%=$1+ -1*#17:1y %}|{{ $0-$1 | currency }}|{{ ($0-$1)/$1 | percentage }}    {% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
|Schulden < 1jaar              |{%=$0+ -1*#42__48 %}  |{% if previous_period.exists %}{%=$1+ -1*#42__48:1y %}|{{ $0-$1 | currency }}|{{ ($0-$1)/$1 | percentage }}{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
|Overlopende rekeningen        |{%=$0+ -1*#492__494 %}|{% if previous_period.exists %}{%=$1+ --1*#492__494:1y %}    |{{ $0-$1 | currency }}|{{ ($0-$1)/$1 | percentage }}{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}
|
|**Passiva**                   |{{ $10 | currency }}  |{% if previous_period.exists %}{{ $11 | currency }}|{{ $10-$11| currency }}|{{ ($10-$11)/$11 | percentage }}{% endif %}
|


|:---10%---|:-------------50%----------------|-----20%------:|---20%---:+
| |Resultatenrekening |{{period.year_end_date | date: '%d/%m/%Y'}}|{% if previous_period.exists %}{{previous_period.year_end_date | date: '%d/%m/%Y'}}|
|{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Omzet |{%=$0+ -1*#70 %} |{% if previous_period.exists %}{%=$1+ -1*#70:1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Handelsgoederen |{%=$0+ -1*#60 %} |{% if previous_period.exists %}{%=$1+ -1*#60:1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Andere bedrijfsopbrengsten |{%=$0+ -1*#71__74 %} |{% if previous_period.exists %}{%=$1+ -1*#71__74:1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% if new_mar %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Niet-recurrente bedrijfsopbrengsten |{%=$0+ -1*(#760+#7620+#7630+#764__768) %} |{% if previous_period.exists %}{%=$1+ -1*(#760+#7620+#7630+#764__768):1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% endif %}
| |
| |Brutomarge: |{{ $10 | currency }} |{% if previous_period.exists %}{{ $11 | currency }}|{% endif %}
|{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Diensten & diverse goederen |{%=$0+ -1*#61 %} |{% if previous_period.exists %}{%=$1+ -1*#61:1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Personeelskosten |{%=$0+ -1*#62 %} |{% if previous_period.exists %}{%=$1+ -1*#62:1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Niet-recurrente bedrijfskosten |{%=$0+ -1*(#660+#6620+#663+#664__667+#6690) %} |{% if previous_period.exists %}{%=$1+ -1*(#660+#6620+#663+#664__667+#6690):1y %}|{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% endif %}
|
| |Bedrijfsresultaat |{{ $10 | currency }} |{% if previous_period.exists %}{{ $11 | currency }}|{% endif %}
|

|:---10%---|:-------------50%----------------|-----20%------:|---20%---:+{% unless new_mar_date >= '2016' %}
|{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Financiële kosten en opbrengsten |{%=$0+ -1*(#75+#65) %} |{% if previous_period.exists %}{%=$1+ -1*(#75+#65):1y %} |{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Uitzonderlijke kosten en opbrengsten |{%=$0+ -1*(#76+#66) %} |{% if previous_period.exists %}{%=$1+ -1*(#76+#66):1y %}| {% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% endunless %}{% if new_mar %}
|{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Financiële kosten en opbrengsten |{%=$0+ -1*(#75+#65+#761+#7621+#7631+#769+#661+#6621+#6631+#668+#6691) %} |{% if previous_period.exists %}{%=$1+ -1*(#75+#65+#761+#7621+#7631+#769+#661+#6621+#6631+#668+#6691):1y %} |{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% endif %}
|
| |Winst (verlies) van het boekjaar |{{ $10 | currency }} |{% if previous_period.exists %}{{ $11 | currency }}|{% endif %}
|{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Mutatie uitgestelde belastingen|{%=$0+ -1*(#680+#780) %} |{% if previous_period.exists %}{%=$1+ -1*(#680+#780):1y %} |{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Belastingen |{%=$0+ -1*(#67+#77) %} |{% if previous_period.exists %}{%=$1+ -1*(#67+#77):1y %} |{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}{% capture subtabel %}{% assign $0 = 0 %}{% assign $1 = 0 %}
| |Mutatie belastingvrije reserves |{%=$0+ -1*(#689+#789) %} |{% if previous_period.exists %}{%=$1+ -1*(#689+#789):1y %} |{% endif %}{%$10+ $0 %}{%$11+ $1 %}{% endcapture %}{% unless $0 == 0 and $1 == 0 %}{{ subtabel }}{% endunless %}
|
| |Winst (verlies) na belasting |{{ $10 | currency }} |{% if previous_period.exists %}{{ $11 | currency }}|{% endif %}
|

after Passiva, the registers $10 and $11 already contain a certain amount.

For your “Resultatenrekening”, you use them again, but with that certain amount still stored. you see?

If you use following statement just before the “Resultatenrekening”, it will work just fine :

{% assign $10 = 0 %} {% assign $11 = 0 %}

See what that does? It ‘erases’ the stored amount in those registers after the “balans”.

Can you give it a try? Let me know if you’re stuck @Sven.G

Good morning @sven

Thank you very much. It works.

So a ‘$’ is used for a group total? Can we use it in all tables?

Sven

Morning @Sven.G,

A register $ is used to store something of an amount (of an account for instance, but can also be used to store something of an input-field).

For instance :

{%=$0+ #10 | currency %} will display the value of accounts 10 (but the $0 will store that value too

{%=$0+ #13 | currency %} will display the value of accounts 13 (and that value will be added to $0)

So, {{ $0 | currency }} will give me the value of accounts 10+13.

If you wish to calculate further in the template with $0, you can assign it to zero. If you don’t do that, you will add new values to it atop of the value of accounts 10+13.

So yes, you can use it in every table but you have to be sure where it needs to stop. You can work till $39 in Silverfin.

So, if you wish to calculate with new values, you can always use the next register (instead of using the same $0 everywhere).