Export disclosure in style

In one of our disclosure we can you the # to add accounts and also manual input.

When this is only manual input in the disclosure, the disclosure will be export empty in the style. Empty%20disclosure (screen of the input in the disclosure:

)

When this is accounts and manual input in the disclosure, all is correct in the export. Disclosure%20fill%20in (screen of the input in the disclosure:

)

Can you help me?

Thanks,

Sylvie

Hello @svalais,

I’m afraid I need more info on this; can you paste the relevant code of your template? Could be an ifi-statementgone wrong for instance…

Thanks!

Hello Sven,

This is the code in part Detail text:

_{% capture sf_default_detail_template %}_
_{% raw %}_
_{% unless current_account.details.count == 0 and current_account.value == 0 %}_
_{% for detail in current_account.details %}{% if forloop.first %}|-----|----14%-----:|-----14%------:+{% endif %}_
_| {{detail.title}}{% if detail.description != blank %}<br/>{{detail.description | multiline_table}}{% endif %}{% if detail.custom.document %}<br>{% input detail.custom.doc as:file %}{% endif %} |{% if current_account.liability_or_income %}{{-1*detail.value | currency}}{% else %}{{detail.value | currency}}{% endif %}| &nbsp; {% endfor %}_
_{% endunless %}_
_{% endraw %}_
_{% endcapture %}_


_{% for account_or_text in export.selected_accounts_and_reconciliation_texts.include_zeros_with_details %}_

_{% if account_or_text.is_account %}_

_{% if forloop.first %}_
_{% if new_page %}{% newpage account_or_text.preferred_orientation %}{% endif %}{% assign new_page = true %}_
_{% changeorientation account_or_text.preferred_orientation %}_
_{::group}_
_{% else %}_
_{% changeorientation account_or_text.preferred_orientation %}_
_{::group}_
_{% endif %}_

_{% if forloop.first %}_
_{% else %}_
_{% newpage %}_
_{% endif %}_

_|------------|------15%------:+0097A9_
_| <font color="000000"><font color="{{export.highlight_alt_text_color}}">{{ account_or_text.number }} {{ account_or_text.name }}</font></font> | <font color="{{export.highlight_alt_text_color}}">{{ account_or_text.value | currency }}</font>_

_{{ account_or_text.rendered_template }}_

_<br>_

_{:/group}_
_  _
_{% else %}_

_{% if forloop.first %}_
_{% if new_page %}{% newpage account_or_text.preferred_orientation %}{% endif %}{% assign new_page = true %}_
_{% changeorientation account_or_text.preferred_orientation %}_
_{::group}_
_{% else %}_
_{% changeorientation account_or_text.preferred_orientation %}_
_{::group}_
_{% endif %}_

_{% if forloop.first %}_
_{% else %}_
_{% newpage %}_
_{% endif %}_

_|--------_
_|**<font color="000000"><font size="20">{{ account_or_text.name }}</font></font>**_

_{{ account_or_text.rendered_template }}_

_<br>_

_{:/group}_

_{% endif %}_

_{% endfor %}_

Thanks.

Hello @svalais,

Above is part of detail text that is used to generate exports, but what I need is the code of the template itself.
In there, I should be able to get a closer look; I suspect an ifi-statement on the custom-object that generates a string for the account-collection.

I’ll try to explain in more detail.

if you have this code for instance

{% input custom.range.accounts as:account_collection range:6,7 default:611 accounts_var:cars %} 

What happens here, is that the accounts_var will get filled with everything related to the accounts-drop as you know, but could it be that in your template, you do a check in the custom object custom.range.accounts?
Because that custom object will give nothing unless you change the accounts by clicking on the #. This behaviour is explained here as well - a default-value is never saved into the custom obect unless you actually input the value.

That is the reason why we invented the accounts_var, so it automatically does save something without actually clicking on the # or inputting something.

If not clear, I’m gonna need to ask you to post the code of the template where this issue persists. I’ll be gladly help you forward into the right direction.

Hello Sven,

