Outcome of the intitial stock and final stock

Hi,
Is it possible to make code that gives the outcome of the initial stock and final stock?

Hi Stephanie,

it is possible to ‘capture’ the value of a field by using the following code : {% $1+input custom.some.thing %}.
With the $1 you can calculate through the whole template and print the value you calculated {{$1}}.
You can pick any number instead of 1, just not more then 39. Further, you can only use a number 1 time in a template.

Hope this is clear, if not, can you paste your code so we can take a further look?

Kind regards
Sofie

hi,
I do not understand it very well, see here under the code:

{% t= “Detail van de kosten” fr:“Les DĂ©tails des frais” en:“Detail of all costs” %}
{% t= “Beroeps-
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= “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= “Werken in uitvoering” fr:“Travaux en cours” en:“Work in progress” %}

{% t= “Voorraadwijziging” fr:“Changement de stock” en:“Change in stocks” %}
{% t= “Toon beginvoorraad - eindvoorraad boekjaar” fr:“Afficher le stock initial - le stock final de l’exercice” en:“Show initial - final stock for the financial year”%}
{% t= “Beginvoorraad” fr:“Stock initial” en:“Initial stock” %}
{% t= “Eindvoorraad” fr:“Stock final” en:“Final stock” %}

{% t= “WIU” fr:“Changement de stock” en:“Change in stocks” %}
{% t= “Toon WIUbegin - WIUeinde boekjaar” fr:“Afficher le stock initial - le stock final de l’exercice” en:“Show initial - final stock for the financial year”%}
{% t= “WIUbegin” fr:“Stock initial” en:“Initial stock” %}
{% t= “WIUeinde” fr:“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 spouse” %}
{% 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= “Onderaannemingen” fr:“Les fournitures et les services” en:“Supplies and services” %}
{% t= “Huurlasten en onderhoudskosten” fr:“La location et les frais de location” en:“Rent and rental expenses” %}
{% t= “Leveringen” fr:“Les fournitures et les services” en:“Supplies and services” %}
{% t= “Vergoeding aan derden” fr:“Les frais de tiers” en:“Remuneration to third parties” %}
{% t= “Vervoer en aanverwante kosten” fr:“Les fournitures et les services” en:“Supplies and services” %}
{% t= “Verkoopskosten” fr:“Les fournitures et les services” en:“Supplies and services” %}
{% t= “Communicatie” fr:“Les fournitures et les services” en:“Supplies and services” %}
{% t= “Bezoldigingen” fr:“Les fournitures et les services” en:“Supplies and services” %}
{% t= “Werkgeversbijdragen” fr:“Les fournitures et les services” en:“Supplies and services” %}
{% t= “Andere personeelskosten” fr:“Les fournitures et les services” en:“Supplies and services” %}
{% t= “Afschrijvingen” fr:“Les fournitures et les services” en:“Supplies and services” %}
{% t= “Bedrijfsbelastingen” fr:“Les fournitures et les services” en:“Supplies and services” %}
{% t= “Kosten van schulden” fr:“Les fournitures et les services” en:“Supplies and services” %}
{% t= “Uitzonderlijke kosten” fr:“Les fournitures et les services” en:“Supplies and services” %}

{% 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 %}
{% assign cost_categories_string = “Onderaannemingen|Huurlasten en onderhoudskosten|Leveringen|Vergoeding aan derden|Vervoer en aanverwante kosten|Verkoopskosten|Communicatie|Bezoldigingen|Werkgeversbijdragen|Andere personeelskosten|Afschrijvingen|Bedrijfsbelastingen|Kosten van schulden|Uitzonderlijke kosten|” %}
{% assign cost_keys_string = “onderaannemingen|huurlasten|leveringen|vergoeding|vervoer|verkoopskosten|communicatie|bezoldigingen|werkgeversbijdragen|andere personeelskosten|afschrijvingen|bedrijfsbelastingen|kosten|uitzonderlijke|” %}
{% endif %}

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

{% if cost_keys_string != blank %}
{% assign cost_keys = cost_keys_string | split:"|" %}
{% endif %}

{% assign toegewezen = “” %}
{% assign def_voorraadwijziging = “” %}
{% assign count = 0 %}

{% assign toegewezen = “” %}
{% assign def_WIUwijziging = “” %}
{% assign count = 0 %}

{% for cost_category in cost_categories %}
{% if cost_keys_string != blank %}
{% assign category_key = cost_keys[forloop.index0] %}
{% else %}
{% assign category_key = cost_category | replace:" “,”_" | downcase %}
{% endif %}

{% assign costs_range = custom[category_key].selected | default:custom[category_key].accounts %}

{% assign costs = period.accounts.include_zeros | range:costs_range %}
{% for account in costs %}
{% assign toegewezen = toegewezen | append:"" | append: account.number | append:";" %}
{% endfor %}
{% endfor %}

{% assign omzet_range = custom.detail.omzet | default:“70” %}
{% assign omzet = period.accounts.include_zeros| range:omzet_range %}
{% for account in omzet %}
{% assign toegewezen = toegewezen | append:"" | append: account.number | append:";" %}
{% endfor %}

{% assign WIUwijziging_range = custom.detail.WIUwijziging | default:“71” %}
{% assign WIUwijziging = period.accounts.include_zeros| range:WIUwijziging_range %}
{% for account in WIUwijziging %}
{% assign toegewezen = toegewezen | append:account.number | append:";" %}
{% endfor %}

{% assign goederen_range = custom.detail.goederen | default:“60” %}
{% assign goederen = period.accounts.include_zeros| range:goederen_range %}
{% for account in goederen %}
{% assign toegewezen = toegewezen | append:"" | append: account.number | append:";" %}
{% endfor %}

{% comment %} voorraadwijziging {% endcomment %}

{% assign beginvoorraad = period.accounts.include_zeros | range:custom.detail.beginvoorraad %}
{% for account in beginvoorraad %}
{% assign def_beginvoorraad = def_beginvoorraad | append:account.number %}
{% unless forloop.last %}
{% assign def_beginvoorraad = def_beginvoorraad | append:"," %}
{% endunless %}
{% endfor %}

{% assign eindvoorraad = period.accounts.include_zeros| range:custom.detail.eindvoorraad %}
{% for account in eindvoorraad %}
{% assign def_eindvoorraad = def_eindvoorraad | append: account.number %}
{% unless forloop.last %}
{% assign def_eindvoorraad = def_eindvoorraad | append:"," %}
{% endunless %}
{% endfor %}

{% assign def_voorraadwijziging = def_beginvoorraad | append:"," | append:def_eindvoorraad %}

{% assign acccounts_begin = period.minus_1y.accounts | range:custom.begin_eind.range %}
{% assign beginvoorraad = custom.voorraad.begin | default:acccounts_begin.value %}

{% assign acccounts_eind = period.accounts | range:custom.begin_eind.range %}
{% assign eindvoorraad = custom.voorraad.eind | default:acccounts_eind.value %}

{% assign voorraadwijziging_range = custom.detail.voorraadwijziging | default:def_voorraadwijziging %}
{% assign voorraadwijziging = period.accounts.include_zeros | range:voorraadwijziging_range %}
{% capture voorraadwijziging_rows %}{% input custom.wijziging.voorraad as:currency default:-1voorraadwijziging.value %} {% assign wijziging_in_voorraad = custom.wijziging.voorraad | default:-1voorraadwijziging.value %}{% result ‘voorraadwijziging’ wijziging_in_voorraad %}
{% for account in voorraadwijziging %}
{% assign toegewezen = toegewezen | append:"" | append: account.number | append:";" %}
{% endfor %}
{% endcapture %}

{% comment %} WIUwijziging {% endcomment %}

{% assign WIUbegin = period.accounts.include_zeros | range:custom.detail.WIU %}
{% for account in WIUbegin %}
{% assign def_WIUbegin = def_WIUbegin | append:account.number %}
{% unless forloop.last %}
{% assign def_WIUbegin = def_WIUbegin | append:"," %}
{% endunless %}
{% endfor %}

{% assign WIUeinde = period.accounts.include_zeros| range:custom.detail.WIU %}
{% for account in WIUeinde %}
{% assign def_WIUeinde = def_WIUeinde | append: account.number %}
{% unless forloop.last %}
{% assign def_WIUeinde = def_WIUeinde | append:"," %}
{% endunless %}
{% endfor %}

{% assign def_WIUwijziging = def_WIUbegin | append:"," | append:def_WIUeinde %}

{% assign acccounts_begin = period.minus_1y.accounts | range:custom.begin_eindwiu.range %}
{% assign WIUbegin = custom.WIU.begin | default:acccounts_begin.value %}

{% assign acccounts_einde = period.accounts | range:custom.begin_eindwiu.range %}
{% assign WIUeinde = custom.WIU.einde | default:acccounts_begin.value %}

{% assign WIUwijziging_range = custom.detail.WIUwijziging | default:def_WIUwijziging %}
{% assign WIUwijziging = period.accounts.include_zeros | range:WIUwijziging_range %}
{% capture WIUwijziging_rows %}{% input custom.wijziging.WIU as:currency default:-1WIUwijziging.value %} {% assign wijziging_in_WIU = custom.wijziging.WIU |
default:-1
WIUwijziging.value %}{% result ‘WIUwijziging’ wijziging_in_WIU %}
{% for account in WIUwijziging %}
{% assign toegewezen = toegewezen | append:"" | append: account.number | append:";" %}
{% endfor %}
{% endcapture %}

{% assign sociale_bijdrage = period.accounts.include_zeros| range:custom.detail.sociale_bijdrage %}
{% for account in sociale_bijdrage %}
{% assign toegewezen = toegewezen | append:"" | append: account.number | append:";" %}
{% endfor %}

{% assign echtgenote = period.accounts.include_zeros| range:custom.detail.echtgenote %}
{% for account in echtgenote %}
{% assign toegewezen = toegewezen | append:"" | append: account.number | append:";" %}
{% endfor %}

