Beroepskosten - reconciliation

I used this code… but is my ifi statement correctly placed ?

{% if custom[category_key].value != blank %}
{% assign cat_range = custom[category_key].accounts %}
{% assign cat_accounts = period.accounts | range:cat_range %}
{% else %}
{% assign cat_range = category_default %}
{% assign cat_accounts = period.accounts | range:cat_range %}
{% endif %}
{% ifi cat_accounts.value != 0 or cat_accounts != empty %}

That should be working fine if it’s related to that part of code… Are you sure there are no other logic-statements in there as well? @Andrew

This is everything above the code …

Have i done something wrong here ?

{% if cost_categories_string == blank or cost_keys_string == blank %}
  {% assign cost_categories_string = "Huur en huurlasten|Onderhoud en herstellingen|Nutsvoorzieningen|Telefoon en communicatie|Bureaubenodigdheden|Verzekeringen|Commissies en erelonen|Kosten rollend materieel|Klein materiaal|Publiciteit|Sociale bijdragen en VAPZ|Personeelskost|Afschrijvingen|Andere bedrijfskosten|Financiele kosten|Uitzonderlijke kosten" %}
  {% assign cost_keys_string = "Huurenhuurlasten|Onderhoudenherstellingen|Nutsvoorzieningen|Telefoonencommunicatie|Bureaubenodigdheden|Verzekeringen|Commissiesenerelonen|Kostenrollendmaterieel|Kleinmateriaal|Publiciteit|Sociale bijdragen|Personeelskost|Afschrijvingen|Anderebedrijfskosten|Financielekosten|Uitzonderlijkekosten" %}
  {% assign cost_default_string = "610100,610110,610120,610150,610200|610600,610610,610700,610710|611500,611600,611700|616200,616210,616300|611000,611050,611100,612001|613000,613100,613600,613700,613710,613800,613900,613910|615|610800,610840,610900,612500,612510,612540,612600,612610,613400,613420,640200,640220,640300|611200|616400,616600,616630,616640,616650,616651,616680|618010,618200,618300|62|63|616700,640400,640500,640600,640610,640700,644000|65|66" %}
{% endif %}

{% assign cost_categories = cost_categories_string | split:"|" %}
{% assign cost_keys = cost_keys_string | split:"|" %}
{% assign cost_default = cost_default_string | split:"|" %}


{% assign toegewezen = "" %}
{% assign count = 0 %}

{% capture header %}|-----------40%---------------|---------------12%-----------:|---------------12%-----------:|---------------12%-----------:|---------------12%-----------:|---------------12%-----------:+{% endcapture %}

{% capture detailkosten %}

|-------#+385073
|{% nic %}**<font color="ffffff">{% endnic %} Detail van de kosten {% nic %}</font>**{% endnic %}


{% stripnewlines %} 
{{ header }}
{% newline %}
|    
| **{% t "Bruto" %}**
| **{% t "Beroeps-<br />beperking" %}**
| **{% t "Fiscale beperking" %}**
| **{% t "Totale beperking" %}**    
| **{% t "Aftrekbaar" %}**                      
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% for cost_category in cost_categories %}
  {% assign $7 = 0 %} 
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
  {% assign $14 = 0 %}
  {% assign $15 = 0 %}
  {% assign category_key = cost_keys[forloop.index0] %}  
  {% assign category_default = cost_default[forloop.index0] %}
  
    {% if custom[category_key].value != blank %}
      {% assign cat_range = custom[category_key].accounts %}
      {% assign cat_accounts = period.accounts | range:cat_range %}
  {% else %}  
      {% assign cat_range = category_default %}
      {% assign cat_accounts = period.accounts | range:cat_range %}
    {% endif %}
    {% ifi cat_accounts.value != 0 or cat_accounts != empty %}

Think it’s better to paste the whole code, if you don’t mind @Andrew? Otherwise I have to add some things and it’s better to work on your code…

Hello Sven,

i replaced it by following code and it works fine now. Thx for the help!