This is the code:

{% t= "Detail van de kosten" fr:"Détails des frais" en:"Detail of all costs" %}
{% t= "Beroeps-<br />beperking" fr:"Limite professionnelle" en:"Occupational disability" %}
{% t= "Totale beperking" fr:"Limite totale" en:"Total limitation" %}
{% t= "Aftrekbaar" fr:"Déductible" en:"Deductible" %}
{% t= "Niet aftrekbaar" fr:"Non déductible" en:"Not deductible" %}
{% t= "Totaal" fr:"Total" en:"Total" %}
{% t= "Divers" fr:"Divers" en:"Miscellaneous" %}
{% t= "titel rubriek" fr:"titre rubrique" en:"title category" %}

{% if cost_categories_string == blank or cost_keys_string == blank %}
  {% assign cost_categories_string = "Personenwagens|Bedrijfswagens|Overige" %}
  {% assign cost_keys_string = "personenwagens|bedrijfswagen|soverige" %}
{% endif %}

{% t= "Personenwagens|Bedrijfswagens|Overige" en:"Vehicles passenger cars|Vehicles company cars|Other" fr:"Voitures|Véhicules d'entreprise|Autres" de:"Vehicles passenger cars|Vehicles company cars|Other" %}
{% capture cost_categories_string %} {% t "Personenwagens|Bedrijfswagens|Overige" %}{% endcapture %}

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

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

{% ic %}*Release 2018-09*{% endic %}

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

{% capture table %}

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

{% stripnewlines %}
{{ header }}
{% newline %}
| **{% t "Detail van de kosten" %}**    
| **{{ period.year_end_date | date:'%Y' }}**
| **{% t "Beroeps-<br />beperking" %}**<br />**({% t "Niet aftrekbaar" %})**
| **{% t "Totale beperking" %}**    
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% for cost_category in cost_categories %}
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
  {% assign category_key = cost_keys[forloop.index0] %}  
  
  {% ifi custom[category_key].accounts != blank %}
  {% newline %}
  | {% t cost_category %} {% input custom[category_key].accounts as:account_collection range:6,7 accounts_var:costs %}  | | |
  {% newline %}
  {{ header }}
  {% newline %}
  {% for account in costs %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.name }}
    | {%=$11+ 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+ vin*account.value as:currency %}
    | {{ account.value-1*vin*account.value | currency }}
    {% newline %}
  {% endfor %}
  {% capture custfieldname %}vrije_lijnen_{{category_key}}{%endcapture%}
  {% fori vrije_cost_lijnen in custom.[custfieldname] %}
    | {% input vrije_cost_lijnen.omschrijving placeholder:'' %} 
    | {% $31+input vrije_cost_lijnen.value as:currency as:currency placeholder:'' %} {% assign $33 = vrije_cost_lijnen.value %}
    | {% input vrije_cost_lijnen.vin as:percentage placeholder:'0.00%' %}
        {% if vrije_cost_lijnen.vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-vrije_cost_lijnen.vin placeholder:'' %}
        {% endif %}
        {% $32+ vin*$33 as:currency %} 
    | {{ $33-1*vin*$33 | currency }} 
    {% newline %}
    {% if forloop.last %}
      |     
      | **{% =$21+ $11+$31 as:currency %}** 
      |     
      | **{% =$22+ ($11-$12)+($31-$32) as:currency %}** 
      {% result category_key $34 %}|
  {% assign $31 = 0 %}
  {% assign $32 = 0 %}
  {% newline %}
  {% endif %}
  {% endfori %}
  {% newline %}
  {% endifi %}
{% endfor %}
{% fori vrije_cost in custom.vrije_tekst %}
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
{% newline %}
  | {% input vrije_cost.titel placeholder:'titel rubriek' %} {% input vrije_cost.accounts as:account_collection range:6,7 accounts_var:vrije_costs %} | | |
  {% newline %}
  {{ header }}
  {% newline %}
  {% for account2 in vrije_costs %}
     |{{ account2.name }}
     |{%=$11+ account2.value as:currency %}
     | {% input custom[account2.number].vin as:percentage placeholder:'0.00%' %}
        {% if custom[account2.number].vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-custom[account2.number].vin placeholder:'' %}
        {% endif %}
        {% $12+ vin*account2.value as:currency %}
     |{{ account2.value-1*vin*account2.value | currency }}
    {% newline %}
  {% endfor %}
  {% capture custfieldname2 %}vrije_lijnen2_{{vrije_cost.key}}{%endcapture%}
  {% fori vrije_cost_lijnen2 in custom.[custfieldname2] %}
    | {% input vrije_cost_lijnen2.omschrijving placeholder:'' %} {% assign $33 = vrije_cost_lijnen2.value %}
    | {% $31+input vrije_cost_lijnen2.value as:currency as:currency placeholder:'' %} 
    | {% input vrije_cost_lijnen2.vin as:percentage placeholder:'0.00%' %}
        {% if vrije_cost_lijnen2.vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-vrije_cost_lijnen2.vin placeholder:'' %}
        {% endif %}
        {% $32+ vin*$33 as:currency %} 
    | {{ $33-1*vin*$33 | currency }} 
    {% newline %}
    {% if forloop.last %}
      |     
      | **{% =$21+ $11+$31 as:currency %}** 
      |     
      | **{% =$22+ ($11-$12)+($31-$32) as:currency %}** 
      {% result category_key $34 %}|
      {% assign $31 = 0 %}
      {% assign $32 = 0 %}
      {% newline %}
  {% endif %}
  {% endfori %}
  {% newline %}
{% endfori %}
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

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

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

