Beroepskosten met fic beperking - emz,

Hi,

in our template we can see that “Sociale bijdragen” can be split up in “Sociale bijdragen” and “VAPZ”.
We need that for the declaration PB.
But when we print out this template, we cant see the 2 lines anymore. It becomes one amount under “sociale bijdragen code 1632”.
How can i make that we keep seeing the split up between this two lines?

|---------------------|-------15%-------:|-------15%-------:|-------15%-------:+
| {% t "Ontvangsten/Baten" %} {% input custom.detail.omzet as:account_collection range:7 default:'70' accounts_var:omzet %}| | | {%=$10+ -1*omzet.value | currency %}{% for account in omzet %}
|        {{ account.name }}|{{ -1*account.value | currency }}{% endfor %}{% ifi goederen.value != 0 %}
| {% t "Handelsgoederen, grond en hulpstoffen" %} {% input custom.detail.goederen as:account_collection range:60' %}| |{{ -1*goederen.value | currency }}{%
for account in goederen %}
|        {{ account.name }}|{{ -1*account.value | currency }}{% endfor %}
| {% t "Beginvoorraad" %} {% input custom.detail.beginvoorraad as:account_collection range:6,7 accounts_var:beginvoorraad %} {% input custom.beginvoorraad.doc as:file %}| | {{ -1*beginvoorraad.value | currency}}
| {% t "Eindvoorraad" %} {% input custom.detail.eindvoorraad as:account_collection range:6,7 accounts_var:eindvoorraad %} {% input custom.eindvoorraad.doc as:file %}| |_{{ -1*eindvoorraad.value | currency}}_
| {% t "Verkochte goederen" %}|||_{%=$10+ -1*(beginvoorraad.value+goederen.value+eindvoorraad.value) | currency %}_
| {% t "Brutowinst (code 1600)" %}         ||| {{ $10 | currency }}{% endifi %}{% ifi custom.detail.sociale_bijdrage != blank %}
| {% t "Sociale bijdragen (code 1632)" %} {% input custom.detail.sociale_bijdrage as:account_collection range:6 accounts_var:sociale_bijdrage %} || | {%=$10+ -1*sociale_bijdrage.value | currency %}{% endifi %}{% ifi custom.detail.echtgenote != blank %}{%
for account in sociale_bijdrage %}
|         {{ account.name }}|{{ account.value | currency }}{% endfor %}
| {% t "Toekenning meewerkende echtgeno(o)t(e) (code 1611 - 2450)" %} {% input custom.echtgenoot.doc as:file %} | {% input custom.detail.echtgenote as:currency %} | | {%=$10+ -1*custom.detail.echtgenote | currency %} {% endifi %}{% assign bruto_winst = $10 %}
| {% t "Kosten (code 1606)" %}             || |_{% =$10+ $1 %}_
| {% t "Nettoresultaat" %}   ||   | **{{ $10 | currency }}**
|{% fori extra_account in custom.extra_accounts %}
|{% input extra_account.name %} {% input extra_account.accounts as:account_collection range:6,7 %}|{% assign accounts = period.accounts | range:extra_account.accounts %}{%=$20+ -1*accounts.value | currency %}{% endfori %}
|{% t "Investeringsaftrek   (code 1614)" %} | | | {% input custom.detail.investaftrek as:currency %}{% assign investafrek = custom.detail.investaftrek %}{% result 'investaftrek' custom.detail.investaftrek %}

Hi Joyce,

does this code cover the complete template? Cause I’m looking for VAPZ but I couldn’t find it?

Kind regards,

Michiel

Via de # hang ik de rekeningen hier aan.