{% assign category_key = cost_keys[forloop.index0] %}
{% ifi custom[category_key].accounts != blank %}

Good one @Andrew; was the issue of the other topic as well, if I’m not mistaken

Problem i’m facing now after changing the code is that i’ve now lost the automatic generation of my accounts in the cost_default_string. All my accounts are in ‘nog toe te wijzen’. Any suggestion how to fix or combine both codes ?

Thx in advance !

Hi Andrew

Unfortunately, we can’t help you any further if we don’t have the entire code. From the code you gave us know, we can’t see what is wrong. Could you post the rest of your code too?

Also, for your interest, within the next weeks/months, this silverfin template will be adjusted so that default ranges can be added to configuration too. This might solve all of your problems at once.

Kind regards

Sam

Hey Sven,

can you also help me out with this ?

I’ve already asked you this for the fiscal limitations for the costs. This works fine. But some revenue also can have a fiscal limitation (meerwaardes,…) . How do you create create a key here ? Is this simular with the costs ?

I’d like to use the key of {{ $31-$33 | currency }} in the reports.

This is my code with the diverse bedrijfsopbrengsten.

| **Andere bedrijfsopbrengsten** {% input custom.anderebo.accounts as:account_collection range:740,742,743,744,745,746,747,748,749 default:740,742,743,744,745,746,747,748,749 accounts_var:anderebo %}|||||
{% newline %}
  {% for account in anderebo %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.number }} {{ account.name }}
    | {%=$31+ account.value*-1 as:currency %}
    | {% input custom[account.number].vin as:percentage placeholder:'0.00%' %}
        {% if custom[account.number].vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-custom[account.number].vin placeholder:'' %}
        {% endif %}
        {% $32+ -1*vin*account.value as: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 %}
      {% $35+ -1*vin*beperking*account.value-(1-vin)*account.value as:currency %}
    | {{ account.value-1*vin*beperking*account.value | currency }}
      {% $33+ -1*vin*beperking*account.value as:currency %}
    | {%=$34+ -1*vin*beperking*account.value as:currency %}
    {% newline %}
  {% endfor %}
  {% newline %}
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

{{ header }}
| **{% t "Totaal" %}**                  | **{{ $31 | currency }}** | **{{ $31-$32 | currency }}** | **{{ $31-$35 | currency }}** | **{{ $31-$33 | currency }}**  | **{{ $34 | currency }}**

Hello @Andrew,

If {{ $31-$33 | currency }} is what you need in a report, you can assign the value of this into a result-tag:


{% result 'revenue' $31-$33 %}

You can link to that result-tag in a report then.

However, if this revenue is part of a loop through an array (like the costs), then you’ll need to create a key for each loop like you did with the costs, and use that unique key as a result-tag.

Thx Sveb.

Is the place of my result-tag ok ?

In my report i added in my formula: reconciliations.beroepskostencpj.results.revenue

Does this has to work ?

{% newline %}
  {% for account in anderebo %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.number }} {{ account.name }}
    | {%=$31+ account.value*-1 as:currency %}
    | {% input custom[account.number].vin as:percentage placeholder:'0.00%' %}
        {% if custom[account.number].vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-custom[account.number].vin placeholder:'' %}
        {% endif %}
        {% $32+ -1*vin*account.value as: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 %}
      {% $35+ -1*vin*beperking*account.value-(1-vin)*account.value as:currency %}
    | {{ account.value-1*vin*beperking*account.value | currency }}
      {% $33+ -1*vin*beperking*account.value as:currency %}
    | {%=$34+ -1*vin*beperking*account.value as:currency %}
    {% result 'revenue' $31-$33 %}
    {% newline %}
  {% endfor %}
  {% newline %}
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