{% for extra_kost in custom.extra_kosten %}
{% assign accounts = period.accounts.include_zeros | range:extra_kost.accounts %}
{% for account in accounts %}
{% assign toegewezen = toegewezen | append:"" | append: account.number | append:";" %}
{% endfor %}
{% endfor %}

{% for extra_account in custom.extra_accounts %}
{% assign accounts = period.accounts.include_zeros | range:extra_account.accounts %}
{% for account in accounts %}
{% assign toegewezen = toegewezen | append:"" | append: account.number | append:";" %}
{% endfor %}
{% endfor %}

{% assign global_6_range = “” %}
{% assign accounts = period.accounts.include_zeros | range:‘6’ %}

{% for account in accounts %}
{% assign numberwithdollar = account.number | prepend:"" | append:"" %}
{% unless toegewezen contains numberwithdollar %}
{% unless global_6_range == blank %}{% assign global_6_range = global_6_range | append:"," %}{% endunless %}
{% assign global_6_range = global_6_range | append:account.number %}
{% endunless%}
{% endfor %}

{% assign global_7_range = “” %}
{% assign accounts = period.accounts.include_zeros | range:‘7’ %}

{% for account in accounts %}
{% assign numberwithdollar = account.number | prepend:"" | append:"" %}
{% unless toegewezen contains numberwithdollar %}
{% unless global_7_range == blank %}{% assign global_7_range = global_7_range | append:"," %}{% endunless %}
{% assign global_7_range = global_7_range | append:account.number %}
{% endunless%}
{% endfor %}

{% assign global_range = global_6_range | append:"," | append:global_7_range %}

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

{% capture table %}


{% stripnewlines %}
{{ header }}
{% newline %}
| {% t “Detail van de kosten” %}
| {{ period.year_end_date | date:’%Y’ }}
| {% t “Beroeps-
beperking” %}

({% t “aftrekbaar” %})
| {% t “Fiscale beperking” %}
({% t “aftrekbaar” %})
| {% t “Aftrekbaar” %}
{% newline %}
{% newline %}

{% newline %}
{% newline %}
{% for cost_category in cost_categories %}
{% assign $11 = 0 %}
{% assign $12 = 0 %}
{% assign $13 = 0 %}
{% if cost_keys_string != blank %}
{% assign category_key = cost_keys[forloop.index0] %}
{% else %}
{% assign category_key = cost_category | replace:" “,”_" | downcase %}
{% endif %}

{% assign costs_range = custom[category_key].selected | default:custom[category_key].accounts %}

{% ifi costs_range != blank %}

{% newline %}
| {% t cost_category %} {% input custom[category_key].accounts as:account_collection range:global_range %} |

{% ic %}{% assign costs = period.accounts.include_zeros | range:costs_range %}{% endic %}
{% nic %}{% assign costs = period.accounts | range:costs_range %}{% endnic %}

{% newline %}
{{ header }}
{% newline %}
{% for account in costs %}
{% assign vin_old = 1-custom[account.number].vin %}
{% assign beperking_old = 1-custom[account.number].beperking %}
{% assign vin_new = custom[account.number].vin_new | default:vin_old %}
{% if vin_new == blank %}
{% assign vin = 0 %}
{% else %}
{% assign vin = vin_new %}
{% endif %}

{% assign beperking_new = custom[account.number].beperking_new | default:beperking_old %}
{% if beperking_new == blank %}
  {% assign beperking = 0 %}
{% else %}
  {% assign beperking = beperking_new %}
{% endif %}

| {{ account.name }}
| {%=$11+ -1*account.value as:currency %}
| {% input custom[account.number].vin_new as:percentage placeholder:'0.00%' default:vin_old %}
| {% input custom[account.number].beperking_new as:percentage placeholder:'0.00%' default:beperking_old %}
| {{ -1*vin*beperking*account.value | currency }}
  {% $13+ -1*vin*beperking*account.value | currency: 2 %}
{% newline %}
{% if forloop.last %}
  |     
  | **{% =$21+ $11 as:currency %}** 
  |
  |
  | **{% =$23+ $13 as:currency %}** {% $1+ $13 as:currency %}
  {% result category_key $13 %}|
{% newline %}
{% endif %}

{% endfor %}
{% newline %}
{% endifi %}
{% endfor %}
{% newline %}
{% newline %}

{% newline %}
{% newline %}
{% endstripnewlines %}

{{ header }}
| {% t “Totaal” %} | {{ $21 | currency }} | | | {{ $23 | currency }}


{% endcapture %}

{% stripnewlines %}
{% newline %}
|---------------------|-------15%-------:|-------15%-------:|-------15%-------:+
{% newline %}
| {% t “Ontvangsten/Baten” %} {% input custom.detail.omzet as:account_collection range:global_7_range default:‘70’ %}| | | {%=$10+ -1omzet.value | currency %}
{% assign omzet = period.accounts | range:omzet_range %}
{% for account in omzet %}
{% $31+ account.value %}
{% newline %}
|      {{ account.name }}|{{ -1
account.value | currency }}
{% endfor %}
{% newline %}
|{% assign goederen = period.accounts | range:goederen_range %}
{% ifi goederen.value != 0 %}
{% newline %}
| {% t “Handelsgoederen, grond en hulpstoffen” %} {% input custom.detail.goederen as:account_collection range:global_6_range default:‘60’ %}| |{{ -1goederen.value | currency }}
{% for account in goederen %}
{% $32+ account.value %}
{% newline %}
|      {{ account.name }}|{{ -1
account.value | currency }}
{% endfor %}{% endifi %}
{% assign voorraadwijziging = period.accounts | range:voorraadwijziging_range %}
{% ifi voorraadwijziging.value != 0 or custom.wijziging.voorraad != 0 %}
{% newline %}
| {% t “Voorraadwijziging” %} {% input custom.detail.voorraadwijziging as:account_collection range:global_range default:def_voorraadwijziging %} {% input custom.eindvoorraad.doc as:file %}| |{{voorraadwijziging_rows}}
{% ic %}{% newline %}| {% input custom.begin_eind.show as:boolean %} {% t “Toon beginvoorraad - eindvoorraad boekjaar” %} {% if custom.begin_eind.show == true %}{% input custom.begin_eind.range as:account_collection range:“3” %} {% unexplained wijziging_in_voorraad+(beginvoorraad-eindvoorraad) as:indicator %}{% endif %}
{% endic %}
{% if custom.begin_eind.show == true %}{% newline %}
|       {% t “Beginvoorraad” %} | {% input custom.voorraad.begin as:currency placeholder_default:acccounts_begin.value %}{% newline %}
|       {% t “Eindvoorraad” %} | {% input custom.voorraad.eind as:currency placeholder_default:acccounts_eind.value %}
{% endif %}{% endifi %}

{% assign WIUwijziging = period.accounts | range: WIUwijziging_range %}
{% ifi WIUwijziging.value != 0 or custom.wijziging.WIU != 0 %}
{% newline %}
| {% t “WIUwijziging” %} {% input custom.detail.WIUwijziging as:account_collection range:global_range default:def_WIUwijziging %} {% input custom.WIUeinde.doc as:file %}| |{{WIUwijziging_rows}}
{% ic %}{% newline %}| {% input custom.begin_eindwiu.show as:boolean %} {% t “Toon WIUbegin - WIUeinde boekjaar” %} {% if custom.begin_eindwiu.show == true %}{% input custom.WIUbegin_eind.range as:account_collection range:“3” %} {% unexplained wijzinging_in_WIU+(WIUbegin-WIUeinde) as:indicator %}{% endif %}
{% endic %}
{% if custom.begin_eindwiu.show == true %}{% newline %}
|       {% t “WIUbegin” %} | {% input custom.WIU.begin as:currency placeholder_default:acccounts_begin.value %}{% newline %}
|       {% t “WIUeind” %} | {% input custom.WIU.eind as:currency placeholder_default:acccounts_eind.value %}
{% endif %}{% endifi %}
{% newline %}
| {% t “Verkochte goederen” %}|||{%=$10+ (-1*goederen.value+wijziging_in_voorraad) | currency %}
{% newline %}
| {% t “Brutowinst” %} ||| {{ $10 | currency }}{% ifi custom.detail.sociale_bijdrage != blank %}
{% newline %}
| {% t “Sociale bijdragen” %} {% input custom.detail.sociale_bijdrage as:account_collection range:global_6_range %} {% input custom.sociale_bijdrage.doc as:file %}| | | {%=$10+ -1sociale_bijdrage.value | currency %}{% result ‘sociale_bijdrage’ -1sociale_bijdrage.value %}{% endifi %}{% ifi custom.detail.echtgenote != blank %}
{% newline %}
| {% t “Toekenning meewerkende echtgeno(o)t(e)” %} {% input custom.detail.echtgenote as:account_collection range:global_6_range %} {% input custom.echtgenoot.doc as:file %} | | | {%=$10+ -1echtgenote.value | currency %}{% result ‘echtgenote’ -1echtgenote.value %}
{% endifi %}
{% assign bruto_winst = $10 %}

| {% fori extra_kost in custom.extra_kosten %}
{% newline %}
|{% input extra_kost.name %} {% input extra_kost.accounts as:account_collection range:global_range %}{% input extra_kost.doc as:file %} | | |{% assign accounts = period.accounts.include_zeros | range:extra_kost.accounts %}{% if extra_kost.accounts != blank %}{% =$10+ accounts.value*-1 %}{% else %}{% $10+input extra_kost.value as:currency default:-1accounts.value %}{% endif %}
{% endfori %}
{% newline %}
| {% t “Kosten” %} | | |{% =$10+ $1 %}
{% newline %}
| {% t “Nettoresultaat” %} | | | {{ $10 | currency }}
{% newline %}
|
| {% fori extra_account in custom.extra_accounts %}
{% newline %}
|{% input extra_account.name %} {% input extra_account.accounts as:account_collection range:global_range %}{% input extra_account.doc as:file %} | | |{% assign accounts = period.accounts.include_zeros | range:extra_account.accounts %}{% if extra_account.accounts != blank %}{% =$10+ accounts.value
-1 %}{% else %}{% $10+input extra_account.value as:currency default:-1*accounts.value %}{% endif %}
{% endfori %}
|
{% endstripnewlines %}