{% t= "Detail van de kosten" fr:"Détails des frais" %}
{% t= "Beroeps beperking" fr:"Limite professionnelle" %}
{% t= "Fiscale beperking" fr:"Limite fiscale" %}
{% t= "Aftrekbaar" fr:"Déductible" %}
{% t= "Omzet" fr:"Chiffre d'affaires" %}
{% t= "Handelsgoederen" fr:"Marchandises" %}
{% t= "Beginvoorraad" fr:"Stock initial" %}
{% t= "Eindvoorraad" fr:"Stock final" %}
{% t= "Verkochte voorraad" fr:"Stock vendu" %}
{% t= "Brutowinst" fr:"Résultat brute" %}
{% t= "Sociale bijdragen" fr:"Cotisations sociales" %}
{% t= "Toekenning meewerkende echtgeno(o)t(e)" fr:"Octroi époux/-ouse cooperative" %}
{% t= "Kosten" fr:"Frais" %}
{% t= "Nettoresultaat" fr:"Résultat net" %}
{% t= "niet toegewezen bedrag" fr:"comptant non affectués" %}
{% t= "Kosten mbt bedrijfslokalen - 610" fr:"La location et les frais de location" en:"Rent and rental expenses" %}
{% t= "Exploitatiekosten - 611" fr:"L'entretien et les réparation" en:"Maintenance and repair" %}
{% t= "Energiekosten - 612" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Vergoeding aan derden - 613" fr:"Les frais de tiers" en:"Remuneration to third parties" %}
{% t= "Kosten mbt voertuigen - 614"%}
{% t= "Kantoorkosten - 615"%}
{% t= "Notoriteiten - 616"%}
{% t= "Uitzendkrachten - 617"%}
{% t= "Kosten bedrijfsleiders - 618"%}
{% t= "Personeelskosten - 62"%}
{% t= "Afschrijvingen - 63"%}
{% t= "Overige kosten - 64"%}
{% t= "Financiële kosten - 65"%}
{% t= "Andere bedrijfsopbrengsten - 74"%}
{% t= "Financiële opbrengsten - 75"%}
{% t= "Uitzonderlijke kosten - 66"%}
{% t= "Uitzonderlijke opbrengsten - 76"%}
{% t= "Belastingen - 67"%}
{% t= "Totaal" fr:"Le Total" en:"Total" %}
{% t= "Andere bedrijfskosten" fr:"Les Divers" en:"Miscellaneous" %}
{% t= "Extra toelichting" fr:"Explication supplémentaire" en:"Additional explanation" %}
{% t= "Nr." fr:"N°" en:"No." %}
{% t= "Bedrag" fr:"Montant" en:"Amount" %}

{% if cost_categories_string == blank or cost_keys_string == blank %}
{% assign cost_categories_string ="Kosten mbt bedrijfslokalen - 610|Exploitatiekosten - 611|Energiekosten - 612|Vergoeding aan derden - 613|Kosten mbt voertuigen - 614|Kantoorkosten - 615|Notoriteiten - 616|Uitzendkrachten - 617|Kosten bedrijfsleiders - 618|Personeelskosten - 62|Afschrijvingen - 63|Overige kosten - 64|Financiële kosten - 65|Andere bedrijfsopbrengsten - 74|Financiële opbrengsten - 75|Uitzonderlijke kosten - 66|Uitzonderlijke opbrengsten - 76|Belastingen - 67" %}
{% assign cost_keys_string = "lokalen|exploitatie|energie|vergoedingderden|voertuigen|kantoorkosten|notoriteiten|uitzendkrachten|bedrijfsleiders|personeel|Afschrijving|andere|finkost|bedropbr|finopbr|uitzkost|uitzopbrengst|belastingen" %}
{% endif %}

{% assign cost_categories = cost_categories_string | split:"|" %}
{% assign cost_keys = cost_keys_string | split:"|" %}
{% assign $30 = 0 %}


{% capture table %}
-----------------------------------------------------------------------------------------------------------

|-----------40%---------------|---------------15%-----------:|---------------30%-----------:|---------------15%-----------:+
| **{% t "Detail van de kosten" %}**    |**{{ period.year_end_date | date:'%Y' }}**| **{% t "Fiscale beperking" %}**    | **{% t "Aftrekbaar" %}**                      

-----------------------------------------------------------------------------------------------------------

{% for cost_category in cost_categories %}{% assign $11 = 0 %}{% assign $13 = 0 %}{% assign $14 = 0 %}{% assign category_key = cost_keys[forloop.index0] %}
| **{{ cost_category }}** {% input custom[category_key].accounts as:account_collection range:6,7 accounts_var:costs %} |
|-----------40%---------------|---------------15%-----------:|---------------30%-----------:|---------------15%-----------:+{% for account in costs %}
|{{ account.name }}|{%=$11+ -1*account.value %}|{% input custom[account.number].beperking as:percentage %}{% if custom[account.number].beperking == blank %}{% assign beperking = 1 %}{% else %}{% assign beperking = 1-custom[account.number].beperking %}{% endif %}{% $13+ -1*beperking*account.value %}|{%=$14+ -1*beperking*account.value %}{% if forloop.last %}
|     | **{% =$21+ $11 | currency %}** | **{% =$23+ $11-$13 | currency %}** | **{% =$1+ $14 | currency %}**{% result category_key $14 %}
|{% endif %}{% endfor %}{% endfor %}

-----------------------------------------------------------------------------------------------------------

|-----------40%--------------:|---------------15%-----------:|---------------30%-----------:|---------------15%-----------:+
| **{% t "Totaal" %}**                  | **{{ $21 | currency }}** | {{ $23 | currency }}{% result 'verworpen' $23 %} | **{{ $1 | currency }}**


-----------------------------------------------------------------------------------------------------------
{% endcapture %}

{% if custom.detail.goederen == blank %}{% assign goederen_range = '60'%}{% else %}{% assign goederen_range = custom.detail.goederen %}{% endif %}
{% assign goederen = period.accounts | range:goederen_range %}

|---------------------|-------15%-------:|-------15%-------:|-------15%-------:+
| {% t "Ontvangsten/Baten" %} {% input custom.detail.omzet as:account_collection range:7 default:'70' accounts_var:omzet %}| | | {%=$10+ -1*omzet.value | currency %}{% for account in omzet %}
|        {{ account.name }}|{{ -1*account.value | currency }}{% endfor %}{% ifi goederen.value != 0 %}
| {% t "Handelsgoederen, grond en hulpstoffen" %} {% input custom.detail.goederen as:account_collection range:60' %}| |{{ -1*goederen.value | currency }}{%
for account in goederen %}
|        {{ account.name }}|{{ -1*account.value | currency }}{% endfor %}
| {% t "Beginvoorraad" %} {% input custom.detail.beginvoorraad as:account_collection range:6,7 accounts_var:beginvoorraad %} {% input custom.beginvoorraad.doc as:file %}| | {{ -1*beginvoorraad.value | currency}}
| {% t "Eindvoorraad" %} {% input custom.detail.eindvoorraad as:account_collection range:6,7 accounts_var:eindvoorraad %} {% input custom.eindvoorraad.doc as:file %}| |_{{ -1*eindvoorraad.value | currency}}_
| {% t "Verkochte goederen" %}|||_{%=$10+ -1*(beginvoorraad.value+goederen.value+eindvoorraad.value) | currency %}_
| {% t "Brutowinst (code 1600)" %}         ||| {{ $10 | currency }}{% endifi %}{% ifi custom.detail.sociale_bijdrage != blank %}
| {% t "Sociale bijdragen (code 1632)" %} {% input custom.detail.sociale_bijdrage as:account_collection range:6 accounts_var:sociale_bijdrage %} || | {%=$10+ -1*sociale_bijdrage.value | currency %}{% endifi %}{% ifi custom.detail.echtgenote != blank %}{%
for account in sociale_bijdrage %}
|         {{ account.name }}|{{ account.value | currency }}{% endfor %}
| {% t "Toekenning meewerkende echtgeno(o)t(e) (code 1611 - 2450)" %} {% input custom.echtgenoot.doc as:file %} | {% input custom.detail.echtgenote as:currency %} | | {%=$10+ -1*custom.detail.echtgenote | currency %} {% endifi %}{% assign bruto_winst = $10 %}
| {% t "Kosten (code 1606)" %}             || |_{% =$10+ $1 %}_
| {% t "Nettoresultaat" %}   ||   | **{{ $10 | currency }}**
|{% fori extra_account in custom.extra_accounts %}
|{% input extra_account.name %} {% input extra_account.accounts as:account_collection range:6,7 %}|{% assign accounts = period.accounts | range:extra_account.accounts %}{%=$20+ -1*accounts.value | currency %}{% endfori %}
|{% t "Investeringsaftrek   (code 1614)" %} | | | {% input custom.detail.investaftrek as:currency %}{% assign investafrek = custom.detail.investaftrek %}{% result 'investaftrek' custom.detail.investaftrek %}

===p


|{% capture detailmeerminderwaarde %}


-----------------------------------------------------------------------------------------------------------

|-----------40%---------------|---------------15%-----------:|---------------30%-----------:|---------------15%-----------:+
| **{% t "Detail van de meer- en minderwaarden" %}**    |**{{ period.year_end_date | date:'%Y' }}**| **{% t "% Fiscaal beperkt" %}**    | **{% t "Belastbaar" %}** 

{% stripnewlines %}
             
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %} 
{% newline %}