{% endcapture %}

{{ table }}

Thanks,

Sylvie

@svalais,

as I thought… It is that issue that I explained earlier.

You can find the reasoning behind it, asl well as a direction into the solution here:

Can you put your own spin on it? Let us know if it works :muscle:

Hello Sven,

I changed the ifi statement in the following but it doesn’t work: {% ifi custom[category_key].accounts != blank or custom.[custfieldname].omschrijving != blank %}

What do I wrong?

Thanks,

Sylvie

Hello @svalais,

As I mentionned before, your custom object :

custom[category_key].accounts

is empty if you don’t click on the hast-tag # . You need to leave that out of your ifi-statement, and/or replace it with something that does have actual value.

Like your accounts_var costs :

You could check on the value `costs.value’
like

{% ifi costs.value != 0 %}

or

the object itself :

{% ifi costs != blank %}

The second part of your ifi-statement seems okay, although I don’t see it in your original posted code where that object is being made (or inputted).

Hello Sven,

We are using the code of your disclosure Beroepskosten 2.0 but we use the code in 2 different disclosures.

In your code you also have the same ifi statement but we add for each code free lines and that the 2nd part of ifi statement I added today but it doesn’t work.

I tried to use {% ifi costs != blank %} but it does also not work.

Can you help me?

Thanks,

Sylvie

Sure @svalais

Just to be sure, can you post the whole code again? Because I’m not sure yet if I’m working on the right code or not :see_no_evil:

Sven,

This is the whole code:

{% t= "Detail van de kosten" fr:"Détails des frais" en:"Detail of all costs" %}
{% t= "Beroeps-<br />beperking" fr:"Limite professionnelle" en:"Occupational disability" %}
{% t= "Totale beperking" fr:"Limite totale" en:"Total limitation" %}
{% t= "Aftrekbaar" fr:"Déductible" en:"Deductible" %}
{% t= "Niet aftrekbaar" fr:"Non déductible" en:"Not deductible" %}
{% t= "Totaal" fr:"Total" en:"Total" %}
{% t= "Divers" fr:"Divers" en:"Miscellaneous" %}
{% t= "titel rubriek" fr:"titre rubrique" en:"title category" %}

{% if cost_categories_string == blank or cost_keys_string == blank %}
  {% assign cost_categories_string = "Personenwagens|Bedrijfswagens|Overige" %}
  {% assign cost_keys_string = "personenwagens|bedrijfswagen|soverige" %}
{% endif %}

{% t= "Personenwagens|Bedrijfswagens|Overige" en:"Vehicles passenger cars|Vehicles company cars|Other" fr:"Voitures|Véhicules d'entreprise|Autres" de:"Vehicles passenger cars|Vehicles company cars|Other" %}
{% capture cost_categories_string %} {% t "Personenwagens|Bedrijfswagens|Overige" %}{% endcapture %}

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

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

{% ic %}*Release 2018-10*{% endic %}

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

{% capture table %}

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

{% stripnewlines %}
{{ header }}
{% newline %}
| **{% t "Detail van de kosten" %}**    
| **{{ period.year_end_date | date:'%Y' }}**
| **{% t "Beroeps-<br />beperking" %}**<br />**({% t "Niet aftrekbaar" %})**
| **{% t "Totale beperking" %}**    
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% for cost_category in cost_categories %}
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
  {% assign category_key = cost_keys[forloop.index0] %}  
  
  {% ifi costs != blank %}
  {% newline %}
  | {% t cost_category %} {% input custom[category_key].accounts as:account_collection range:6,7 accounts_var:costs %}  | | |
  {% newline %}
  {{ header }}
  {% newline %}
  {% for account in costs %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.name }}
    | {%=$11+ 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+ vin*account.value as:currency %}
    | {{ account.value-1*vin*account.value | currency }}
    {% newline %}
  {% endfor %}
  {% capture custfieldname %}vrije_lijnen_{{category_key}}{%endcapture%}
  {% fori vrije_cost_lijnen in custom.[custfieldname] %}
    | {% input vrije_cost_lijnen.omschrijving placeholder:'' %} 
    | {% $31+input vrije_cost_lijnen.value as:currency as:currency placeholder:'' %} {% assign $33 = vrije_cost_lijnen.value %}
    | {% input vrije_cost_lijnen.vin as:percentage placeholder:'0.00%' %}
        {% if vrije_cost_lijnen.vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-vrije_cost_lijnen.vin placeholder:'' %}
        {% endif %}
        {% $32+ vin*$33 as:currency %} 
    | {{ $33-1*vin*$33 | currency }} 
    {% newline %}
    {% if forloop.last %}
      |     
      | **{% =$21+ $11+$31 as:currency %}** 
      |     
      | **{% =$22+ ($11-$12)+($31-$32) as:currency %}** 
      {% result category_key $34 %}|
  {% assign $31 = 0 %}
  {% assign $32 = 0 %}
  {% newline %}
  {% endif %}
  {% endfori %}
  {% newline %}
  {% endifi %}
{% endfor %}
{% fori vrije_cost in custom.vrije_tekst %}
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
{% newline %}
  | {% input vrije_cost.titel placeholder:'titel rubriek' %} {% input vrije_cost.accounts as:account_collection range:6,7 accounts_var:vrije_costs %} | | |
  {% newline %}
  {{ header }}
  {% newline %}
  {% for account2 in vrije_costs %}
     |{{ account2.name }}
     |{%=$11+ account2.value as:currency %}
     | {% input custom[account2.number].vin as:percentage placeholder:'0.00%' %}
        {% if custom[account2.number].vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-custom[account2.number].vin placeholder:'' %}
        {% endif %}
        {% $12+ vin*account2.value as:currency %}
     |{{ account2.value-1*vin*account2.value | currency }}
    {% newline %}
  {% endfor %}
  {% capture custfieldname2 %}vrije_lijnen2_{{vrije_cost.key}}{%endcapture%}
  {% fori vrije_cost_lijnen2 in custom.[custfieldname2] %}
    | {% input vrije_cost_lijnen2.omschrijving placeholder:'' %} {% assign $33 = vrije_cost_lijnen2.value %}
    | {% $31+input vrije_cost_lijnen2.value as:currency as:currency placeholder:'' %} 
    | {% input vrije_cost_lijnen2.vin as:percentage placeholder:'0.00%' %}
        {% if vrije_cost_lijnen2.vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-vrije_cost_lijnen2.vin placeholder:'' %}
        {% endif %}
        {% $32+ vin*$33 as:currency %} 
    | {{ $33-1*vin*$33 | currency }} 
    {% newline %}
    {% if forloop.last %}
      |     
      | **{% =$21+ $11+$31 as:currency %}** 
      |     
      | **{% =$22+ ($11-$12)+($31-$32) as:currency %}** 
      {% result category_key $34 %}|
      {% assign $31 = 0 %}
      {% assign $32 = 0 %}
      {% newline %}
  {% endif %}
  {% endfori %}
  {% newline %}
{% endfori %}
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

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

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

{% endcapture %}

{{ table }}

Thanks,

Sylvie

So sorry @svalais, but it seems I gave you the wrong info :pensive:

When you check on a custom object like the accounts_var above, you need to check on empty instead of blank.

So if you change your code to {% ifi costs != empty %} it’ll work.

My apologies @svalais

Can you keep us updated if this works for you?

Sven,

I try your solution but it only work for the first category of cost and not for all the categories.

This is the input in my file:

.

This is the result in the export: Capture1.

Can you have a look?

Thanks,

Sylvie

@svalais,

I’d do it like this (my previous solution only works with a set of fixed (default) ranges (which was the case in the other post, where a default range was used for accounts) :


{% for cost_category in cost_categories %}
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
  {% assign category_key = cost_keys[forloop.index0] %}  
  
  {% capture custfieldname %}vrije_lijnen_{{category_key}}{%endcapture%}

  
  {% ifi custom[category_key].accounts != blank or custom.[custfieldname] != empty %}
  {% newline %}
  | {% t cost_category %} {% input custom[category_key].accounts as:account_collection range:6,7 accounts_var:costs %}  | | |
  {% newline %}
  {{ header }}
  {% newline %}
  {% for account in costs %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.name }}
    | {%=$11+ 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+ vin*account.value as:currency %}
    | {{ account.value-1*vin*account.value | currency }}
    {% newline %}
  {% endfor %}
  
  {% fori vrije_cost_lijnen in custom.[custfieldname] %}
    | {% input vrije_cost_lijnen.omschrijving placeholder:'' %} 
    | {% $31+input vrije_cost_lijnen.value as:currency as:currency placeholder:'' %} {% assign $33 = vrije_cost_lijnen.value %}
    | {% input vrije_cost_lijnen.vin as:percentage placeholder:'0.00%' %}
        {% if vrije_cost_lijnen.vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-vrije_cost_lijnen.vin placeholder:'' %}
        {% endif %}
        {% $32+ vin*$33 as:currency %} 
    | {{ $33-1*vin*$33 | currency }} 
    {% newline %}
    {% if forloop.last %}
      |     
      | **{% =$21+ $11+$31 as:currency %}** 
      |     
      | **{% =$22+ ($11-$12)+($31-$32) as:currency %}** 
      {% result category_key $34 %}|
  {% assign $31 = 0 %}
  {% assign $32 = 0 %}
  {% newline %}
  {% endif %}
  {% endfori %}
  {% newline %}
  {% endifi %}
{% endfor %}

So, to recap on how the ifi-statement works :

a) I’ll check on the custom object custom[category_key].accounts

This will always have a value (that’s a string by the way), because the user either has to select accounts with the hash-tag OR give in custom descriptions (see b) )

OR

b) I’ll check on custom.[custfieldname] being empty or not

However, that last one is created by a capture :

{% capture custfieldname %}vrije_lijnen_{{category_key}}{%endcapture%}

This capture needs to be added above my ifi-statement, otherwise the object would not be created.

Hope third time’s the charm @svalais ?

Hello,

Thanks my problem is now solved.

Sylvie

Glad we could help you @svalais :+1:

Hallo,

I have an other problem with the export of the same disclosure.

On the screen all my totals for each title and the global total are correct but not in the export.

This is the result on the sreen:

.

This is the result in the export: Capture2.

The total for the 1st title is correct but not for the other titles and the global total is also incorrect.

This is the code:

{% t= "Detail van de kosten" fr:"Détails des frais" en:"Detail of all costs" %}
{% t= "Beroeps-<br />beperking" fr:"Limite professionnelle" en:"Occupational disability" %}
{% t= "Totale beperking" fr:"Limite totale" en:"Total limitation" %}
{% t= "Aftrekbaar" fr:"Déductible" en:"Deductible" %}
{% t= "Niet aftrekbaar" fr:"Non déductible" en:"Not deductible" %}
{% t= "Totaal" fr:"Total" en:"Total" %}
{% t= "Divers" fr:"Divers" en:"Miscellaneous" %}
{% t= "titel rubriek" fr:"titre rubrique" en:"title category" %}

{% if cost_categories_string == blank or cost_keys_string == blank %}
  {% assign cost_categories_string = "Personenwagens|Bedrijfswagens|Overige" %}
  {% assign cost_keys_string = "personenwagens|bedrijfswagen|soverige" %}
{% endif %}

{% t= "Personenwagens|Bedrijfswagens|Overige" en:"Vehicles passenger cars|Vehicles company cars|Other" fr:"Voitures|Véhicules d'entreprise|Autres" de:"Vehicles passenger cars|Vehicles company cars|Other" %}
{% capture cost_categories_string %} {% t "Personenwagens|Bedrijfswagens|Overige" %}{% endcapture %}

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

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

{% ic %}*Release 2018-10*{% endic %}

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

{% capture table %}

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

{% stripnewlines %}
{{ header }}
{% newline %}
| **{% t "Detail van de kosten" %}**    
| **{{ period.year_end_date | date:'%Y' }}**
| **{% t "Beroeps-<br />beperking" %}**<br />**({% t "Niet aftrekbaar" %})**
| **{% t "Totale beperking" %}**    
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% for cost_category in cost_categories %}
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
  {% assign category_key = cost_keys[forloop.index0] %}  
  {% capture custfieldname %}vrije_lijnen_{{category_key}}{%endcapture%}
  
  {% ifi custom[category_key].accounts != blank or custom.[custfieldname] != empty %}
  {% newline %}
  | {% t cost_category %} {% input custom[category_key].accounts as:account_collection range:6,7 accounts_var:costs %}  | | |
  {% newline %}
  {{ header }}
  {% newline %}
  {% for account in costs %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.name }}
    | {%=$11+ 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+ vin*account.value as:currency %}
    | {{ account.value-1*vin*account.value | currency }}
    {% newline %}
  {% endfor %}
  {% fori vrije_cost_lijnen in custom.[custfieldname] %}
    | {% input vrije_cost_lijnen.omschrijving placeholder:'' %} 
    | {% $31+input vrije_cost_lijnen.value as:currency as:currency placeholder:'' %} {% assign $33 = vrije_cost_lijnen.value %}
    | {% input vrije_cost_lijnen.vin as:percentage placeholder:'0.00%' %}
        {% if vrije_cost_lijnen.vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-vrije_cost_lijnen.vin placeholder:'' %}
        {% endif %}
        {% $32+ vin*$33 as:currency %} 
    | {{ $33-1*vin*$33 | currency }} 
    {% newline %}
    {% if forloop.last %}
      |     
      | 
      |     
      | **{% =$22+ ($11-$12)+($31-$32) as:currency %}** 
      {% result category_key $34 %}|
  {% assign $31 = 0 %}
  {% assign $32 = 0 %}
  {% newline %}
  {% endif %}
  {% endfori %}
  {% newline %}
  {% endifi %}
{% endfor %}
{% fori vrije_cost in custom.vrije_tekst %}
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
{% newline %}
  | {% input vrije_cost.titel placeholder:'titel rubriek' %} {% input vrije_cost.accounts as:account_collection range:6,7 accounts_var:vrije_costs %} | | |
  {% newline %}
  {{ header }}
  {% newline %}
  {% for account2 in vrije_costs %}
     |{{ account2.name }}
     |{%=$11+ account2.value as:currency %}
     | {% input custom[account2.number].vin as:percentage placeholder:'0.00%' %}
        {% if custom[account2.number].vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-custom[account2.number].vin placeholder:'' %}
        {% endif %}
        {% $12+ vin*account2.value as:currency %}
     |{{ account2.value-1*vin*account2.value | currency }}
    {% newline %}
  {% endfor %}
  {% capture custfieldname2 %}vrije_lijnen2_{{vrije_cost.key}}{%endcapture%}
  {% fori vrije_cost_lijnen2 in custom.[custfieldname2] %}
    | {% input vrije_cost_lijnen2.omschrijving placeholder:'' %} {% assign $33 = vrije_cost_lijnen2.value %}
    | {% $31+input vrije_cost_lijnen2.value as:currency as:currency placeholder:'' %} 
    | {% input vrije_cost_lijnen2.vin as:percentage placeholder:'0.00%' %}
        {% if vrije_cost_lijnen2.vin == blank %}
          {% assign vin = 1 %}
        {% else %}
          {% assign vin = 1-vrije_cost_lijnen2.vin placeholder:'' %}
        {% endif %}
        {% $32+ vin*$33 as:currency %} 
    | {{ $33-1*vin*$33 | currency }} 
    {% newline %}
    {% if forloop.last %}
      |     
      | 
      |     
      | **{% =$22+ ($11-$12)+($31-$32) as:currency %}** 
      {% result category_key $34 %}|
      {% assign $31 = 0 %}
      {% assign $32 = 0 %}
      {% newline %}
  {% endif %}
  {% endfori %}
  {% newline %}
{% endfori %}
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

{{ header }}
| **{% t "Totaal" %}**                  |  |  |  **{{ $22 | currency }}** 

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

{% endcapture %}

{{ table }}

Can you have a look please?

Thanks,

Sylvie

Hey @svalais,

Would you mind posting your code between the so called tildes ` ? See here for more info on how exactly to do this; otherwise the post is overfloaded with no so pretty looking code
I’ve done it now for you though; you can edit your post to see how I did it. :slightly_smiling_face:

Back on topic:

This code :


          {% fori vrije_cost_lijnen in custom.[custfieldname] %}
            | {% input vrije_cost_lijnen.omschrijving placeholder:'' %} 
            | {% $31+input vrije_cost_lijnen.value as:currency as:currency placeholder:'' %} {% assign $33 = vrije_cost_lijnen.value %}
            | {% input vrije_cost_lijnen.vin as:percentage placeholder:'0.00%' %}
              {% if vrije_cost_lijnen.vin == blank %}
                {% assign vin = 1 %}
              {% else %}
                {% assign vin = 1-vrije_cost_lijnen.vin placeholder:'' %}
              {% endif %}
            {% $32+ vin*$33 as:currency %} 
            | {{ $33-1*vin*$33 | currency }} 
          {% newline %}
          {% if forloop.last %}
            |     
            | 
            |     
            |  **{% =$22+ ($11-$12)+($31-$32) as:currency %}** 
          {% result category_key $34 %}|

This line **{% =$22+ ($11-$12)+($31-$32) as:currency %}** is the one you want to display in an export, but take a good look: this line is in an if-statement : if forloop.last . So it’s only shown if you are in the last loop of your forloop. And that forloop is this one :

{% fori vrije_cost_lijnen in custom.[custfieldname] %}

And you’d want the last loop of this one :

{% for cost_category in cost_categories %} 

Is this clear enough for you on how to fix it? Let us known if you’re stuck and I’ll add more info to this issue of course (had me looking for quite a bit there :relaxed: )

Hello,

If I change the place of the If forloop.last before the endfor of {% for cost_category in cost_categories %},
my totals on the screen and in the export are not correct anymore.

Can you help me please?

Thanks,

Sylvie

Can you post me the exact code you used @svalais ? I’ll take a look at it