{% newpage %}

{{ table }}

{% assign accounts = period.accounts.include_zeros | range:‘6,7’ %}
{% assign count_6_7 = accounts.count %}
{% assign toegewezen = toegewezen | remove:"$" %}
{% assign count_toegewezen = toegewezen | split:";" %}
{% assign toegewezen_range = count_toegewezen | join:"," %}
{% assign count_toegewezen = count_toegewezen.size %}

{% assign toegewezen_bedrag = period.accounts | range:toegewezen_range %}

{% assign niet_toegewezen = #6+#7-toegewezen_bedrag.value %}

{% ic %}
{% t “Niet toegewezen bedrag” %} {{ niet_toegewezen | currency }} {% unexplained niet_toegewezen as:indicator %}

{% if count_6_7 > count_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 %}

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

{% stripnewlines %}

------

{% newline %}
| {% t “Extra toelichting” %}
| {% input custom.extra.bijlage as:file placeholder:’’ %}
{% endstripnewlines %}

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

Hi Stephanie

I looked at the code, and I’m not sure if I understand your question correctly.

  • If you want the outcome of the initial and final stock = change in the stock, you should select the 6-account where the change of the stock is booked by using the # . Then the field which you indicated will be filled in with the value of the account you selected.

  • if you want that the field is automatically calculated (final stock - initial stock), you can change the code as follow :
    |       {% t "Beginvoorraad" %} | {%=$33+input custom.voorraad.begin as:currency placeholder_default:acccounts_begin.value %}{% newline %} |       {% t "Eindvoorraad" %} | {%=$34+input custom.voorraad.eind as:currency placeholder_default:acccounts_eind.value %} {{ $34-$33 }}

Does this helps you further?

In the future, if you paste code, please make sure to place it between quotes. How to, you can read here : https://community.silverfin.com/t/how-to-paste-your-code-in-a-community-post/

Kind regards
Sofie

Hi,
I managed to get the result of the stock. but the WIU does not want to succeed yet. Would you to look at the code if there is an error?

{% t= "Detail van de kosten" fr:"Les Détails des frais" en:"Detail of all costs" %} {% 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= "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= "Werken in uitvoering" fr:"Travaux en cours" en:"Work in progress" %}

{% t= "Voorraadwijziging" fr:"Changement de stock" en:"Change in stocks" %} {% t= "Toon beginvoorraad - eindvoorraad boekjaar" fr:"Afficher le stock initial - le stock final de l'exercice" en:"Show initial - final stock for the financial year"%} {% t= "Beginvoorraad" fr:"Stock initial" en:"Initial stock" %} {% t= "Eindvoorraad" fr:"Stock final" en:"Final stock" %}

{% t= "WIU" fr:"Changement de stock" en:"Change in stocks" %} {% t= "Toon WIUbegin - WIUeinde boekjaar" fr:"Afficher le stock initial - le stock final de l'exercice" en:"Show initial - final stock for the financial year"%} {% t= "WIUbegin" fr:"Stock initial" en:"Initial stock" %} {% t= "WIUeinde" fr:"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 spouse" %} {% 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= "Onderaannemingen" fr:"Les fournitures et les services" en:"Supplies and services" %} {% t= "Huurlasten en onderhoudskosten" fr:"La location et les frais de location" en:"Rent and rental expenses" %} {% t= "Leveringen" fr:"Les fournitures et les services" en:"Supplies and services" %} {% t= "Vergoeding aan derden" fr:"Les frais de tiers" en:"Remuneration to third parties" %} {% t= "Vervoer en aanverwante kosten" fr:"Les fournitures et les services" en:"Supplies and services" %} {% t= "Verkoopskosten" fr:"Les fournitures et les services" en:"Supplies and services" %} {% t= "Communicatie" fr:"Les fournitures et les services" en:"Supplies and services" %} {% t= "Bezoldigingen" fr:"Les fournitures et les services" en:"Supplies and services" %} {% t= "Werkgeversbijdragen" fr:"Les fournitures et les services" en:"Supplies and services" %} {% t= "Andere personeelskosten" fr:"Les fournitures et les services" en:"Supplies and services" %} {% t= "Afschrijvingen" fr:"Les fournitures et les services" en:"Supplies and services" %} {% t= "Bedrijfsbelastingen" fr:"Les fournitures et les services" en:"Supplies and services" %} {% t= "Kosten van schulden" fr:"Les fournitures et les services" en:"Supplies and services" %} {% t= "Uitzonderlijke kosten" fr:"Les fournitures et les services" en:"Supplies and services" %}

{% 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 %} {% assign cost_categories_string = "Onderaannemingen|Huurlasten en onderhoudskosten|Leveringen|Vergoeding aan derden|Vervoer en aanverwante kosten|Verkoopskosten|Communicatie|Bezoldigingen|Werkgeversbijdragen|Andere personeelskosten|Afschrijvingen|Bedrijfsbelastingen|Kosten van schulden|Uitzonderlijke kosten|" %} {% assign cost_keys_string = "onderaannemingen|huurlasten|leveringen|vergoeding|vervoer|verkoopskosten|communicatie|bezoldigingen|werkgeversbijdragen|andere personeelskosten|afschrijvingen|bedrijfsbelastingen|kosten|uitzonderlijke|" %} {% endif %}

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

{% if cost_keys_string != blank %} {% assign cost_keys = cost_keys_string | split:"|" %} {% endif %}

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

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

{% for cost_category in cost_categories %} {% if cost_keys_string != blank %} {% assign category_key = cost_keys[forloop.index0] %} {% else %} {% assign category_key = cost_category | replace:" ","_" | downcase %} {% endif %}

{% assign costs_range = custom[category_key].selected | default:custom[category_key].accounts %}

{% assign costs = period.accounts.include_zeros | range:costs_range %} {% for account in costs %} {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %} {% endfor %} {% endfor %}

{% assign omzet_range = custom.detail.omzet | default:"70" %} {% assign omzet = period.accounts.include_zeros| range:omzet_range %} {% for account in omzet %} {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %} {% endfor %}

{% assign goederen_range = custom.detail.goederen | default:"60" %} {% assign goederen = period.accounts.include_zeros| range:goederen_range %} {% for account in goederen %} {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %} {% endfor %}

{% comment %} voorraadwijziging {% endcomment %}

{% assign beginvoorraad = period.accounts.include_zeros | range:custom.detail.beginvoorraad %} {% for account in beginvoorraad %} {% assign def_beginvoorraad = def_beginvoorraad | append:account.number %} {% unless forloop.last %} {% assign def_beginvoorraad = def_beginvoorraad | append:"," %} {% endunless %} {% endfor %}

{% assign eindvoorraad = period.accounts.include_zeros| range:custom.detail.eindvoorraad %} {% for account in eindvoorraad %} {% assign def_eindvoorraad = def_eindvoorraad | append: account.number %} {% unless forloop.last %} {% assign def_eindvoorraad = def_eindvoorraad | append:"," %} {% endunless %} {% endfor %}

{% assign def_voorraadwijziging = def_beginvoorraad | append:"," | append:def_eindvoorraad %}

{% assign acccounts_begin = period.minus_1y.accounts | range:custom.begin_eind.range %} {% assign beginvoorraad = custom.voorraad.begin | default:acccounts_begin.value %}

{% assign acccounts_eind = period.accounts | range:custom.begin_eind.range %} {% assign eindvoorraad = custom.voorraad.eind | default:acccounts_eind.value %}

{% assign voorraadwijziging_range = custom.detail.voorraadwijziging | default:def_voorraadwijziging %} {% assign voorraadwijziging = period.accounts.include_zeros | range:voorraadwijziging_range %} {% capture voorraadwijziging_rows %}{% input custom.wijziging.voorraad as:currency default:-1*voorraadwijziging.value %} {% assign wijziging_in_voorraad = custom.wijziging.voorraad | default:-1*voorraadwijziging.value %}{% result 'voorraadwijziging' wijziging_in_voorraad %} {% for account in voorraadwijziging %} {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %} {% endfor %} {% endcapture %}

{% comment %} WIUwijziging {% endcomment %}

{% assign WIUbegin = period.accounts.include_zeros | range:custom.detail.WIUbegin %} {% for account in WIUbegin %} {% assign def_WIUbegin = def_WIUbegin | append:account.number %} {% unless forloop.last %} {% assign def_WIUbegin = def_WIUbegin | append:"," %} {% endunless %} {% endfor %}

{% assign WIUeinde = period.accounts.include_zeros| range:custom.detail.WIUeinde %} {% for account in WIUeinde %} {% assign def_WIUeinde = def_WIUeinde | append: account.number %} {% unless forloop.last %} {% assign def_WIUeinde = def_WIUeinde | append:"," %} {% endunless %} {% endfor %}

{% assign def_WIUwijziging = def_WIUbegin | append:"," | append:def_WIUeinde %}

{% assign acccounts_begin = period.minus_1y.accounts | range:custom.begin_einde.range %} {% assign WIUbegin = custom.WIU.begin | default:acccounts_begin.value %}

{% assign acccounts_einde = period.accounts | range:custom.begin_einde.range %} {% assign WIUeinde = custom.WIU.einde | default:acccounts_einde.value %}

{% assign WIUwijziging_range = custom.detail.WIUwijziging | default:def_WIUwijziging %} {% assign WIUwijziging = period.accounts.include_zeros | range:WIUwijziging_range %} {% capture WIUwijziging_rows %}{% input custom.wijziging.WIU as:currency default:-1*WIUwijziging.value %} {% assign wijziging_in_WIU = custom.wijziging.WIU | default:-1*WIUwijziging.value %}{% result 'WIUwijziging' wijziging_in_WIU %} {% for account in WIUwijziging %} {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %} {% endfor %} {% endcapture %}

{% assign sociale_bijdrage = period.accounts.include_zeros| range:custom.detail.sociale_bijdrage %} {% for account in sociale_bijdrage %} {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %} {% endfor %}

{% assign echtgenote = period.accounts.include_zeros| range:custom.detail.echtgenote %} {% for account in echtgenote %} {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %} {% endfor %}

{% for extra_kost in custom.extra_kosten %} {% assign accounts = period.accounts.include_zeros | range:extra_kost.accounts %} {% for account in accounts %} {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %} {% endfor %} {% endfor %}

{% for extra_account in custom.extra_accounts %} {% assign accounts = period.accounts.include_zeros | range:extra_account.accounts %} {% for account in accounts %} {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %} {% endfor %} {% endfor %}

{% assign global_6_range = "" %} {% assign accounts = period.accounts.include_zeros | range:'6' %}

{% for account in accounts %} {% assign numberwithdollar = account.number | prepend:"$" | append:"$" %} {% unless toegewezen contains numberwithdollar %} {% unless global_6_range == blank %}{% assign global_6_range = global_6_range | append:"," %}{% endunless %} {% assign global_6_range = global_6_range | append:account.number %} {% endunless%} {% endfor %}

{% assign global_7_range = "" %} {% assign accounts = period.accounts.include_zeros | range:'7' %}

{% for account in accounts %} {% assign numberwithdollar = account.number | prepend:"$" | append:"$" %} {% unless toegewezen contains numberwithdollar %} {% unless global_7_range == blank %}{% assign global_7_range = global_7_range | append:"," %}{% endunless %} {% assign global_7_range = global_7_range | append:account.number %} {% endunless%} {% endfor %}

{% assign global_range = global_6_range | append:"," | append:global_7_range %}

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

{% capture table %}


{% stripnewlines %} {{ header }} {% newline %} | **{% t "Detail van de kosten" %}** | **{{ period.year_end_date | date:'%Y' }}** | **{% t "Beroeps-<br />beperking" %}**<br />**({% t "aftrekbaar" %})** | **{% t "Fiscale beperking" %}**<br />**({% t "aftrekbaar" %})** | **{% t "Aftrekbaar" %}** {% newline %} {% newline %}

{% newline %} {% newline %} {% for cost_category in cost_categories %} {% assign $11 = 0 %} {% assign $12 = 0 %} {% assign $13 = 0 %} {% if cost_keys_string != blank %} {% assign category_key = cost_keys[forloop.index0] %} {% else %} {% assign category_key = cost_category | replace:" ","_" | downcase %} {% endif %}

{% assign costs_range = custom[category_key].selected | default:custom[category_key].accounts %}

{% ifi costs_range != blank %} {% newline %} | **{% t cost_category %}** {% input custom[category_key].accounts as:account_collection range:global_range %} |

{% ic %}{% assign costs = period.accounts.include_zeros | range:costs_range %}{% endic %} {% nic %}{% assign costs = period.accounts | range:costs_range %}{% endnic %}

{% newline %} {{ header }} {% newline %} {% for account in costs %} {% assign vin_old = 1-custom[account.number].vin %} {% assign beperking_old = 1-custom[account.number].beperking %} {% assign vin_new = custom[account.number].vin_new | default:vin_old %} {% if vin_new == blank %} {% assign vin = 0 %} {% else %} {% assign vin = vin_new %} {% endif %}

`{% assign beperking_new = custom[account.number].beperking_new | default:beperking_old %}
{% if beperking_new == blank %}
  {% assign beperking = 0 %}
{% else %}
  {% assign beperking = beperking_new %}
{% endif %}`

`| {{ account.name }}
| {%=$11+ -1*account.value as:currency %}
| {% input custom[account.number].vin_new as:percentage placeholder:'0.00%' default:vin_old %}
| {% input custom[account.number].beperking_new as:percentage placeholder:'0.00%' default:beperking_old %}
| {{ -1*vin*beperking*account.value | currency }}
  {% $13+ -1*vin*beperking*account.value | currency: 2 %}
{% newline %}
{% if forloop.last %}
  |     
  | **{% =$21+ $11 as:currency %}** 
  |
  |
  | **{% =$23+ $13 as:currency %}** {% $1+ $13 as:currency %}
  {% result category_key $13 %}|
{% newline %}
{% endif %}

{% endfor %}
{% newline %}
{% endifi %}
{% endfor %}
{% newline %}
{% newline %}`

{% newline %} {% newline %} {% endstripnewlines %}

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


{% endcapture %}

{% stripnewlines %}{% newline %}|---------------------|-------15%-------:|-------15%-------:|-------15%-------:+{% newline %}
| {% t "Ontvangsten/Baten" %} {% input custom.detail.omzet as:account_collection range:global_7_range default:'70' %}| | | {%=$10+ -1*omzet.value | currency %} {% assign omzet = period.accounts | range:omzet_range %} {% for account in omzet %} {% $31+ account.value %} {% newline %} | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}
{% endfor %} {% newline %} |{% assign goederen = period.accounts | range:goederen_range %} {% ifi goederen.value != 0 %} {% newline %} | {% t "Handelsgoederen, grond en hulpstoffen" %} {% input custom.detail.goederen as:account_collection range:global_6_range default:'60' %}| |{{ -1*goederen.value | currency }} {% for account in goederen %} {% $32+ account.value %} {% newline %} | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }} {% endfor %}{% endifi %} {% assign voorraadwijziging = period.accounts | range:voorraadwijziging_range %} {% ifi voorraadwijziging.value != 0 or custom.wijziging.voorraad != 0 %} {% newline %} | {% t "Voorraadwijziging" %} {% input custom.detail.voorraadwijziging as:account_collection range:global_range default:def_voorraadwijziging %} {% input custom.eindvoorraad.doc as:file %}| |{{voorraadwijziging_rows}} {% ic %}{% newline %}| {% input custom.begin_eind.show as:boolean %} {% t "Toon beginvoorraad - eindvoorraad boekjaar" %} {% if custom.begin_eind.show == true %}{% input custom.begin_eind.range as:account_collection range:"3" %} {% unexplained wijziging_in_voorraad+(beginvoorraad-eindvoorraad) as:indicator %}{% endif %} {% endic %} {% if custom.begin_eind.show == true %}{% newline %} | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% t "Beginvoorraad" %} | {% input custom.voorraad.begin as:currency placeholder_default:acccounts_begin.value %}{% newline %} | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% t "Eindvoorraad" %} | {% input custom.voorraad.eind as:currency placeholder_default:acccounts_eind.value %} {% endif %}{% endifi %} {% assign WIUwijziging = period.accounts | range: WIUwijziging_range %} {% ifi WIUwijziging.value != 0 or custom.wijziging.WIU != 0 %} {% newline %} | {% t "WIUwijziging" %} {% input custom.detail.WIUwijziging as:account_collection range:global_range default:def_WIUwijziging %} {% input custom.WIUeinde.doc as:file %}| |{{WIUwijziging_rows}} {% ic %}{% newline %}| {% input custom.begin_einde.show as:boolean %} {% t "Toon WIUbegin - WIUeinde boekjaar" %} {% if custom.begin_einde.show == true %}{% input custom.begin_einde.range as:account_collection range:"3" %} {% unexplained wijzinging_in_WIU+(WIUbegin-WIUeinde) as:indicator %}{% endif %} {% endic %} {% if custom.begin_einde.show == true %}{% newline %} | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% t "WIUbegin" %} | {% input custom.WIU.begin as:currency placeholder_default:acccounts_begin.value %}{% newline %} | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% t "WIUeinde" %} | {% input custom.WIU.einde as:currency placeholder_default:acccounts_einde.value %} {% endif %}{% endifi %} {% newline %} | {% t "Verkochte goederen" %}|||_{%=$10+ (-1*goederen.value+wijziging_in_voorraad+wijziging_in_WIU) | currency %}_ {% newline %} | **{% t "Brutowinst" %}** ||| **{{ $10 | currency }}**{% ifi custom.detail.sociale_bijdrage != blank %} {% newline %} | {% t "Sociale bijdragen" %} {% input custom.detail.sociale_bijdrage as:account_collection range:global_6_range %} {% input custom.sociale_bijdrage.doc as:file %}| | | {%=$10+ -1*sociale_bijdrage.value | currency %}{% result 'sociale_bijdrage' -1*sociale_bijdrage.value %}{% endifi %}{% ifi custom.detail.echtgenote != blank %} {% newline %} | {% t "Toekenning meewerkende echtgeno(o)t(e)" %} {% input custom.detail.echtgenote as:account_collection range:global_6_range %} {% input custom.echtgenoot.doc as:file %} | | | {%=$10+ -1*echtgenote.value | currency %}{% result 'echtgenote' -1*echtgenote.value %} {% endifi %} {% assign bruto_winst = $10 %}