{{ header }}
| **{% t "Totaal" %}**                  | **{{ $31 | currency }}** | **{{ $31-$32 | currency }}** | **{{ $31-$35 | currency }}** | **{{ $31-$33 | currency }}**  | **{{ $34 | currency }}**```

@Andrew,

Do you need a result-tag for each account in the revenue-section, or only the total of each column for that section?

Just the total of that section.

Another question concerning the total of my fiscale en beroepsbeperkingen. I created a report voor de eenmanszaken per kwartaal. See image. Problem with this report is the total of my privé and fiscale beperking/kwartaal. The totals that are shown are taken from the reconcilliation from every Q at that moment. But per Q there isn’t a correction from the totals from the Q before, so the total per Q isn’t correct. It’s always counted double. Is their a solution for this, because I asked this already in the chat a while ago but at the moment I still didn’t got an answer to this, so we can’t use this report for the moment. Do you have an idea ? Maybe with a formula ?

Thx!

For the total of the section “revenue”, I’d suggest adding it outside your fori-loop @Andrew, and it should work.

For your other question: you can always escalate again through the original chat, because it’s an issue that has to be solved in the background. Nothing I can suggest as a workaround for now I’m afraid. It’s an issue in reports; not directly related to Liquid-code even.

In my reconcilliation-template i’ve done this (out-side the fori-loop) - but isn’t working for the moment. Do you have idea ? Thx !

In my report I added this formula:


|-------#+385073
|{% nic %}**<font color="ffffff">{% endnic %} Detail van de andere bedrijfsopbrengsten {% nic %}</font>**{% endnic %}

{% stripnewlines %}
{{ header }}
{% newline %}
|    
| **{% t "Bruto" %}**
| **{% t "Beroeps-<br />beperking" %}**
| **{% t "Fiscale beperking" %}**
| **{% t "Totale beperking" %}**    
| **{% t "Belast" %}**                      
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %} 
{% newline %}

{% newline %}
{{ header }}
{% newline %}
| **Andere bedrijfsopbrengsten** {% input custom.anderebo.accounts as:account_collection range:740,742,743,744,745,746,747,748,749 default:740,742,743,744,745,746,747,748,749 accounts_var:anderebo %}|||||
{% newline %}
  {% for account in anderebo %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.number }} {{ account.name }}
    | {%=$31+ account.value*-1 as:currency %}
    | {% input custom[account.number].vin as:percentage placeholder:'0.00%' %}
        {% if custom[account.number].vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-custom[account.number].vin placeholder:'' %}
        {% endif %}
        {% $32+ -1*vin*account.value as: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 %}
      {% $35+ -1*vin*beperking*account.value-(1-vin)*account.value as:currency %}
    | {{ account.value-1*vin*beperking*account.value | currency }}
      {% $33+ -1*vin*beperking*account.value as:currency %}
    | {%=$34+ -1*vin*beperking*account.value as:currency %}
    {% newline %}
  {% endfor %}
  {% result 'revenue' $31-$33 %}
  {% newline %}
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

{{ header }}
| **{% t "Totaal" %}**                  | **{{ $31 | currency }}** | **{{ $31-$32 | currency }}** | **{{ $31-$35 | currency }}** | **{{ $31-$33 | currency }}**  | **{{ $34 | currency }}**

Hey @Andrew,

It should work indeed. Only thing I could think off right now, is that you added the recon-template more than once in the working papers, and that one of them is not filled (with the result) and the report is linked to that.

Here is some more information regarding handles and such, and what to be aware off:

Could you double check?

A good test might be to create a empty text-template in a file and check the result:

{{ period.reconciliations.beroepskostencpj.results.revenue }} 

If this works, it might be a typo, or if it doesn’t work, it’s because the recon-template exists more than once in a file. Or you use different templates but all with the same handle (each recon template should have an unique handle - see above case).

Keep us updated please

Thx Sven! It works.

Final question. Our beroepskosten works fine.

I’m just having a problem with my export. Everything is exported fine, but i’m just facing problems with the export of my meerwaarden. It’s not coming out of my export. If their is, just the header is shown, but not the amounts.

Could you have a look ?

Here my entire code:

{% t= "Beroeps-<br />beperking" fr:"La limite professionnelle" en:"Occupational disability" %}
{% t= "Fiscale beperking" fr:"La limite fiscale" en:"Fiscal limitation" %}
{% t= "Totale beperking" fr:"La limite totale" en:"Total limitation" %}
{% t= "Aftrekbaar" fr:"Déductible" en:"Deductible" %}
{% t= "Niet aftrekbaar" fr:"Non déductible" en:"Not deductible" %}
{% t= "Ontvangsten/Baten" fr:"Le chiffre d'affaires" en:"Revenues" %}
{% t= "Andere bedrijfsopbrengsten" %}
{% t= "Beginvoorraad" fr:"Le stock initial" en:"Initial stock" %}
{% t= "Eindvoorraad" fr:"Le stock final" en:"Final stock" %}
{% t= "Verkochte voorraad" fr:"Le stock vendu" en:"Stock sold" %}
{% t= "Brutowinst" fr:"Le résultat brut" en:"Gross profit" %}
{% t= "Sociale bijdragen" fr:"Les cotisations sociales" en:"social contributions" %}
{% t= "Toekenning meewerkende echtgeno(o)t(e)" fr:"L'Octroi époux/-ouse cooperative" en:"Allocation helping spous" %}
{% t= "Kosten" fr:"Les frais" en:"costs" %}
{% t= "Nettoresultaat" fr:"Le résultat net" en:"Net result" %}
{% t= "Niet toegewezen bedrag" fr:"Le montant non affectués" en:"Unassigned amount" %}
{% t= "Alle rekeningen zijn opgenomen" fr:"Tous des comptes sont inclus" en:"All accounts are selected" %}
{% t= "Eén of meerdere rekeningen werden meermaals toegewezen" fr:"Un ou plusieurs comptes ont été attribués plusieurs fois" en:"One or more accounts were selected more than once" %}
{% t= "Niet alle rekeningen zijn opgenomen" fr:"Tous les comptes ne sont pas inclus" en:"Not all accounts are selected" %}
{% t= "Handelsgoederen, grond en hulpstoffen" fr:"Les marchandises, matières premières et matières consommables" en:"Goods for resale, raw materials and additives" %}
{% t= "Verkochte goederen" fr:"Les biens vendus" en:"Sold goods" %}
{% t= "Huur en huurlasten" fr:"La location et les frais de location" en:"Rent and rental expenses" %}
{% t= "Onderhoud en herstellingen" fr:"L'entretien et les réparation" en:"Maintenance and repair" %}
{% t= "Nutsvoorzieningen" %}
{% t= "Bureaubenodigdheden" %}
{% t= "Verzekeringen" %}
{% t= "Commissies en erelonen" %}
{% t= "Verplaatsingskosten" %}
{% t= "Klein materiaal" %}
{% t= "Publiciteit" %}
{% t= "Andere bedrijfskosten" %}
{% t= "Personeelskosten" %}
{% t= "Afschrijvingen en waardeverminderingen" %}
{% t= "Financiële kosten" %}
{% t= "Totaal" fr:"Le Total" en:"Total" %}
{% t= "Divers" 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 = "Huur en huurlasten|Onderhoud en herstellingen|Nutsvoorzieningen|Telefoon en communicatie|Bureaubenodigdheden|Verzekeringen|Commissies en erelonen|Kosten rollend materieel|Klein materiaal|Publiciteit|Sociale bijdragen en VAPZ|Personeelskost|Afschrijvingen|Andere bedrijfskosten|Financiele kosten|Uitzonderlijke kosten" %}
  {% assign cost_keys_string = "Huurenhuurlasten|Onderhoudenherstellingen|Nutsvoorzieningen|Telefoonencommunicatie|Bureaubenodigdheden|Verzekeringen|Commissiesenerelonen|Kostenrollendmaterieel|Kleinmateriaal|Publiciteit|Sociale bijdragen|Personeelskost|Afschrijvingen|Anderebedrijfskosten|Financielekosten|Uitzonderlijkekosten" %}
  {% assign cost_default_string = "610100,610110,610120,610150,610200|610600,610610,610700,610710|611500,611600,611700|616200,616210,616300|611000,611050,611100,612001|613000,613100,613600,613700,613710,613800,613900,613910|615|610800,610840,610900,612500,612510,612540,612600,612610,613400,613420,640200,640220,640300,640800|611200|616400,616600,616620,616630,616640,616650,616651,616680|618010,618200,618300|62|63|616700,640400,640500,640600,640610,640700,645000,644000|65|66" %}
{% endif %}

{% assign cost_categories = cost_categories_string | split:"|" %}
{% assign cost_keys = cost_keys_string | split:"|" %}
{% assign cost_default = cost_default_string | split:"|" %}


{% assign toegewezen = "" %}
{% assign count = 0 %}

{% capture header %}|-----------40%---------------|---------------12%-----------:|---------------12%-----------:|---------------12%-----------:|---------------12%-----------:|---------------12%-----------:+{% endcapture %}

{% capture detailkosten %}

|-------#+385073
|{% nic %}**<font color="ffffff">{% endnic %} Detail van de kosten {% nic %}</font>**{% endnic %}


{% stripnewlines %} 
{{ header }}
{% newline %}
|    
| **{% t "Bruto" %}**
| **{% t "Beroeps-<br />beperking" %}**
| **{% t "Fiscale beperking" %}**
| **{% t "Totale beperking" %}**    
| **{% t "Aftrekbaar" %}**                      
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% for cost_category in cost_categories %}
  {% assign $7 = 0 %} 
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
  {% assign $14 = 0 %}
  {% assign $15 = 0 %}
  {% assign category_key = cost_keys[forloop.index0] %}  
  {% assign category_default = cost_default[forloop.index0] %}
  
  {%if custom[category_key].accounts != blank %}
    {% assign cat_range = custom[category_key].accounts %}
    {% assign cat_accounts = period.accounts | range:cat_range %}
  {% else %}  
    {% assign cat_range = category_default %}
    {% assign cat_accounts = period.accounts | range:cat_range %}
  {% endif %}
  {% ifi cat_accounts.value != 0 or cat_accounts != empty %}

{% newline %}
    {% newline %}
  {{ header }}
  {% newline %}
  | **{% t cost_category %}** {% input custom[category_key].accounts as:account_collection range:6,7 default:category_default accounts_var:costs %} |||||
  {% newline %}
  {% for account in costs %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.number }} {{ account.name }}
    | {%=$11+ -1*account.value as:currency %}
    | {% input custom[account.number].vin as:percentage placeholder:'0.00%' %}
        {% if custom[account.number].vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-custom[account.number].vin placeholder:'' %}
        {% endif %}
        {% $12+ -1*vin*account.value as:currency %}
    | {% $7+input custom[account.number].beperking as:percentage placeholder:'0.00%' default:perc_key %}
      {% if custom[account.number].beperking == blank %}
        {% assign beperking = 1 %}
      {% else %}
        {% assign beperking = 1-custom[account.number].beperking %}
      {% endif %}
      {% $15+ -1*vin*beperking*account.value-(1-vin)*account.value as:currency %}
    | {{ account.value-1*vin*beperking*account.value | currency }}
      {% $13+ -1*vin*beperking*account.value as:currency %}
    | {%=$14+ -1*vin*beperking*account.value as:currency %}
    {% newline %}
    {% if forloop.last %}
      |     
      | **{% =$21+ $11 as:currency %}** 
      | **{% =$22+ $11-$12 as:currency %}** 
      | **{% =$25+ $11-$15 as:currency %}** 
      | **{% =$23+ $11-$13 as:currency %}** 
      | **{% =$1+ $14 as:currency %}**
      {% capture fiscal_key %}{{ category_key }}_fisc{% endcapture %}
      {% result fiscal_key $11-$13 %}
      
      {% result category_key $14 %}|
    {% newline %}
    {% endif %}
  {% endfor %}
  {% endifi %}
  {% newline %}
{% endfor %}
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

{{ header }}
| **{% t "Totaal" %}**                  | **{{ $21 | currency }}** | {{ $22 | currency }} | {{ $25 | currency }} | {{ $23 | currency }} | **{{ $1 | currency }}**

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

{% endcapture %}



{% capture detailanderebo %}

|-------#+385073
|{% nic %}**<font color="ffffff">{% endnic %} Detail van de andere bedrijfsopbrengsten {% nic %}</font>**{% endnic %}

{% stripnewlines %}
{{ header }}
{% newline %}
|    
| **{% t "Bruto" %}**
| **{% t "Beroeps-<br />beperking" %}**
| **{% t "Fiscale beperking" %}**
| **{% t "Totale beperking" %}**    
| **{% t "Belast" %}**                      
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %} 
{% newline %}

{% newline %}
{{ header }}
{% newline %}
| **Andere bedrijfsopbrengsten** {% input custom.anderebo.accounts as:account_collection range:740,742,743,744,745,746,747,748,749 default:740,742,743,744,745,746,747,748,749 accounts_var:anderebo %}|||||
{% newline %}
  {% for account in anderebo %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.number }} {{ account.name }}
    | {%=$31+ account.value*-1 as:currency %}
    | {% input custom[account.number].vin as:percentage placeholder:'0.00%' %}
        {% if custom[account.number].vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-custom[account.number].vin placeholder:'' %}
        {% endif %}
        {% $32+ -1*vin*account.value as: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 %}
      {% $35+ -1*vin*beperking*account.value-(1-vin)*account.value as:currency %}
    | {{ account.value-1*vin*beperking*account.value | currency }}
      {% $33+ -1*vin*beperking*account.value as:currency %}
    | {%=$34+ -1*vin*beperking*account.value as:currency %}
    {% newline %}
  {% endfor %}
  {% result 'anderebo_beperking' $31-$33 %}
  {% newline %}
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

{{ header }}
| **{% t "Totaal" %}**                  | **{{ $31 | currency }}** | **{{ $31-$32 | currency }}** | **{{ $31-$35 | currency }}** | **{{ $31-$33 | currency }}**  | **{{ $34 | currency }}**

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



{% endcapture %}





{% capture detailmeerwaarde %}


|-------#+385073
|{% nic %}**<font color="ffffff">{% endnic %} Detail van de meerwaarden {% nic %}</font>**{% endnic %}

{% stripnewlines %}
{{ header }}
{% newline %}
|    
| **{% t "Bruto" %}**
| **{% t "Beroeps-<br />beperking" %}**
| **{% t "Fiscale beperking" %}**
| **{% t "Totale beperking" %}**    
| **{% t "Belast" %}**                      
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %} 
{% newline %}

  
{% newline %}{% ifi custom.meerwaarde.accounts != blank %}
{{ header }}
{% newline %}
| **Meerwaarde**{% input custom.meerwaarde.accounts as:account_collection range:741 default:741 accounts_var:meerwaarde %}|||||
{% newline %}
  {% for meer in meerwaarde %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ meer.number }} {{ meer.name }}
    | {%=$2+ -1*meer.value | currency %}
    | {% input custom[meer.number].vin as:percentage placeholder:'0.00%' %}
        {% if custom[meer.number].vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-custom[meer.number].vin placeholder:'' %}
        {% endif %}
        {% $3+ -1*vin*meer.value as: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*vin*beperking*meer.value-(1-vin)*meer.value as:currency %}
    | {{ meer.value-1*vin*beperking*meer.value | currency }}
      {% $6+ -1*vin*beperking*meer.value as:currency %}
    | {%=$4+ -1*vin*beperking*meer.value as:currency %}
    {% newline %}
  {% endfor %}
  {% result 'meerwaarde_beperking' $2-$6 %}
  {% newline %}
{% newline %}{% endifi %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

{{ header }}
| **{% t "Totaal" %}**                  | **{{ $2 | currency }}** | **{{ $2-$3 | currency }}** | **{{ $2-$5 | currency }}** | **{{ $2-$6 | currency }}** | **{{ $4 | 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 %}

{% stripnewlines %}
{% newline %}
|---------------------|-------20%-------:|-------15%-------:|-------15%-------:+
{% newline %}
| {% t "Ontvangsten" %} {% input custom.detail.omzet as:account_collection range:7 default:'70' accounts_var:omzet %}| | {{ -1*omzet.value | currency }}
  {% for account in omzet %}
  {% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $31+ account.value %}
  {% newline %}
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}
  {% endfor %}
{% newline %}
| {% t "Werken in uitvoering - begin " %} {% input custom.detail.beginwiu as:account_collection range:6,7 accounts_var:beginwiu %} {% input custom.beginwiu.doc as:file %}| | {{ -1*beginwiu.value | currency}}{% result 'beginwiu' -1*beginwiu.value %}
  {% for account in beginwiu %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $35+ account.value %}
  {% endfor %} 
{% newline %}
| {% t "Werken in uitvoering - einde " %} {% input custom.detail.eindwiu as:account_collection range:6,7 accounts_var:eindwiu %} {% input custom.eindwiu.doc as:file %}| |_{{ -1*eindwiu.value | currency}}_ {% result 'eindwiu' -1*eindwiu.value %}
  {% for account in eindwiu %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $36+ account.value %}
  {% endfor %}  
{% newline %}
| {% t "Omzet" %}|||{%=$10+ 1*(beginwiu.value-omzet.value-eindwiu.value) | currency %}
{% ifi goederen.value != 0 %}
{% newline %}
| {% t "Handelsgoederen, grond en hulpstoffen" %} {% input custom.detail.goederen as:account_collection range:60 default:'600,601,602,603,604,606' %}| |{{ -1*goederen.value | currency }}
  {% for account in goederen %}
  {% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $32+ account.value %}
    {% newline %}
    | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}
  {% endfor %}
{% newline %}
| {% t "Beginvoorraad" %} {% input custom.detail.beginvoorraad as:account_collection range:609 accounts_var:beginvoorraad %} {% input custom.beginvoorraad.doc as:file %}| | {{ -1*beginvoorraad.value | currency}}{% result 'beginvoorraad' -1*beginvoorraad.value %}
  {% for account in beginvoorraad %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $33+ account.value %}
  {% endfor %}
{% newline %}
| {% t "Eindvoorraad" %} {% input custom.detail.eindvoorraad as:account_collection range:609 accounts_var:eindvoorraad %} {% input custom.eindvoorraad.doc as:file %}| |_{{ -1*eindvoorraad.value | currency}}_ {% result 'eindvoorraad' -1*eindvoorraad.value %} 
  {% for account in eindvoorraad %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $40+ account.value %}
  {% endfor %}
{% newline %}
| {% t "Verkochte goederen" %}|||_{%=$10+ -1*(beginvoorraad.value+goederen.value+eindvoorraad.value) | currency %}_ 
{% newline %}
| {% t "**Brutowinst**" %}        ||| **{{ $10 | currency }}**{% endifi %}
{% newline %}
| {% t "Andere bedrijfsopbrengsten" %}              | | |_{% =$10+ $34 %}_
{% newline %}
| {% t "**Brutowinst na andere bedrijfsopbrengsten**" %}        |*Code 1600/2600*|| **{{ $10 | currency }}**
{% newline %}
| {% t "Meerwaarden, vergoedingen" %}              |*zie afzonderlijk detail* | |_{% =$10+ $4 %}_
{% newline %}
| {% t "**Brutowinst van de eigenlijke exploitatie**" %}        ||| **{{ $10 | currency }}**
{% newline %}
  | {% t "Toekenning meewerkende echtgeno(o)t(e)" %} {% input custom.detail.echtgenote as:account_collection range:619 accounts_var:echtgenote %} {% input custom.echtgenoot.doc as:file %} | *Code 1611/2450*| | {%=$10+ -1*echtgenote.value | currency %}{% result 'echtgenote' -1*echtgenote.value %}
  {% for account in echtgenote %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $36+ account.value %}
  {% endfor %}
  {% assign bruto_winst = $10 %}
{% newline %}
  | {% t "Andere beroepskosten" %}              |*Code 1606/2606* | |_{% =$10+ $1 %}_
{% newline %}
  | {% t "**Nettoresultaat**" %}      | | | **{{ $10 | currency }}**
{% newline %}
  
{% endstripnewlines %}

{% newpage %}
{% ifi anderebo.value != 0 %}
{{ detailanderebo }}
{% endifi %}
<br>
{{ detailkosten }}
<br>
{% ifi #741000+741100 != 0 %}
{{ detailmeerwaarde }}
{% endifi %}



<!----------------------------------------- check to see if all accounts have been used JUST ONCE ----------------------------------------->

{% assign accounts = period.accounts | range:'6,7' %}{% assign count_6_7 = 0 %}
{% for acc in accounts %}
  {% assign count_6_7 = count_6_7 | plus:1 %}
{% endfor %}

{% assign count_toegewezen = toegewezen | split:";" %}
{% for acc in count_toegewezen %}
  {% assign count = count | plus:1 %}
{% endfor %}

{% assign niet_toegewezen = #6+#7+(bruto_winst+-$0+$21+$20+$2-$6) %}

{% ic %}
*{% t "Niet toegewezen bedrag" %} {{ niet_toegewezen | currency }}* {% unexplained niet_toegewezen as:indicator %}

{% stripnewlines %}
  {% if count == count_6_7 %}
    *<font color="00a30e">{% t "Alle rekeningen zijn opgenomen" %}</font >*
  {% elsif count > count_6_7 %}
    *<font color="CC0000">{% t "Eén of meerdere rekeningen werden meermaals toegewezen" %}</font >*
  {% else %}
    {% assign show_niet_toegewezen = true %}
    *<font color="AAAAAA">{% t "Niet alle rekeningen zijn opgenomen" %}</font >*
  {% endif %}
{% endstripnewlines %}<br>

{% if show_niet_toegewezen %}

{% stripnewlines %}
| *{% t "Nr." %}* | *{% t "Naam" %}* | *{% t "Bedrag" %}*
{% newline %}
|--7%--|----|----:+
{% newline %}
{% for account in accounts %}
  {% unless toegewezen contains account.number %}
          | {{ account.number }} | {{ account.name }} | {%=$30+ account.value | currency %}
    {% newline %}
      {% if forloop.last %}
      |                        |                      | **{{ $30 | currency }}**
      {% endif %}
  {% endunless %}
{% endfor %}
{% endstripnewlines %}
{% endif %}

{% endic %}

<!------------------------------------------------------------------------------ END -------------------------------------------------------------------------------->

{% 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 %}

@Andrew,

That’s explained here, in another topic, but same issue:

So it’s your if-statement that checks on a custom objects that’s empty by default… Mind to take a closer look? Let me know if you’re stuck

I’d be nice that you help me with this, because i just have the problem with the capture of meerwaarden. My other captures are perfectly shown.

@Andrew,

That last link should guide you to the solution; if you tell me what isn’t clear for you there, I’ll gladly help you further.

It’s not related to the capture by the way; it’s your if-statement that checks if the custom object custom.meerwaarde.accounts is different from blank.

This one :

{% ifi custom.meerwaarde.accounts != blank %}

This code :

{% input custom.meerwaarde.accounts as:account_collection range:741 default:741 accounts_var:meerwaarde %} 

If you don’t click on the hashtag and select accounts, that object custom.meerwaarde.accounts will stay blank. It’s only when you click on it and select accounts, only then that object will have a value and not be empty. Which you probably didn’t because it showed the desired accounts to begin with.

This is also explained here:

Always be aware when you use default-values (like your default-range).
It’s better to check that’s not empty or blank by default. You could use this for instance:

{% ifi custom.meerwaarde.accounts != blank or meerwaarde.value != 0 %}

The meerwaarde.value will have a value different from zero by default, because there you’ll use the accounts_var which is automatically used to “fill up” a collection of accounts.

Hope this extra info is clear?