{% newline %}{% ifi custom.meerwaarde.accounts != blank %}
|-----------40%--------------|---------------15%-----------:|---------------30%-----------:|---------------15%-----------:+ 
{% newline %}
| **Meerwaarde**{% input custom.meerwaarde.accounts as:account_collection range:76 accounts_var:meerwaarde %}||||
{% newline %}
  {% for meer in meerwaarde %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ meer.name }}
    | {%=$2+ -1*meer.value | currency %}
    | {% input custom[meer.number].beperking as:percentage placeholder:'0.00%' %}
      {% if custom[meer.number].beperking == blank %}
        {% assign beperking = 1 %}
      {% else %}
        {% assign beperking = 1-custom[meer.number].beperking %}
      {% endif %}
      {% $5+ -1*beperking*meer.value*meer.value as:currency %}
    | {%=$4+ -1*beperking*meer.value as:currency %}
    {% newline %}
  {% endfor %}
  {% newline %}
{% newline %}{% endifi %}


{% newline %}{% ifi custom.minderwaarde.accounts != blank %}

{% newline %}
| **Minderwaarde**{% input custom.minderwaarde.accounts as:account_collection range:66 accounts_var:minderwaarde %}|
{% newline %}
  {% for account in minderwaarde %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.name }}
    | {%=$2+ -1*account.value | currency %}
    | {% input custom[account.number].beperking as:percentage placeholder:'0.00%' %}
      {% if custom[account.number].beperking == blank %}
        {% assign beperking = 1 %}
      {% else %}
        {% assign beperking = 1-custom[account.number].beperking %}
      {% endif %}
      {% $5+ -1*beperking*account.value*account.value as:currency %}
    | {%=$4+ -1*beperking*account.value as:currency %}
    {% newline %}
  {% endfor %}
  {% newline %}{% endifi %}
  
  
{% newline %}                
{% newline %}
{% newline %}                
{% newline %}
{% endstripnewlines %}
|----------40%---------------:|---------------15%-----------:|---------------30%-----------:|---------------15%-----------:+ 
| **{% t "Totaal" %}**                  | **{{ $2 | currency }}** |   | **{{ $4 | currency }}**