| {% fori extra_kost in custom.extra_kosten %} {% newline %} |{% input extra_kost.name %} {% input extra_kost.accounts as:account_collection range:global_range %}{% input extra_kost.doc as:file %} | | |{% assign accounts = period.accounts.include_zeros | range:extra_kost.accounts %}{% if extra_kost.accounts != blank %}{% =$10+ accounts.value*-1 %}{% else %}{% $10+input extra_kost.value as:currency default:-1*accounts.value %}{% endif %} {% endfori %} {% newline %} | {% t "Kosten" %} | | |_{% =$10+ $1 %}_ {% newline %} | **{% t "Nettoresultaat" %}** | | | **{{ $10 | currency }}** {% newline %}
|
| {% fori extra_account in custom.extra_accounts %} {% newline %} |{% input extra_account.name %} {% input extra_account.accounts as:account_collection range:global_range %}{% input extra_account.doc as:file %} | | |{% assign accounts = period.accounts.include_zeros | range:extra_account.accounts %}{% if extra_account.accounts != blank %}{% =$10+ accounts.value*-1 %}{% else %}{% $10+input extra_account.value as:currency default:-1*accounts.value %}{% endif %} {% endfori %} |
{% endstripnewlines %}

{% newpage %}

{{ table }}

{% assign accounts = period.accounts.include_zeros | range:'6,7' %} {% assign count_6_7 = accounts.count %} {% assign toegewezen = toegewezen | remove:"$" %} {% assign count_toegewezen = toegewezen | split:";" %} {% assign toegewezen_range = count_toegewezen | join:"," %} {% assign count_toegewezen = count_toegewezen.size %}