-----------------------------------------------------------------------------------------------------------


{% endcapture %}
| {% assign proef= ($10+$23-(-1*custom.detail.echtgenote)) %}
{% ic %}*{% t "proef" %} {{ proef | currency }}*{% endic %}

{% newpage %}

{{ table }}
{% ifi anderebo.value != 0 %}
{{ detailmeerminderwaarde }}{% endifi %}

{% assign niet_toegewezen = #6-#619999+#7+(bruto_winst+$0+$21+$20+$2)-(-1*custom.detail.echtgenote) %}
{% unexplained niet_toegewezen %}

{% ic %}*{% t "niet toegewezen bedrag" %} {{ niet_toegewezen | currency }}*{% endic %}

{% ifi custom.extra.bijlage.document or custom.extra.toelichting != blank %}<br>

{% stripnewlines %}
|------
|------
{% newline %}
| **{% t "Extra toelichting" %}**
| {% input custom.extra.bijlage as:file placeholder:'' %}
{% endstripnewlines %}


{% input custom.extra.toelichting as:text size:mini placeholder:'' %}
{% endifi %}

Hi back there @Joyce_Olivier :wave: glad to see you back!

What I think you mean, is that you want to see the selected accounts from code 1632 right, which are indeed not shown in export.

Let’s dive into that relevant code here:

{% ifi custom.detail.sociale_bijdrage != blank %}
| {% t "Sociale bijdragen (code 1632)" %} {% input custom.detail.sociale_bijdrage as:account_collection range:6 accounts_var:sociale_bijdrage %} || | {%=$10+ -1*sociale_bijdrage.value | currency %}{% endifi %}{% ifi custom.detail.echtgenote != blank %}{%
for account in sociale_bijdrage %}
| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{ account.name }}|{{ account.value | currency }}{% endfor %}
| {% t "Toekenning meewerkende echtgeno(o)t(e) (code 1611 - 2450)" %} {% input custom.echtgenoot.doc as:file %} | {% input custom.detail.echtgenote as:currency %} | | {%=$10+ -1*custom.detail.echtgenote | currency %} {% endifi %} 

Let me clean that a bit up with some additional comments as well, within stripnewlines so you can see it better how the code is structured:

| {% t "Brutowinst (code 1600)" %}         ||| {{ $10 | currency }}{% endifi %}{% stripnewlines %}

{% comment %}ANALYSIS onto why accounts seleceted by the # are not shown in export{% endcomment %}

{% ifi custom.detail.sociale_bijdrage != blank %}
  {% newline %}
  | {% t "Sociale bijdragen (code 1632)" %} 
    {% input custom.detail.sociale_bijdrage as:account_collection range:6 accounts_var:sociale_bijdrage %} {% comment %}in the accounts_var all selected accounts are stored - you will use this later on to loop over and show those accounts{% endcomment %}
  |
  | 
  | {%=$10+ -1*sociale_bijdrage.value | currency %}
{% endifi %}

{% ifi custom.detail.echtgenote != blank %} {% comment %}the ifi-statement is the same as an IF-statement but it only executes in EXPORT mode. So everything between the ifi-tags will be shown ONLY IF the database variable "custom.detail.echtgenote" is filled in{% endcomment %}
  {% for account in sociale_bijdrage %}
    {% newline %}
    | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{ account.name }}|{{ account.value | currency }}
  {% endfor %}
  {% newline %}
  | {% t "Toekenning meewerkende echtgeno(o)t(e) (code 1611 - 2450)" %} 
    {% input custom.echtgenoot.doc as:file %} 
  | {% input custom.detail.echtgenote as:currency %} 
  | 
  | {%=$10+ -1*custom.detail.echtgenote | currency %} 
{% endifi %}{% endstripnewlines %}{% assign bruto_winst = $10 %}

So the reason why your selected accounts are not shown in export, is because the code looping over your selected accounts ONLY will be executed IF the database variable custom.detail.echtgenote is filled in.

So, this in in input mode where I selected the account “Huur gebouwen” (obviously just an example) AND entered a number in the part Toekenning meewerkende echtgeno(o)t(e) (code 1611 - 2450) :

which will give this in export:

Not sure if that is the purpose of it all?

Seems to me the ifi-statement can be left out, as from an accouting standpoint I see no use case in whch why you’d want to show the selected accounts when another input has been filled in? Unless they co-exist maybe?

Let me know if this is okay now @Joyce_Olivier

We need this to be shown, so we can check if the personal declaration is correct .

so if they enter “0” in the “meewerkende echtgenoot”, then it will work?

Or can i change the code so that it is not necessary to enter something in this place? But we do want to see this “meewerkende echtgenoot”, when this is filled in.

And we also want to see the selected accounts in “Sociale bijdragen”.

Agreed, so then you just have to remove the ifi-statement.

And indeed, if you enter “0” it will also work. But that seems a bit of a silly workaround. My suggestion would be to remove the ifi-statement like this:

{% t= "Detail van de kosten" fr:"Détails des frais" %}
{% t= "Beroeps beperking" fr:"Limite professionnelle" %}
{% t= "Fiscale beperking" fr:"Limite fiscale" %}
{% t= "Aftrekbaar" fr:"Déductible" %}
{% t= "Omzet" fr:"Chiffre d'affaires" %}
{% t= "Handelsgoederen" fr:"Marchandises" %}
{% t= "Beginvoorraad" fr:"Stock initial" %}
{% t= "Eindvoorraad" fr:"Stock final" %}
{% t= "Verkochte voorraad" fr:"Stock vendu" %}
{% t= "Brutowinst" fr:"Résultat brute" %}
{% t= "Sociale bijdragen" fr:"Cotisations sociales" %}
{% t= "Toekenning meewerkende echtgeno(o)t(e)" fr:"Octroi époux/-ouse cooperative" %}
{% t= "Kosten" fr:"Frais" %}
{% t= "Nettoresultaat" fr:"Résultat net" %}
{% t= "niet toegewezen bedrag" fr:"comptant non affectués" %}
{% t= "Kosten mbt bedrijfslokalen - 610" fr:"La location et les frais de location" en:"Rent and rental expenses" %}
{% t= "Exploitatiekosten - 611" fr:"L'entretien et les réparation" en:"Maintenance and repair" %}
{% t= "Energiekosten - 612" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Vergoeding aan derden - 613" fr:"Les frais de tiers" en:"Remuneration to third parties" %}
{% t= "Kosten mbt voertuigen - 614"%}
{% t= "Kantoorkosten - 615"%}
{% t= "Notoriteiten - 616"%}
{% t= "Uitzendkrachten - 617"%}
{% t= "Kosten bedrijfsleiders - 618"%}
{% t= "Personeelskosten - 62"%}
{% t= "Afschrijvingen - 63"%}
{% t= "Overige kosten - 64"%}
{% t= "Financiële kosten - 65"%}
{% t= "Andere bedrijfsopbrengsten - 74"%}
{% t= "Financiële opbrengsten - 75"%}
{% t= "Uitzonderlijke kosten - 66"%}
{% t= "Uitzonderlijke opbrengsten - 76"%}
{% t= "Belastingen - 67"%}
{% t= "Totaal" fr:"Le Total" en:"Total" %}
{% t= "Andere bedrijfskosten" fr:"Les Divers" en:"Miscellaneous" %}
{% t= "Extra toelichting" fr:"Explication supplémentaire" en:"Additional explanation" %}
{% t= "Nr." fr:"N°" en:"No." %}
{% t= "Bedrag" fr:"Montant" en:"Amount" %}

{% if cost_categories_string == blank or cost_keys_string == blank %}
{% assign cost_categories_string ="Kosten mbt bedrijfslokalen - 610|Exploitatiekosten - 611|Energiekosten - 612|Vergoeding aan derden - 613|Kosten mbt voertuigen - 614|Kantoorkosten - 615|Notoriteiten - 616|Uitzendkrachten - 617|Kosten bedrijfsleiders - 618|Personeelskosten - 62|Afschrijvingen - 63|Overige kosten - 64|Financiële kosten - 65|Andere bedrijfsopbrengsten - 74|Financiële opbrengsten - 75|Uitzonderlijke kosten - 66|Uitzonderlijke opbrengsten - 76|Belastingen - 67" %}
{% assign cost_keys_string = "lokalen|exploitatie|energie|vergoedingderden|voertuigen|kantoorkosten|notoriteiten|uitzendkrachten|bedrijfsleiders|personeel|Afschrijving|andere|finkost|bedropbr|finopbr|uitzkost|uitzopbrengst|belastingen" %}
{% endif %}

{% assign cost_categories = cost_categories_string | split:"|" %}
{% assign cost_keys = cost_keys_string | split:"|" %}
{% assign $30 = 0 %}


{% capture table %}
-----------------------------------------------------------------------------------------------------------

|-----------40%---------------|---------------15%-----------:|---------------30%-----------:|---------------15%-----------:+
| **{% t "Detail van de kosten" %}**    |**{{ period.year_end_date | date:'%Y' }}**| **{% t "Fiscale beperking" %}**    | **{% t "Aftrekbaar" %}**                      

-----------------------------------------------------------------------------------------------------------

{% for cost_category in cost_categories %}{% assign $11 = 0 %}{% assign $13 = 0 %}{% assign $14 = 0 %}{% assign category_key = cost_keys[forloop.index0] %}
| **{{ cost_category }}** {% input custom[category_key].accounts as:account_collection range:6,7 accounts_var:costs %} |
|-----------40%---------------|---------------15%-----------:|---------------30%-----------:|---------------15%-----------:+{% for account in costs %}
|{{ account.name }}|{%=$11+ -1*account.value %}|{% input custom[account.number].beperking as:percentage %}{% if custom[account.number].beperking == blank %}{% assign beperking = 1 %}{% else %}{% assign beperking = 1-custom[account.number].beperking %}{% endif %}{% $13+ -1*beperking*account.value %}|{%=$14+ -1*beperking*account.value %}{% if forloop.last %}
|     | **{% =$21+ $11 | currency %}** | **{% =$23+ $11-$13 | currency %}** | **{% =$1+ $14 | currency %}**{% result category_key $14 %}
|{% endif %}{% endfor %}{% endfor %}

-----------------------------------------------------------------------------------------------------------

|-----------40%--------------:|---------------15%-----------:|---------------30%-----------:|---------------15%-----------:+
| **{% t "Totaal" %}**                  | **{{ $21 | currency }}** | {{ $23 | currency }}{% result 'verworpen' $23 %} | **{{ $1 | currency }}**


-----------------------------------------------------------------------------------------------------------
{% endcapture %}

{% if custom.detail.goederen == blank %}{% assign goederen_range = '60'%}{% else %}{% assign goederen_range = custom.detail.goederen %}{% endif %}
{% assign goederen = period.accounts | range:goederen_range %}

|---------------------|-------15%-------:|-------15%-------:|-------15%-------:+
| {% t "Ontvangsten/Baten" %} {% input custom.detail.omzet as:account_collection range:7 default:'70' accounts_var:omzet %}| | | {%=$10+ -1*omzet.value | currency %}{% for account in omzet %}
| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}{% endfor %}{% ifi goederen.value != 0 %}
| {% t "Handelsgoederen, grond en hulpstoffen" %} {% input custom.detail.goederen as:account_collection range:60' %}| |{{ -1*goederen.value | currency }}{%
for account in goederen %}
| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}{% endfor %}
| {% t "Beginvoorraad" %} {% input custom.detail.beginvoorraad as:account_collection range:6,7 accounts_var:beginvoorraad %} {% input custom.beginvoorraad.doc as:file %}| | {{ -1*beginvoorraad.value | currency}}
| {% t "Eindvoorraad" %} {% input custom.detail.eindvoorraad as:account_collection range:6,7 accounts_var:eindvoorraad %} {% input custom.eindvoorraad.doc as:file %}| |_{{ -1*eindvoorraad.value | currency}}_
| {% t "Verkochte goederen" %}|||_{%=$10+ -1*(beginvoorraad.value+goederen.value+eindvoorraad.value) | currency %}_
| {% t "Brutowinst (code 1600)" %}         ||| {{ $10 | currency }}{% endifi %}{% stripnewlines %}