{% assign toegewezen_bedrag = period.accounts | range:toegewezen_range %}

{% assign niet_toegewezen = #6+#7-toegewezen_bedrag.value %}

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

{% if count_6_7 > count_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 %}

{% 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 @Stephanie,

Could you please post your code between 3 tildes? So before and after your code 3 tildes, like this:
05

which result in this:

{% for acc in accounts %}
 {{ acc }}
{% endfor %} 

and I can copy paste it to see what exactly you need :slightly_smiling_face:

More info here as well:

hi,
Sorry i did it wrong, hopefully it is right now :wink:

{% t= "Detail van de kosten" fr:"Les DĂ©tails des frais" en:"Detail of all costs" %}
{% 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= "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= "Werken in uitvoering" fr:"Travaux en cours" en:"Work in progress" %}


{% t= "Voorraadwijziging" fr:"Changement de stock" en:"Change in stocks" %}
{% t= "Toon beginvoorraad - eindvoorraad boekjaar" fr:"Afficher le stock initial - le stock final de l'exercice" en:"Show initial - final stock for the financial year"%}
{% t= "Beginvoorraad" fr:"Stock initial" en:"Initial stock" %}
{% t= "Eindvoorraad" fr:"Stock final" en:"Final stock" %}

{% t= "WIU" fr:"Changement de stock" en:"Change in stocks" %}
{% t= "Toon WIUbegin - WIUeinde boekjaar" fr:"Afficher le stock initial - le stock final de l'exercice" en:"Show initial - final stock for the financial year"%}
{% t= "WIUbegin" fr:"Stock initial" en:"Initial stock" %}
{% t= "WIUeinde" fr:"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 spouse" %}
{% 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= "Onderaannemingen" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Huurlasten en onderhoudskosten" fr:"La location et les frais de location" en:"Rent and rental expenses" %}
{% t= "Leveringen" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Vergoeding aan derden" fr:"Les frais de tiers" en:"Remuneration to third parties" %}
{% t= "Vervoer en aanverwante kosten" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Verkoopskosten" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Communicatie" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Bezoldigingen" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Werkgeversbijdragen" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Andere personeelskosten" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Afschrijvingen" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Bedrijfsbelastingen" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Kosten van schulden" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Uitzonderlijke kosten" fr:"Les fournitures et les services" en:"Supplies and services" %}

{% 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 %}
  {% assign cost_categories_string = "Onderaannemingen|Huurlasten en onderhoudskosten|Leveringen|Vergoeding aan derden|Vervoer en aanverwante kosten|Verkoopskosten|Communicatie|Bezoldigingen|Werkgeversbijdragen|Andere personeelskosten|Afschrijvingen|Bedrijfsbelastingen|Kosten van schulden|Uitzonderlijke kosten|" %}
  {% assign cost_keys_string = "onderaannemingen|huurlasten|leveringen|vergoeding|vervoer|verkoopskosten|communicatie|bezoldigingen|werkgeversbijdragen|andere personeelskosten|afschrijvingen|bedrijfsbelastingen|kosten|uitzonderlijke|" %}
{% endif %}

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

{% if cost_keys_string != blank %}
  {% assign cost_keys = cost_keys_string | split:"|" %}
{% endif %}

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

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


{% for cost_category in cost_categories %}
  {% if cost_keys_string != blank %}
    {% assign category_key = cost_keys[forloop.index0] %}
  {% else %}
    {% assign category_key = cost_category | replace:" ","_" | downcase %}
  {% endif %}
  
  {% assign costs_range = custom[category_key].selected | default:custom[category_key].accounts %}
  
  {% assign costs = period.accounts.include_zeros | range:costs_range %}
  {% for account in costs %}
    {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
  {% endfor %}
{% endfor %}

{% assign omzet_range = custom.detail.omzet | default:"70" %}
{% assign omzet = period.accounts.include_zeros| range:omzet_range %}
{% for account in omzet %}
  {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
{% endfor %}

{% assign goederen_range = custom.detail.goederen | default:"60" %}
{% assign goederen = period.accounts.include_zeros| range:goederen_range %}
{% for account in goederen %}
  {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
{% endfor %}

{% comment %} voorraadwijziging {% endcomment %}

{% assign beginvoorraad = period.accounts.include_zeros | range:custom.detail.beginvoorraad %} 
{% for account in beginvoorraad %}
  {% assign def_beginvoorraad = def_beginvoorraad | append:account.number %}
  {% unless forloop.last %}
    {% assign def_beginvoorraad = def_beginvoorraad | append:"," %}
  {% endunless %}
{% endfor %}

{% assign eindvoorraad = period.accounts.include_zeros| range:custom.detail.eindvoorraad %}
{% for account in eindvoorraad %}
  {% assign def_eindvoorraad = def_eindvoorraad  | append: account.number %}
  {% unless forloop.last %}
    {% assign def_eindvoorraad = def_eindvoorraad | append:"," %}
  {% endunless %}
{% endfor %}

{% assign def_voorraadwijziging = def_beginvoorraad  | append:"," | append:def_eindvoorraad %}

{% assign acccounts_begin = period.minus_1y.accounts | range:custom.begin_eind.range %}
{% assign beginvoorraad = custom.voorraad.begin | default:acccounts_begin.value %}

{% assign acccounts_eind = period.accounts | range:custom.begin_eind.range %}
{% assign eindvoorraad = custom.voorraad.eind | default:acccounts_eind.value %}

{% assign voorraadwijziging_range = custom.detail.voorraadwijziging | default:def_voorraadwijziging %}
{% assign voorraadwijziging = period.accounts.include_zeros | range:voorraadwijziging_range %}
{% capture voorraadwijziging_rows %}{% input custom.wijziging.voorraad as:currency default:-1*voorraadwijziging.value %} {% assign wijziging_in_voorraad = custom.wijziging.voorraad | default:-1*voorraadwijziging.value %}{% result 'voorraadwijziging' wijziging_in_voorraad %}
{% for account in voorraadwijziging %}
    {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
{% endfor %}
{% endcapture %}

{% comment %} WIUwijziging {% endcomment %}

{% assign WIUbegin = period.accounts.include_zeros | range:custom.detail.WIUbegin %} 
{% for account in WIUbegin %}
  {% assign def_WIUbegin = def_WIUbegin | append:account.number %}
  {% unless forloop.last %}
    {% assign def_WIUbegin = def_WIUbegin | append:"," %}
  {% endunless %}
{% endfor %}

{% assign WIUeinde = period.accounts.include_zeros| range:custom.detail.WIUeinde %}
{% for account in WIUeinde %}
  {% assign def_WIUeinde = def_WIUeinde  | append: account.number %}
  {% unless forloop.last %}
    {% assign def_WIUeinde = def_WIUeinde | append:"," %}
  {% endunless %}
{% endfor %}

{% assign def_WIUwijziging = def_WIUbegin  | append:"," | append:def_WIUeinde %}

{% assign acccounts_begin = period.minus_1y.accounts | range:custom.begin_einde.range %}
{% assign WIUbegin = custom.WIU.begin | default:acccounts_begin.value %}

{% assign acccounts_einde = period.accounts | range:custom.begin_einde.range %}
{% assign WIUeinde = custom.WIU.einde | default:acccounts_einde.value %}

{% assign WIUwijziging_range = custom.detail.WIUwijziging | default:def_WIUwijziging %}
{% assign WIUwijziging = period.accounts.include_zeros | range:WIUwijziging_range %}
{% capture WIUwijziging_rows %}{% input custom.wijziging.WIU as:currency default:-1*WIUwijziging.value %} {% assign wijziging_in_WIU = custom.wijziging.WIU | 
default:-1*WIUwijziging.value %}{% result 'WIUwijziging' wijziging_in_WIU %}
{% for account in WIUwijziging %}
    {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
{% endfor %}
{% endcapture %}

{% assign sociale_bijdrage = period.accounts.include_zeros| range:custom.detail.sociale_bijdrage %}
{% for account in sociale_bijdrage %}
{% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
{% endfor %}

{% assign echtgenote = period.accounts.include_zeros| range:custom.detail.echtgenote %}
{% for account in echtgenote %}
  {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
{% endfor %}

{% for extra_kost in custom.extra_kosten %}
  {% assign accounts = period.accounts.include_zeros | range:extra_kost.accounts %}
  {% for account in accounts %}
  {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
  {% endfor %}
{% endfor %}

{% for extra_account in custom.extra_accounts %}
  {% assign accounts = period.accounts.include_zeros | range:extra_account.accounts %}
  {% for account in accounts %}
  {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
  {% endfor %}
{% endfor %}
  
{% assign global_6_range = "" %}
{% assign accounts = period.accounts.include_zeros | range:'6' %}

{% for account in accounts %}
{% assign numberwithdollar = account.number | prepend:"$" | append:"$" %} 
  {% unless toegewezen contains numberwithdollar %}
    {% unless global_6_range == blank %}{% assign global_6_range = global_6_range | append:"," %}{% endunless %}
    {% assign global_6_range = global_6_range | append:account.number %}
  {% endunless%}
{% endfor %}

{% assign global_7_range = "" %}
{% assign accounts = period.accounts.include_zeros | range:'7' %}

{% for account in accounts %}
{% assign numberwithdollar = account.number | prepend:"$" | append:"$" %}
  {% unless toegewezen contains numberwithdollar %}
    {% unless global_7_range == blank %}{% assign global_7_range = global_7_range | append:"," %}{% endunless %}
    {% assign global_7_range = global_7_range | append:account.number %}
  {% endunless%}
{% endfor %}

{% assign global_range = global_6_range | append:"," | append:global_7_range %}


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

{% capture table %}

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

{% stripnewlines %}
{{ header }}
{% newline %}
| **{% t "Detail van de kosten" %}**    
| **{{ period.year_end_date | date:'%Y' }}**
| **{% t "Beroeps-<br />beperking" %}**<br />**({% t "aftrekbaar" %})**
| **{% t "Fiscale beperking" %}**<br />**({% t "aftrekbaar" %})**
| **{% t "Aftrekbaar" %}**                      
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% for cost_category in cost_categories %}
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
    {% if cost_keys_string != blank %}
    {% assign category_key = cost_keys[forloop.index0] %}
  {% else %}
    {% assign category_key = cost_category | replace:" ","_" | downcase %}
  {% endif %}
  
  {% assign costs_range = custom[category_key].selected | default:custom[category_key].accounts %}

    {% ifi costs_range != blank %}
{% newline %}
  | **{% t cost_category %}** {% input custom[category_key].accounts as:account_collection range:global_range %} |

  
  
  {% ic %}{% assign costs = period.accounts.include_zeros | range:costs_range %}{% endic %}
  {% nic %}{% assign costs = period.accounts | range:costs_range %}{% endnic %}
  
  {% newline %}
  {{ header }}
  {% newline %}
  {% for account in costs %}
    {% assign vin_old = 1-custom[account.number].vin %}
    {% assign beperking_old = 1-custom[account.number].beperking %}
    {% assign vin_new = custom[account.number].vin_new | default:vin_old %}
    {% if vin_new == blank %}
      {% assign vin = 0 %}
    {% else %}
      {% assign vin = vin_new %}
    {% endif %}
    
    {% assign beperking_new = custom[account.number].beperking_new | default:beperking_old %}
    {% if beperking_new == blank %}
      {% assign beperking = 0 %}
    {% else %}
      {% assign beperking = beperking_new %}
    {% endif %}
    
    | {{ account.name }}
    | {%=$11+ -1*account.value as:currency %}
    | {% input custom[account.number].vin_new as:percentage placeholder:'0.00%' default:vin_old %}
    | {% input custom[account.number].beperking_new as:percentage placeholder:'0.00%' default:beperking_old %}
    | {{ -1*vin*beperking*account.value | currency }}
      {% $13+ -1*vin*beperking*account.value | currency: 2 %}
    {% newline %}
    {% if forloop.last %}
      |     
      | **{% =$21+ $11 as:currency %}** 
      |
      |
      | **{% =$23+ $13 as:currency %}** {% $1+ $13 as:currency %}
      {% result category_key $13 %}|
    {% newline %}
    {% endif %}
  {% endfor %}
  {% newline %}
    {% endifi %}
{% endfor %}
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

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

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

{% endcapture %}

{% stripnewlines %}
{% newline %}
|---------------------|-------15%-------:|-------15%-------:|-------15%-------:+
{% newline %}
| {% t "Ontvangsten/Baten" %} {% input custom.detail.omzet as:account_collection range:global_7_range default:'70' %}| | | {%=$10+ -1*omzet.value | currency %}
{% assign omzet = period.accounts | range:omzet_range %}
{% for account in omzet %}
  {% $31+ account.value %}
  {% newline %}
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}
{% endfor %}
{% newline %}
|{% assign goederen = period.accounts | range:goederen_range %}
{% ifi goederen.value != 0 %}
{% newline %}
| {% t "Handelsgoederen, grond en hulpstoffen" %} {% input custom.detail.goederen as:account_collection range:global_6_range default:'60' %}| |{{ -1*goederen.value | currency }}  
{% for account in goederen %}
  {% $32+ account.value %}
  {% newline %}
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}
{% endfor %}{% endifi %}
{% assign voorraadwijziging = period.accounts | range:voorraadwijziging_range %}
{% ifi voorraadwijziging.value != 0 or custom.wijziging.voorraad != 0 %}
{% newline %}
| {% t "Voorraadwijziging" %} {% input custom.detail.voorraadwijziging as:account_collection range:global_range default:def_voorraadwijziging %} {% input custom.eindvoorraad.doc as:file %}| |{{voorraadwijziging_rows}}
{% ic %}{% newline %}| {% input custom.begin_eind.show as:boolean %} {% t "Toon beginvoorraad - eindvoorraad boekjaar" %} {% if custom.begin_eind.show == true %}{% input custom.begin_eind.range as:account_collection range:"3" %} {% unexplained wijziging_in_voorraad+(beginvoorraad-eindvoorraad) as:indicator %}{% endif %}
{% endic %}
{% if custom.begin_eind.show == true %}{% newline %}
| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% t "Beginvoorraad" %} | {% input custom.voorraad.begin as:currency placeholder_default:acccounts_begin.value %}{% newline %}
| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% t "Eindvoorraad" %} |  {% input custom.voorraad.eind as:currency placeholder_default:acccounts_eind.value %}
{% endif %}{% endifi %}
{% assign WIUwijziging = period.accounts | range: WIUwijziging_range %}
{% ifi WIUwijziging.value != 0 or custom.wijziging.WIU != 0 %}
{% newline %}
| {% t "WIUwijziging" %} {% input custom.detail.WIUwijziging as:account_collection range:global_range default:def_WIUwijziging %} {% input custom.WIUeinde.doc as:file %}| |{{WIUwijziging_rows}}
{% ic %}{% newline %}| {% input custom.begin_einde.show as:boolean %} {% t "Toon WIUbegin - WIUeinde boekjaar" %} {% if custom.begin_einde.show == true %}{% input custom.begin_einde.range as:account_collection range:"3" %} {% unexplained wijzinging_in_WIU+(WIUbegin-WIUeinde) as:indicator %}{% endif %}
{% endic %}
{% if custom.begin_einde.show == true %}{% newline %}
| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% t "WIUbegin" %} | {% input custom.WIU.begin as:currency placeholder_default:acccounts_begin.value %}{% newline %}
| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% t "WIUeinde" %} | {% input custom.WIU.einde as:currency placeholder_default:acccounts_einde.value %}
{% endif %}{% endifi %}
{% newline %}
| {% t "Verkochte goederen" %}|||_{%=$10+ (-1*goederen.value+wijziging_in_voorraad+wijziging_in_WIU) | currency %}_
{% newline %}
| **{% t "Brutowinst" %}**        ||| **{{ $10 | currency }}**{% ifi custom.detail.sociale_bijdrage != blank %}
{% newline %}
| {% t "Sociale bijdragen" %} {% input custom.detail.sociale_bijdrage as:account_collection range:global_6_range %} {% input custom.sociale_bijdrage.doc as:file %}| | | {%=$10+ -1*sociale_bijdrage.value | currency %}{% result 'sociale_bijdrage' -1*sociale_bijdrage.value %}{% endifi %}{% ifi custom.detail.echtgenote != blank %}
{% newline %}
  | {% t "Toekenning meewerkende echtgeno(o)t(e)" %} {% input custom.detail.echtgenote as:account_collection range:global_6_range %} {% input custom.echtgenoot.doc as:file %} | | | {%=$10+ -1*echtgenote.value | currency %}{% result 'echtgenote' -1*echtgenote.value %}
  {% endifi %}
  {% assign bruto_winst = $10 %}

  | {% fori extra_kost in custom.extra_kosten %}
    {% newline %}
    |{% input extra_kost.name %} {% input extra_kost.accounts as:account_collection range:global_range %}{% input extra_kost.doc as:file %} | | |{% assign accounts = period.accounts.include_zeros | range:extra_kost.accounts %}{% if extra_kost.accounts != blank %}{% =$10+ accounts.value*-1 %}{% else %}{% $10+input extra_kost.value as:currency default:-1*accounts.value %}{% endif %}
  {% endfori %}
{% newline %}
  | {% t "Kosten" %}              | | |_{% =$10+ $1 %}_
{% newline %}
  | **{% t "Nettoresultaat" %}**      | | | **{{ $10 | currency }}**
{% newline %}
  |
  | {% fori extra_account in custom.extra_accounts %}
    {% newline %}
    |{% input extra_account.name %} {% input extra_account.accounts as:account_collection range:global_range %}{% input extra_account.doc as:file %} | | |{% assign accounts = period.accounts.include_zeros | range:extra_account.accounts %}{% if extra_account.accounts != blank %}{% =$10+ accounts.value*-1 %}{% else %}{% $10+input extra_account.value as:currency default:-1*accounts.value %}{% endif %}
  {% endfori %}
  |
{% endstripnewlines %}

{% newpage %}

{{ table }}

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

{% assign accounts = period.accounts.include_zeros | range:'6,7' %}
{% assign count_6_7 = accounts.count %}
{% assign toegewezen = toegewezen | remove:"$" %}
{% assign count_toegewezen = toegewezen | split:";" %}
{% assign toegewezen_range = count_toegewezen | join:"," %}
{% assign count_toegewezen = count_toegewezen.size %}

{% assign toegewezen_bedrag = period.accounts | range:toegewezen_range %}

{% assign niet_toegewezen = #6+#7-toegewezen_bedrag.value %}

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

{% if count_6_7 > count_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 %}

Yeah, now it worked, thanks :ok_hand: @Stephanie

Looking at the template, let me know what you are trying to do here:

with the WIUWijziging you want to select certain accounts, and display the difference between the end-value current year minus the end-value of last year?
and beneath it, to give the end value current year, as well as the begin value (= end value last year)?

Do I understand that correct? Because it’s a bit weird to have 2 hashtags. There should be only one.

Let me know if I’m correct, and I’ll gladly help you forward

Hi,
I want to get the result as it is with the stock indication.

Okay, perhaps let me show some basic coding on getting the begin and end value from certain accounts, and display the needed amounts:

{% comment %}create account collection with the needed range{% endcomment %}
{% input custom.wiu.range as:account_collection range:"1,2,3" default:"3" %}
{% if custom.wiu.range != blank %}
  {% assign wiu_range = custom.wiu.range %}
{% else %}
  {% assign wiu_range = "3" %}
{% endif %}

{% comment %}show value of selected accounts of last year; it's the begin value of this year{% endcomment %}
{% assign wiu_begin = period.minus_1y.accounts | range:wiu_range %}
Begin-value = {{ wiu_begin | currency  }}

{% comment %}do the same for the end value of current perido{% endcomment %}
{% assign wiu_end = period.accounts | range:wiu_range %}
End-value = {{ wiu_end | currency  }}

{% comment %}calculate the movement of begin to end value{% endcomment %}
{% assign wiu_evolution = wiu_end-wiu_begin %}

The movement is {{ wiu_evolution | currency }} 

Is above something we can work on forward?

Hi Sven,

Thank you for your help.

Would it be possible to create a code such as “stock change”?
I also have the problem that the outcome of WIU is not included in the “verkochte goederen”. How come this?

Hi Stephanie,

I noticed some variables are not defined (custom.detail.WIUbegin and custom.detail.WIUeinde) and a variable is used for both stock change and WIU change (acccounts_begin).

Can you check if your issues are resolved when you update this?

Hi Michiel,

I changed it, but now stock changes do not work anymore. What did I do wrong?

Thank you for the assistance

{% t= "Detail van de kosten" fr:"Les DĂ©tails des frais" en:"Detail of all costs" %}
{% 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= "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= "Werken in uitvoering" fr:"Travaux en cours" en:"Work in progress" %}


{% t= "Voorraadwijziging" fr:"Changement de stock" en:"Change in stocks" %}
{% t= "Toon beginvoorraad - eindvoorraad boekjaar" fr:"Afficher le stock initial - le stock final de l'exercice" en:"Show initial - final stock for the financial year"%}
{% t= "Beginvoorraad" fr:"Stock initial" en:"Initial stock" %}
{% t= "Eindvoorraad" fr:"Stock final" en:"Final stock" %}

{% t= "WIU" fr:"Changement de stock" en:"Change in stocks" %}
{% t= "Toon WIUbegin - WIUeinde boekjaar" fr:"Afficher le stock initial - le stock final de l'exercice" en:"Show initial - final stock for the financial year"%}
{% t= "WIUbegin" fr:"Stock initial" en:"Initial stock" %}
{% t= "WIUeinde" fr:"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 spouse" %}
{% 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= "Onderaannemingen" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Huurlasten en onderhoudskosten" fr:"La location et les frais de location" en:"Rent and rental expenses" %}
{% t= "Leveringen" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Vergoeding aan derden" fr:"Les frais de tiers" en:"Remuneration to third parties" %}
{% t= "Vervoer en aanverwante kosten" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Verkoopskosten" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Communicatie" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Bezoldigingen" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Werkgeversbijdragen" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Andere personeelskosten" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Afschrijvingen" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Bedrijfsbelastingen" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Kosten van schulden" fr:"Les fournitures et les services" en:"Supplies and services" %}
{% t= "Uitzonderlijke kosten" fr:"Les fournitures et les services" en:"Supplies and services" %}

{% 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 %}
  {% assign cost_categories_string = "Onderaannemingen|Huurlasten en onderhoudskosten|Leveringen|Vergoeding aan derden|Vervoer en aanverwante kosten|Verkoopskosten|Communicatie|Bezoldigingen|Werkgeversbijdragen|Andere personeelskosten|Afschrijvingen|Bedrijfsbelastingen|Kosten van schulden|Uitzonderlijke kosten|" %}
  {% assign cost_keys_string = "onderaannemingen|huurlasten|leveringen|vergoeding|vervoer|verkoopskosten|communicatie|bezoldigingen|werkgeversbijdragen|andere personeelskosten|afschrijvingen|bedrijfsbelastingen|kosten|uitzonderlijke|" %}
{% endif %}

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

{% if cost_keys_string != blank %}
  {% assign cost_keys = cost_keys_string | split:"|" %}
{% endif %}

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

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


{% for cost_category in cost_categories %}
  {% if cost_keys_string != blank %}
    {% assign category_key = cost_keys[forloop.index0] %}
  {% else %}
    {% assign category_key = cost_category | replace:" ","_" | downcase %}
  {% endif %}
  
  {% assign costs_range = custom[category_key].selected | default:custom[category_key].accounts %}
  
  {% assign costs = period.accounts.include_zeros | range:costs_range %}
  {% for account in costs %}
    {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
  {% endfor %}
{% endfor %}

{% assign omzet_range = custom.detail.omzet | default:"70" %}
{% assign omzet = period.accounts.include_zeros| range:omzet_range %}
{% for account in omzet %}
  {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
{% endfor %}

{% assign goederen_range = custom.detail.goederen | default:"60" %}
{% assign goederen = period.accounts.include_zeros| range:goederen_range %}
{% for account in goederen %}
  {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
{% endfor %}

{% comment %} voorraadwijziging {% endcomment %}

{% assign beginvoorraad = period.accounts.include_zeros | range:custom.detail.beginvoorraad %} 
{% for account in beginvoorraad %}
  {% assign def_beginvoorraad = def_beginvoorraad | append:account.number %}
  {% unless forloop.last %}
    {% assign def_beginvoorraad = def_beginvoorraad | append:"," %}
  {% endunless %}
{% endfor %}

{% assign eindvoorraad = period.accounts.include_zeros| range:custom.detail.eindvoorraad %}
{% for account in eindvoorraad %}
  {% assign def_eindvoorraad = def_eindvoorraad  | append: account.number %}
  {% unless forloop.last %}
    {% assign def_eindvoorraad = def_eindvoorraad | append:"," %}
  {% endunless %}
{% endfor %}

{% assign def_voorraadwijziging = def_beginvoorraad  | append:"," | append:def_eindvoorraad %}

{% assign acccounts_begin = period.minus_1y.accounts | range:custom.begin_eind.range %}
{% assign beginvoorraad = custom.voorraad.begin | default:acccounts_begin.value %}

{% assign acccounts_eind = period.accounts | range:custom.begin_eind.range %}
{% assign eindvoorraad = custom.voorraad.eind | default:acccounts_eind.value %}

{% assign voorraadwijziging_range = custom.detail.voorraadwijziging | default:def_voorraadwijziging %}
{% assign voorraadwijziging = period.accounts.include_zeros | range:voorraadwijziging_range %}
{% capture voorraadwijziging_rows %}{% input custom.wijziging.voorraad as:currency default:-1*voorraadwijziging.value %} {% assign wijziging_in_voorraad = custom.wijziging.voorraad | default:-1*voorraadwijziging.value %}{% result 'voorraadwijziging' wijziging_in_voorraad %}
{% for account in voorraadwijziging %}
    {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
{% endfor %}
{% endcapture %}

{% comment %} WIUwijziging {% endcomment %}

{% assign WIUbegin = period.accounts.include_zeros | range:custom.detail.WIUbegin %} 
{% for account in WIUbegin %}
  {% assign def_WIUbegin = def_WIUbegin | append:account.number %}
  {% unless forloop.last %}
    {% assign def_WIUbegin = def_WIUbegin | append:"," %}
  {% endunless %}
{% endfor %}

{% assign WIUeinde = period.accounts.include_zeros| range:custom.detail.WIUeinde %}
{% for account in WIUeinde %}
  {% assign def_WIUeinde = def_WIUeinde  | append: account.number %}
  {% unless forloop.last %}
    {% assign def_WIUeinde = def_WIUeinde | append:"," %}
  {% endunless %}
{% endfor %}

{% assign def_WIUwijziging = def_WIUbegin  | append:"," | append:def_WIUeinde %}

{% assign accounts_WIUbegin = period.minus_1y.accounts | range:custom.WIUbegin_WIUeind.range %}
{% assign WIUbegin = custom.begin.WIU | default:acccounts_WIUbegin.value %}

{% assign accounts_WIUeinde = period.accounts | range:custom.WIUbegin_WIUeind.range %}
{% assign WIUeinde = custom.einde.WIU | default:acccounts_WIUeind.value %}

{% assign WIUwijziging_range = custom.detail.WIUwijziging | default:def_WIUwijziging %}
{% assign WIUwijziging = period.accounts.include_zeros | range:WIUwijziging_range %}
{% capture WIUwijziging_rows %}{% input custom.wijziging.WIU as:currency default:-1*WIUwijziging.value %} {% assign wijziging_in_WIU = custom.wijziging.WIU | 
default:-1*WIUwijziging.value %}{% result 'WIUwijziging' wijziging_in_WIU %}
{% for account in WIUwijziging %}
    {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
{% endfor %}
{% endcapture %}


{% assign sociale_bijdrage = period.accounts.include_zeros| range:custom.detail.sociale_bijdrage %}
{% for account in sociale_bijdrage %}
{% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
{% endfor %}

{% assign echtgenote = period.accounts.include_zeros| range:custom.detail.echtgenote %}
{% for account in echtgenote %}
  {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
{% endfor %}

{% for extra_kost in custom.extra_kosten %}
  {% assign accounts = period.accounts.include_zeros | range:extra_kost.accounts %}
  {% for account in accounts %}
  {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
  {% endfor %}
{% endfor %}

{% for extra_account in custom.extra_accounts %}
  {% assign accounts = period.accounts.include_zeros | range:extra_account.accounts %}
  {% for account in accounts %}
  {% assign toegewezen = toegewezen | append:"$" | append: account.number | append:"$;" %}
  {% endfor %}
{% endfor %}
  
{% assign global_6_range = "" %}
{% assign accounts = period.accounts.include_zeros | range:'6' %}

{% for account in accounts %}
{% assign numberwithdollar = account.number | prepend:"$" | append:"$" %} 
  {% unless toegewezen contains numberwithdollar %}
    {% unless global_6_range == blank %}{% assign global_6_range = global_6_range | append:"," %}{% endunless %}
    {% assign global_6_range = global_6_range | append:account.number %}
  {% endunless%}
{% endfor %}

{% assign global_7_range = "" %}
{% assign accounts = period.accounts.include_zeros | range:'7' %}

{% for account in accounts %}
{% assign numberwithdollar = account.number | prepend:"$" | append:"$" %}
  {% unless toegewezen contains numberwithdollar %}
    {% unless global_7_range == blank %}{% assign global_7_range = global_7_range | append:"," %}{% endunless %}
    {% assign global_7_range = global_7_range | append:account.number %}
  {% endunless%}
{% endfor %}

{% assign global_range = global_6_range | append:"," | append:global_7_range %}


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

{% capture table %}

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

{% stripnewlines %}
{{ header }}
{% newline %}
| **{% t "Detail van de kosten" %}**    
| **{{ period.year_end_date | date:'%Y' }}**
| **{% t "Beroeps-<br />beperking" %}**<br />**({% t "aftrekbaar" %})**
| **{% t "Fiscale beperking" %}**<br />**({% t "aftrekbaar" %})**
| **{% t "Aftrekbaar" %}**                      
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% for cost_category in cost_categories %}
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
    {% if cost_keys_string != blank %}
    {% assign category_key = cost_keys[forloop.index0] %}
  {% else %}
    {% assign category_key = cost_category | replace:" ","_" | downcase %}
  {% endif %}
  
  {% assign costs_range = custom[category_key].selected | default:custom[category_key].accounts %}

    {% ifi costs_range != blank %}
{% newline %}
  | **{% t cost_category %}** {% input custom[category_key].accounts as:account_collection range:global_range %} |

  
  
  {% ic %}{% assign costs = period.accounts.include_zeros | range:costs_range %}{% endic %}
  {% nic %}{% assign costs = period.accounts | range:costs_range %}{% endnic %}
  
  {% newline %}
  {{ header }}
  {% newline %}
  {% for account in costs %}
    {% assign vin_old = 1-custom[account.number].vin %}
    {% assign beperking_old = 1-custom[account.number].beperking %}
    {% assign vin_new = custom[account.number].vin_new | default:vin_old %}
    {% if vin_new == blank %}
      {% assign vin = 0 %}
    {% else %}
      {% assign vin = vin_new %}
    {% endif %}
    
    {% assign beperking_new = custom[account.number].beperking_new | default:beperking_old %}
    {% if beperking_new == blank %}
      {% assign beperking = 0 %}
    {% else %}
      {% assign beperking = beperking_new %}
    {% endif %}
    
    | {{ account.name }}
    | {%=$11+ -1*account.value as:currency %}
    | {% input custom[account.number].vin_new as:percentage placeholder:'0.00%' default:vin_old %}
    | {% input custom[account.number].beperking_new as:percentage placeholder:'0.00%' default:beperking_old %}
    | {{ -1*vin*beperking*account.value | currency }}
      {% $13+ -1*vin*beperking*account.value | currency: 2 %}
    {% newline %}
    {% if forloop.last %}
      |     
      | **{% =$21+ $11 as:currency %}** 
      |
      |
      | **{% =$23+ $13 as:currency %}** {% $1+ $13 as:currency %}
      {% result category_key $13 %}|
    {% newline %}
    {% endif %}
  {% endfor %}
  {% newline %}
    {% endifi %}
{% endfor %}
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

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

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

{% endcapture %}

{% stripnewlines %}
{% newline %}
|---------------------|-------15%-------:|-------15%-------:|-------15%-------:+
{% newline %}
| {% t "Ontvangsten/Baten" %} {% input custom.detail.omzet as:account_collection range:global_7_range default:'70' %}| | | {%=$10+ -1*omzet.value | currency %}
{% assign omzet = period.accounts | range:omzet_range %}
{% for account in omzet %}
  {% $31+ account.value %}
  {% newline %}
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}
{% endfor %}
{% newline %}
|{% assign goederen = period.accounts | range:goederen_range %}
{% ifi goederen.value != 0 %}
{% newline %}
| {% t "Handelsgoederen, grond en hulpstoffen" %} {% input custom.detail.goederen as:account_collection range:global_6_range default:'60' %}| |{{ -1*goederen.value | currency }}  
{% for account in goederen %}
  {% $32+ account.value %}
  {% newline %}
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}
{% endfor %}{% endifi %}
{% assign voorraadwijziging = period.accounts | range:voorraadwijziging_range %}
{% ifi voorraadwijziging.value != 0 or custom.wijziging.voorraad != 0 %}
{% newline %}
| {% t "Voorraadwijziging" %} {% input custom.detail.voorraadwijziging as:account_collection range:global_range default:def_voorraadwijziging %} {% input custom.eindvoorraad.doc as:file %}| |{{voorraadwijziging_rows}}
{% ic %}{% newline %}| {% input custom.begin_eind.show as:boolean %} {% t "Toon beginvoorraad - eindvoorraad boekjaar" %} {% if custom.begin_eind.show == true %}{% input custom.begin_eind.range as:account_collection range:"3" %} {% unexplained wijziging_in_voorraad+(beginvoorraad-eindvoorraad) as:indicator %}{% endif %}
{% endic %}
{% if custom.begin_eind.show == true %}{% newline %}
| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% t "Beginvoorraad" %} | {% input custom.voorraad.begin as:currency placeholder_default:acccounts_begin.value %}{% newline %}
| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% t "Eindvoorraad" %} |  {% input custom.voorraad.eind as:currency placeholder_default:acccounts_eind.value %}
{% endif %}{% endifi %}
{% assign WIUwijziging = period.accounts | range: WIUwijziging_range %}
{% ifi WIUwijziging.value != 0 or custom.wijziging.WIU != 0 %}
{% newline %}
| {% t "WIUwijziging" %} {% input custom.detail.WIUwijziging as:account_collection range:global_range default:def_WIUwijziging %} {% input custom.WIUeinde.doc as:file %}| |{{WIUwijziging_rows}}
{% ic %}{% newline %}| {% input custom.begin_einde.show as:boolean %} {% t "Toon WIUbegin - WIUeinde boekjaar" %} {% if custom.begin_einde.show == true %}{% input custom.begin_einde.range as:account_collection range:"3" %} {% unexplained wijzinging_in_WIU+(WIUbegin-WIUeinde) as:indicator %}{% endif %}
{% endic %}
{% if custom.begin_einde.show == true %}{% newline %}
| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% t "WIUbegin" %} | {% input custom.WIU.begin as:currency placeholder_default:acccounts_begin.value %}{% newline %}
| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% t "WIUeinde" %} | {% input custom.WIU.einde as:currency placeholder_default:acccounts_einde.value %}
{% endif %}{% endifi %}
{% newline %}
| {% t "Verkochte goederen" %}|||_{%=$10+ (-1*goederen.value+wijziging_in_voorraad+evolution_WIU) | currency %}_
{% newline %}
| **{% t "Brutowinst" %}**        ||| **{{ $10 | currency }}**{% ifi custom.detail.sociale_bijdrage != blank %}
{% newline %}
| {% t "Sociale bijdragen" %} {% input custom.detail.sociale_bijdrage as:account_collection range:global_6_range %} {% input custom.sociale_bijdrage.doc as:file %}| | | {%=$10+ -1*sociale_bijdrage.value | currency %}{% result 'sociale_bijdrage' -1*sociale_bijdrage.value %}{% endifi %}{% ifi custom.detail.echtgenote != blank %}
{% newline %}
  | {% t "Toekenning meewerkende echtgeno(o)t(e)" %} {% input custom.detail.echtgenote as:account_collection range:global_6_range %} {% input custom.echtgenoot.doc as:file %} | | | {%=$10+ -1*echtgenote.value | currency %}{% result 'echtgenote' -1*echtgenote.value %}
  {% endifi %}
  {% assign bruto_winst = $10 %}

  | {% fori extra_kost in custom.extra_kosten %}
    {% newline %}
    |{% input extra_kost.name %} {% input extra_kost.accounts as:account_collection range:global_range %}{% input extra_kost.doc as:file %} | | |{% assign accounts = period.accounts.include_zeros | range:extra_kost.accounts %}{% if extra_kost.accounts != blank %}{% =$10+ accounts.value*-1 %}{% else %}{% $10+input extra_kost.value as:currency default:-1*accounts.value %}{% endif %}
  {% endfori %}
{% newline %}
  | {% t "Kosten" %}              | | |_{% =$10+ $1 %}_
{% newline %}
  | **{% t "Nettoresultaat" %}**      | | | **{{ $10 | currency }}**
{% newline %}
  |
  | {% fori extra_account in custom.extra_accounts %}
    {% newline %}
    |{% input extra_account.name %} {% input extra_account.accounts as:account_collection range:global_range %}{% input extra_account.doc as:file %} | | |{% assign accounts = period.accounts.include_zeros | range:extra_account.accounts %}{% if extra_account.accounts != blank %}{% =$10+ accounts.value*-1 %}{% else %}{% $10+input extra_account.value as:currency default:-1*accounts.value %}{% endif %}
  {% endfori %}
  |
{% endstripnewlines %}

{% newpage %}

{{ table }}

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

{% assign accounts = period.accounts.include_zeros | range:'6,7' %}
{% assign count_6_7 = accounts.count %}
{% assign toegewezen = toegewezen | remove:"$" %}
{% assign count_toegewezen = toegewezen | split:";" %}
{% assign toegewezen_range = count_toegewezen | join:"," %}
{% assign count_toegewezen = count_toegewezen.size %}

{% assign toegewezen_bedrag = period.accounts | range:toegewezen_range %}

{% assign niet_toegewezen = #6+#7-toegewezen_bedrag.value %}

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

{% if count_6_7 > count_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 %}

Hi Stephanie,

You use evolution_WIU to calculate the goods sold, but that variable is never initialized. You can you use wijziging_in_WIU there.

Furthermore I noted following typing errors:

  1. accounts_WIUbegin vs acccounts_WIUbegin & accounts_WIUeinde vs acccounts_WIUeinde

{% assign WIUbegin = custom.begin.WIU | default:acccounts_WIUbegin.value %}

{% assign accounts_WIUeinde = period.accounts | range:custom.WIUbegin_WIUeind.range %}

{% assign WIUeinde = custom.einde.WIU | default:acccounts_WIUeind.value %}
  1. wijzinging_in_WIU instead of wijziging_in_WIU