{% ifi custom.detail.sociale_bijdrage != blank %}
  {% newline %}
  | {% t "Sociale bijdragen (code 1632)" %} 
    {% input custom.detail.sociale_bijdrage as:account_collection range:6 accounts_var:sociale_bijdrage %} {% comment %}in the accounts_var all selected accounts are stored - you will use this later on to loop over and show those accounts{% endcomment %}
  |
  | 
  | {%=$10+ -1*sociale_bijdrage.value | currency %}
{% endifi %}

{% for account in sociale_bijdrage %}
  {% newline %}
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{ account.name }}|{{ account.value | currency }}
{% endfor %}
{% newline %}
| {% t "Toekenning meewerkende echtgeno(o)t(e) (code 1611 - 2450)" %} 
  {% input custom.echtgenoot.doc as:file %} 
| {% input custom.detail.echtgenote as:currency %} 
| 
| {%=$10+ -1*custom.detail.echtgenote | currency %} 

{% endstripnewlines %}{% assign bruto_winst = $10 %}
| {% t "Kosten (code 1606)" %}             || |_{% =$10+ $1 %}_
| {% t "Nettoresultaat" %}   ||   | **{{ $10 | currency }}**
|{% fori extra_account in custom.extra_accounts %}
|{% input extra_account.name %} {% input extra_account.accounts as:account_collection range:6,7 %}|{% assign accounts = period.accounts | range:extra_account.accounts %}{%=$20+ -1*accounts.value | currency %}{% endfori %}
|{% t "Investeringsaftrek   (code 1614)" %} | | | {% input custom.detail.investaftrek as:currency %}{% assign investafrek = custom.detail.investaftrek %}{% result 'investaftrek' custom.detail.investaftrek %}

===p


|{% capture detailmeerminderwaarde %}


-----------------------------------------------------------------------------------------------------------

|-----------40%---------------|---------------15%-----------:|---------------30%-----------:|---------------15%-----------:+
| **{% t "Detail van de meer- en minderwaarden" %}**    |**{{ period.year_end_date | date:'%Y' }}**| **{% t "% Fiscaal beperkt" %}**    | **{% t "Belastbaar" %}** 

{% stripnewlines %}
             
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %} 
{% newline %}


{% newline %}{% ifi custom.meerwaarde.accounts != blank %}
|-----------40%--------------|---------------15%-----------:|---------------30%-----------:|---------------15%-----------:+ 
{% newline %}
| **Meerwaarde**{% input custom.meerwaarde.accounts as:account_collection range:76 accounts_var:meerwaarde %}||||
{% newline %}
  {% for meer in meerwaarde %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ meer.name }}
    | {%=$2+ -1*meer.value | currency %}
    | {% input custom[meer.number].beperking as:percentage placeholder:'0.00%' %}
      {% if custom[meer.number].beperking == blank %}
        {% assign beperking = 1 %}
      {% else %}
        {% assign beperking = 1-custom[meer.number].beperking %}
      {% endif %}
      {% $5+ -1*beperking*meer.value*meer.value as:currency %}
    | {%=$4+ -1*beperking*meer.value as:currency %}
    {% newline %}
  {% endfor %}
  {% newline %}
{% newline %}{% endifi %}


{% newline %}{% ifi custom.minderwaarde.accounts != blank %}

{% newline %}
| **Minderwaarde**{% input custom.minderwaarde.accounts as:account_collection range:66 accounts_var:minderwaarde %}|
{% newline %}
  {% for account in minderwaarde %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.name }}
    | {%=$2+ -1*account.value | currency %}
    | {% input custom[account.number].beperking as:percentage placeholder:'0.00%' %}
      {% if custom[account.number].beperking == blank %}
        {% assign beperking = 1 %}
      {% else %}
        {% assign beperking = 1-custom[account.number].beperking %}
      {% endif %}
      {% $5+ -1*beperking*account.value*account.value as:currency %}
    | {%=$4+ -1*beperking*account.value as:currency %}
    {% newline %}
  {% endfor %}
  {% newline %}{% endifi %}
  
  
{% newline %}                
{% newline %}
{% newline %}                
{% newline %}
{% endstripnewlines %}
|----------40%---------------:|---------------15%-----------:|---------------30%-----------:|---------------15%-----------:+ 
| **{% t "Totaal" %}**                  | **{{ $2 | currency }}** |   | **{{ $4 | currency }}**

-----------------------------------------------------------------------------------------------------------


{% endcapture %}
| {% assign proef= ($10+$23-(-1*custom.detail.echtgenote)) %}
{% ic %}*{% t "proef" %} {{ proef | currency }}*{% endic %}

{% newpage %}

{{ table }}
{% ifi anderebo.value != 0 %}
{{ detailmeerminderwaarde }}{% endifi %}

{% assign niet_toegewezen = #6-#619999+#7+(bruto_winst+$0+$21+$20+$2)-(-1*custom.detail.echtgenote) %}
{% unexplained niet_toegewezen %}

{% ic %}*{% t "niet toegewezen bedrag" %} {{ niet_toegewezen | currency }}*{% endic %}

{% ifi custom.extra.bijlage.document or custom.extra.toelichting != blank %}<br>

{% stripnewlines %}
|------
|------
{% newline %}
| **{% t "Extra toelichting" %}**
| {% input custom.extra.bijlage as:file placeholder:'' %}
{% endstripnewlines %}


{% input custom.extra.toelichting as:text size:mini placeholder:'' %}
{% endifi %} 

Big problem,

when i use the code above, i get this…:

oké now i solved the problem of the table.
but now the allignement is still not nice

image.png

Hi Joyce,

I would suggest that you use stripnewlines around every table, cause every new line you start now means an extra row in your table and this is mixing up your tables.

so this

|---------------------|-------15%-------:|-------15%-------:|-------15%-------:+
| {% t "Ontvangsten/Baten" %} {% input custom.detail.omzet as:account_collection range:7 default:'70' accounts_var:omzet %}| | | {%=$10+ -1*omzet.value | currency %}{% for account in omzet %}

| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}{% endfor %}{% ifi goederen.value != 0 %}

| {% t "Handelsgoederen, grond en hulpstoffen" %} {% input custom.detail.goederen as:account_collection range:60' %}| |{{ -1*goederen.value | currency }}{%

for account in goederen %}

| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}{% endfor %}

| {% t "Beginvoorraad" %} {% input custom.detail.beginvoorraad as:account_collection range:6,7 accounts_var:beginvoorraad %} {% input custom.beginvoorraad.doc as:file %}| | {{ -1*beginvoorraad.value | currency}}

| {% t "Eindvoorraad" %} {% input custom.detail.eindvoorraad as:account_collection range:6,7 accounts_var:eindvoorraad %} {% input custom.eindvoorraad.doc as:file %}| |_{{ -1*eindvoorraad.value | currency}}_

| {% t "Verkochte goederen" %}|||_{%=$10+ -1*(beginvoorraad.value+goederen.value+eindvoorraad.value) | currency %}_

| {% t "Brutowinst (code 1600)" %}         ||| {{ $10 | currency }}{% endifi %}

would become this

{% stripnewlines %}
|---------------------|-------15%-------:|-------15%-------:|-------15%-------:+{% newline %}
| {% t "Ontvangsten/Baten" %} {% input custom.detail.omzet as:account_collection range:7 default:'70' accounts_var:omzet %}| | | {%=$10+ -1*omzet.value | currency %}{% newline %}
{% for account in omzet %}
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}{% newline %}
{% endfor %}
{% ifi goederen.value != 0 %}
  | {% t "Handelsgoederen, grond en hulpstoffen" %} {% input custom.detail.goederen as:account_collection range:60' %}| |{{ -1*goederen.value | currency }}{% newline %}
  {% for account in goederen %}
    | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}{% newline %}
  {% endfor %}
  | {% t "Beginvoorraad" %} {% input custom.detail.beginvoorraad as:account_collection range:6,7 accounts_var:beginvoorraad %} {% input custom.beginvoorraad.doc as:file %}| | {{ -1*beginvoorraad.value | currency}}{% newline %}
  | {% t "Eindvoorraad" %} {% input custom.detail.eindvoorraad as:account_collection range:6,7 accounts_var:eindvoorraad %} {% input custom.eindvoorraad.doc as:file %}| |_{{ -1*eindvoorraad.value | currency}}_{% newline %}
  | {% t "Verkochte goederen" %}|||_{%=$10+ -1*(beginvoorraad.value+goederen.value+eindvoorraad.value) | currency %}_{% newline %}
  | {% t "Brutowinst (code 1600)" %}         ||| {{ $10 | currency }}{% newline %}
{% endifi %}
{% endstripnewlines %}

If you apply this for all your tables it should be fine.

Regards,

Michiel