Thx Sven! It works.
Final question. Our beroepskosten works fine.
I’m just having a problem with my export. Everything is exported fine, but i’m just facing problems with the export of my meerwaarden. It’s not coming out of my export. If their is, just the header is shown, but not the amounts.
Could you have a look ?
Here my entire code:
{% t= "Beroeps-<br />beperking" fr:"La limite professionnelle" en:"Occupational disability" %}
{% t= "Fiscale beperking" fr:"La limite fiscale" en:"Fiscal limitation" %}
{% t= "Totale beperking" fr:"La limite totale" en:"Total limitation" %}
{% t= "Aftrekbaar" fr:"Déductible" en:"Deductible" %}
{% t= "Niet aftrekbaar" fr:"Non déductible" en:"Not deductible" %}
{% t= "Ontvangsten/Baten" fr:"Le chiffre d'affaires" en:"Revenues" %}
{% t= "Andere bedrijfsopbrengsten" %}
{% t= "Beginvoorraad" fr:"Le stock initial" en:"Initial stock" %}
{% t= "Eindvoorraad" fr:"Le stock final" en:"Final stock" %}
{% t= "Verkochte voorraad" fr:"Le stock vendu" en:"Stock sold" %}
{% t= "Brutowinst" fr:"Le résultat brut" en:"Gross profit" %}
{% t= "Sociale bijdragen" fr:"Les cotisations sociales" en:"social contributions" %}
{% t= "Toekenning meewerkende echtgeno(o)t(e)" fr:"L'Octroi époux/-ouse cooperative" en:"Allocation helping spous" %}
{% t= "Kosten" fr:"Les frais" en:"costs" %}
{% t= "Nettoresultaat" fr:"Le résultat net" en:"Net result" %}
{% t= "Niet toegewezen bedrag" fr:"Le montant non affectués" en:"Unassigned amount" %}
{% t= "Alle rekeningen zijn opgenomen" fr:"Tous des comptes sont inclus" en:"All accounts are selected" %}
{% t= "Eén of meerdere rekeningen werden meermaals toegewezen" fr:"Un ou plusieurs comptes ont été attribués plusieurs fois" en:"One or more accounts were selected more than once" %}
{% t= "Niet alle rekeningen zijn opgenomen" fr:"Tous les comptes ne sont pas inclus" en:"Not all accounts are selected" %}
{% t= "Handelsgoederen, grond en hulpstoffen" fr:"Les marchandises, matières premières et matières consommables" en:"Goods for resale, raw materials and additives" %}
{% t= "Verkochte goederen" fr:"Les biens vendus" en:"Sold goods" %}
{% t= "Huur en huurlasten" fr:"La location et les frais de location" en:"Rent and rental expenses" %}
{% t= "Onderhoud en herstellingen" fr:"L'entretien et les réparation" en:"Maintenance and repair" %}
{% t= "Nutsvoorzieningen" %}
{% t= "Bureaubenodigdheden" %}
{% t= "Verzekeringen" %}
{% t= "Commissies en erelonen" %}
{% t= "Verplaatsingskosten" %}
{% t= "Klein materiaal" %}
{% t= "Publiciteit" %}
{% t= "Andere bedrijfskosten" %}
{% t= "Personeelskosten" %}
{% t= "Afschrijvingen en waardeverminderingen" %}
{% t= "Financiële kosten" %}
{% t= "Totaal" fr:"Le Total" en:"Total" %}
{% t= "Divers" fr:"Les Divers" en:"Miscellaneous" %}
{% t= "Extra toelichting" fr:"Explication supplémentaire" en:"Additional explanation" %}
{% t= "Nr." fr:"N°" en:"No." %}
{% t= "Bedrag" fr:"Montant" en:"Amount" %}
{% if cost_categories_string == blank or cost_keys_string == blank %}
{% assign cost_categories_string = "Huur en huurlasten|Onderhoud en herstellingen|Nutsvoorzieningen|Telefoon en communicatie|Bureaubenodigdheden|Verzekeringen|Commissies en erelonen|Kosten rollend materieel|Klein materiaal|Publiciteit|Sociale bijdragen en VAPZ|Personeelskost|Afschrijvingen|Andere bedrijfskosten|Financiele kosten|Uitzonderlijke kosten" %}
{% assign cost_keys_string = "Huurenhuurlasten|Onderhoudenherstellingen|Nutsvoorzieningen|Telefoonencommunicatie|Bureaubenodigdheden|Verzekeringen|Commissiesenerelonen|Kostenrollendmaterieel|Kleinmateriaal|Publiciteit|Sociale bijdragen|Personeelskost|Afschrijvingen|Anderebedrijfskosten|Financielekosten|Uitzonderlijkekosten" %}
{% assign cost_default_string = "610100,610110,610120,610150,610200|610600,610610,610700,610710|611500,611600,611700|616200,616210,616300|611000,611050,611100,612001|613000,613100,613600,613700,613710,613800,613900,613910|615|610800,610840,610900,612500,612510,612540,612600,612610,613400,613420,640200,640220,640300,640800|611200|616400,616600,616620,616630,616640,616650,616651,616680|618010,618200,618300|62|63|616700,640400,640500,640600,640610,640700,645000,644000|65|66" %}
{% endif %}
{% assign cost_categories = cost_categories_string | split:"|" %}
{% assign cost_keys = cost_keys_string | split:"|" %}
{% assign cost_default = cost_default_string | split:"|" %}
{% assign toegewezen = "" %}
{% assign count = 0 %}
{% capture header %}|-----------40%---------------|---------------12%-----------:|---------------12%-----------:|---------------12%-----------:|---------------12%-----------:|---------------12%-----------:+{% endcapture %}
{% capture detailkosten %}
|-------#+385073
|{% nic %}**<font color="ffffff">{% endnic %} Detail van de kosten {% nic %}</font>**{% endnic %}
{% stripnewlines %}
{{ header }}
{% newline %}
|
| **{% t "Bruto" %}**
| **{% t "Beroeps-<br />beperking" %}**
| **{% t "Fiscale beperking" %}**
| **{% t "Totale beperking" %}**
| **{% t "Aftrekbaar" %}**
{% newline %}
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}
{% newline %}
{% for cost_category in cost_categories %}
{% assign $7 = 0 %}
{% assign $11 = 0 %}
{% assign $12 = 0 %}
{% assign $13 = 0 %}
{% assign $14 = 0 %}
{% assign $15 = 0 %}
{% assign category_key = cost_keys[forloop.index0] %}
{% assign category_default = cost_default[forloop.index0] %}
{%if custom[category_key].accounts != blank %}
{% assign cat_range = custom[category_key].accounts %}
{% assign cat_accounts = period.accounts | range:cat_range %}
{% else %}
{% assign cat_range = category_default %}
{% assign cat_accounts = period.accounts | range:cat_range %}
{% endif %}
{% ifi cat_accounts.value != 0 or cat_accounts != empty %}
{% newline %}
{% newline %}
{{ header }}
{% newline %}
| **{% t cost_category %}** {% input custom[category_key].accounts as:account_collection range:6,7 default:category_default accounts_var:costs %} |||||
{% newline %}
{% for account in costs %}
{% assign toegewezen = toegewezen | append: account.number | append:";" %}
| {{ account.number }} {{ account.name }}
| {%=$11+ -1*account.value as:currency %}
| {% input custom[account.number].vin as:percentage placeholder:'0.00%' %}
{% if custom[account.number].vin == blank %}
{% assign vin = 1 %}
{% else %}
{% assign vin = 1-custom[account.number].vin placeholder:'' %}
{% endif %}
{% $12+ -1*vin*account.value as:currency %}
| {% $7+input custom[account.number].beperking as:percentage placeholder:'0.00%' default:perc_key %}
{% if custom[account.number].beperking == blank %}
{% assign beperking = 1 %}
{% else %}
{% assign beperking = 1-custom[account.number].beperking %}
{% endif %}
{% $15+ -1*vin*beperking*account.value-(1-vin)*account.value as:currency %}
| {{ account.value-1*vin*beperking*account.value | currency }}
{% $13+ -1*vin*beperking*account.value as:currency %}
| {%=$14+ -1*vin*beperking*account.value as:currency %}
{% newline %}
{% if forloop.last %}
|
| **{% =$21+ $11 as:currency %}**
| **{% =$22+ $11-$12 as:currency %}**
| **{% =$25+ $11-$15 as:currency %}**
| **{% =$23+ $11-$13 as:currency %}**
| **{% =$1+ $14 as:currency %}**
{% capture fiscal_key %}{{ category_key }}_fisc{% endcapture %}
{% result fiscal_key $11-$13 %}
{% result category_key $14 %}|
{% newline %}
{% endif %}
{% endfor %}
{% endifi %}
{% newline %}
{% endfor %}
{% newline %}
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}
{% newline %}
{% endstripnewlines %}
{{ header }}
| **{% t "Totaal" %}** | **{{ $21 | currency }}** | {{ $22 | currency }} | {{ $25 | currency }} | {{ $23 | currency }} | **{{ $1 | currency }}**
-----------------------------------------------------------------------------------------------------------
{% endcapture %}
{% capture detailanderebo %}
|-------#+385073
|{% nic %}**<font color="ffffff">{% endnic %} Detail van de andere bedrijfsopbrengsten {% nic %}</font>**{% endnic %}
{% stripnewlines %}
{{ header }}
{% newline %}
|
| **{% t "Bruto" %}**
| **{% t "Beroeps-<br />beperking" %}**
| **{% t "Fiscale beperking" %}**
| **{% t "Totale beperking" %}**
| **{% t "Belast" %}**
{% newline %}
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}
{% newline %}
{% newline %}
{{ header }}
{% newline %}
| **Andere bedrijfsopbrengsten** {% input custom.anderebo.accounts as:account_collection range:740,742,743,744,745,746,747,748,749 default:740,742,743,744,745,746,747,748,749 accounts_var:anderebo %}|||||
{% newline %}
{% for account in anderebo %}
{% assign toegewezen = toegewezen | append: account.number | append:";" %}
| {{ account.number }} {{ account.name }}
| {%=$31+ account.value*-1 as:currency %}
| {% input custom[account.number].vin as:percentage placeholder:'0.00%' %}
{% if custom[account.number].vin == blank %}
{% assign vin = 1 %}
{% else %}
{% assign vin = 1-custom[account.number].vin placeholder:'' %}
{% endif %}
{% $32+ -1*vin*account.value as:currency %}
| {% input custom[account.number].beperking as:percentage placeholder:'0.00%' %}
{% if custom[account.number].beperking == blank %}
{% assign beperking = 1 %}
{% else %}
{% assign beperking = 1-custom[account.number].beperking %}
{% endif %}
{% $35+ -1*vin*beperking*account.value-(1-vin)*account.value as:currency %}
| {{ account.value-1*vin*beperking*account.value | currency }}
{% $33+ -1*vin*beperking*account.value as:currency %}
| {%=$34+ -1*vin*beperking*account.value as:currency %}
{% newline %}
{% endfor %}
{% result 'anderebo_beperking' $31-$33 %}
{% newline %}
{% newline %}
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}
{% newline %}
{% endstripnewlines %}
{{ header }}
| **{% t "Totaal" %}** | **{{ $31 | currency }}** | **{{ $31-$32 | currency }}** | **{{ $31-$35 | currency }}** | **{{ $31-$33 | currency }}** | **{{ $34 | currency }}**
-----------------------------------------------------------------------------------------------------------
{% endcapture %}
{% capture detailmeerwaarde %}
|-------#+385073
|{% nic %}**<font color="ffffff">{% endnic %} Detail van de meerwaarden {% nic %}</font>**{% endnic %}
{% stripnewlines %}
{{ header }}
{% newline %}
|
| **{% t "Bruto" %}**
| **{% t "Beroeps-<br />beperking" %}**
| **{% t "Fiscale beperking" %}**
| **{% t "Totale beperking" %}**
| **{% t "Belast" %}**
{% newline %}
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}
{% newline %}
{% newline %}{% ifi custom.meerwaarde.accounts != blank %}
{{ header }}
{% newline %}
| **Meerwaarde**{% input custom.meerwaarde.accounts as:account_collection range:741 default:741 accounts_var:meerwaarde %}|||||
{% newline %}
{% for meer in meerwaarde %}
{% assign toegewezen = toegewezen | append: account.number | append:";" %}
| {{ meer.number }} {{ meer.name }}
| {%=$2+ -1*meer.value | currency %}
| {% input custom[meer.number].vin as:percentage placeholder:'0.00%' %}
{% if custom[meer.number].vin == blank %}
{% assign vin = 1 %}
{% else %}
{% assign vin = 1-custom[meer.number].vin placeholder:'' %}
{% endif %}
{% $3+ -1*vin*meer.value as:currency %}
| {% input custom[meer.number].beperking as:percentage placeholder:'0.00%' %}
{% if custom[meer.number].beperking == blank %}
{% assign beperking = 1 %}
{% else %}
{% assign beperking = 1-custom[meer.number].beperking %}
{% endif %}
{% $5+ -1*vin*beperking*meer.value-(1-vin)*meer.value as:currency %}
| {{ meer.value-1*vin*beperking*meer.value | currency }}
{% $6+ -1*vin*beperking*meer.value as:currency %}
| {%=$4+ -1*vin*beperking*meer.value as:currency %}
{% newline %}
{% endfor %}
{% result 'meerwaarde_beperking' $2-$6 %}
{% newline %}
{% newline %}{% endifi %}
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}
{% newline %}
{% endstripnewlines %}
{{ header }}
| **{% t "Totaal" %}** | **{{ $2 | currency }}** | **{{ $2-$3 | currency }}** | **{{ $2-$5 | currency }}** | **{{ $2-$6 | currency }}** | **{{ $4 | currency }}**
-----------------------------------------------------------------------------------------------------------
{% endcapture %}
{% if custom.detail.goederen == blank %}{% assign goederen_range = '60'%}{% else %}{% assign goederen_range = custom.detail.goederen %}{% endif %}
{% assign goederen = period.accounts | range:goederen_range %}
{% stripnewlines %}
{% newline %}
|---------------------|-------20%-------:|-------15%-------:|-------15%-------:+
{% newline %}
| {% t "Ontvangsten" %} {% input custom.detail.omzet as:account_collection range:7 default:'70' accounts_var:omzet %}| | {{ -1*omzet.value | currency }}
{% for account in omzet %}
{% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $31+ account.value %}
{% newline %}
| {{ account.name }}|{{ -1*account.value | currency }}
{% endfor %}
{% newline %}
| {% t "Werken in uitvoering - begin " %} {% input custom.detail.beginwiu as:account_collection range:6,7 accounts_var:beginwiu %} {% input custom.beginwiu.doc as:file %}| | {{ -1*beginwiu.value | currency}}{% result 'beginwiu' -1*beginwiu.value %}
{% for account in beginwiu %}
{% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $35+ account.value %}
{% endfor %}
{% newline %}
| {% t "Werken in uitvoering - einde " %} {% input custom.detail.eindwiu as:account_collection range:6,7 accounts_var:eindwiu %} {% input custom.eindwiu.doc as:file %}| |_{{ -1*eindwiu.value | currency}}_ {% result 'eindwiu' -1*eindwiu.value %}
{% for account in eindwiu %}
{% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $36+ account.value %}
{% endfor %}
{% newline %}
| {% t "Omzet" %}|||{%=$10+ 1*(beginwiu.value-omzet.value-eindwiu.value) | currency %}
{% ifi goederen.value != 0 %}
{% newline %}
| {% t "Handelsgoederen, grond en hulpstoffen" %} {% input custom.detail.goederen as:account_collection range:60 default:'600,601,602,603,604,606' %}| |{{ -1*goederen.value | currency }}
{% for account in goederen %}
{% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $32+ account.value %}
{% newline %}
| {{ account.name }}|{{ -1*account.value | currency }}
{% endfor %}
{% newline %}
| {% t "Beginvoorraad" %} {% input custom.detail.beginvoorraad as:account_collection range:609 accounts_var:beginvoorraad %} {% input custom.beginvoorraad.doc as:file %}| | {{ -1*beginvoorraad.value | currency}}{% result 'beginvoorraad' -1*beginvoorraad.value %}
{% for account in beginvoorraad %}
{% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $33+ account.value %}
{% endfor %}
{% newline %}
| {% t "Eindvoorraad" %} {% input custom.detail.eindvoorraad as:account_collection range:609 accounts_var:eindvoorraad %} {% input custom.eindvoorraad.doc as:file %}| |_{{ -1*eindvoorraad.value | currency}}_ {% result 'eindvoorraad' -1*eindvoorraad.value %}
{% for account in eindvoorraad %}
{% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $40+ account.value %}
{% endfor %}
{% newline %}
| {% t "Verkochte goederen" %}|||_{%=$10+ -1*(beginvoorraad.value+goederen.value+eindvoorraad.value) | currency %}_
{% newline %}
| {% t "**Brutowinst**" %} ||| **{{ $10 | currency }}**{% endifi %}
{% newline %}
| {% t "Andere bedrijfsopbrengsten" %} | | |_{% =$10+ $34 %}_
{% newline %}
| {% t "**Brutowinst na andere bedrijfsopbrengsten**" %} |*Code 1600/2600*|| **{{ $10 | currency }}**
{% newline %}
| {% t "Meerwaarden, vergoedingen" %} |*zie afzonderlijk detail* | |_{% =$10+ $4 %}_
{% newline %}
| {% t "**Brutowinst van de eigenlijke exploitatie**" %} ||| **{{ $10 | currency }}**
{% newline %}
| {% t "Toekenning meewerkende echtgeno(o)t(e)" %} {% input custom.detail.echtgenote as:account_collection range:619 accounts_var:echtgenote %} {% input custom.echtgenoot.doc as:file %} | *Code 1611/2450*| | {%=$10+ -1*echtgenote.value | currency %}{% result 'echtgenote' -1*echtgenote.value %}
{% for account in echtgenote %}
{% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $36+ account.value %}
{% endfor %}
{% assign bruto_winst = $10 %}
{% newline %}
| {% t "Andere beroepskosten" %} |*Code 1606/2606* | |_{% =$10+ $1 %}_
{% newline %}
| {% t "**Nettoresultaat**" %} | | | **{{ $10 | currency }}**
{% newline %}
{% endstripnewlines %}
{% newpage %}
{% ifi anderebo.value != 0 %}
{{ detailanderebo }}
{% endifi %}
<br>
{{ detailkosten }}
<br>
{% ifi #741000+741100 != 0 %}
{{ detailmeerwaarde }}
{% endifi %}
<!----------------------------------------- check to see if all accounts have been used JUST ONCE ----------------------------------------->
{% assign accounts = period.accounts | range:'6,7' %}{% assign count_6_7 = 0 %}
{% for acc in accounts %}
{% assign count_6_7 = count_6_7 | plus:1 %}
{% endfor %}
{% assign count_toegewezen = toegewezen | split:";" %}
{% for acc in count_toegewezen %}
{% assign count = count | plus:1 %}
{% endfor %}
{% assign niet_toegewezen = #6+#7+(bruto_winst+-$0+$21+$20+$2-$6) %}
{% ic %}
*{% t "Niet toegewezen bedrag" %} {{ niet_toegewezen | currency }}* {% unexplained niet_toegewezen as:indicator %}
{% stripnewlines %}
{% if count == count_6_7 %}
*<font color="00a30e">{% t "Alle rekeningen zijn opgenomen" %}</font >*
{% elsif count > count_6_7 %}
*<font color="CC0000">{% t "Eén of meerdere rekeningen werden meermaals toegewezen" %}</font >*
{% else %}
{% assign show_niet_toegewezen = true %}
*<font color="AAAAAA">{% t "Niet alle rekeningen zijn opgenomen" %}</font >*
{% endif %}
{% endstripnewlines %}<br>
{% if show_niet_toegewezen %}
{% stripnewlines %}
| *{% t "Nr." %}* | *{% t "Naam" %}* | *{% t "Bedrag" %}*
{% newline %}
|--7%--|----|----:+
{% newline %}
{% for account in accounts %}
{% unless toegewezen contains account.number %}
| {{ account.number }} | {{ account.name }} | {%=$30+ account.value | currency %}
{% newline %}
{% if forloop.last %}
| | | **{{ $30 | currency }}**
{% endif %}
{% endunless %}
{% endfor %}
{% endstripnewlines %}
{% endif %}
{% endic %}
<!------------------------------------------------------------------------------ END -------------------------------------------------------------------------------->
{% ifi custom.extra.bijlage.document or custom.extra.toelichting != blank %}<br>
{% stripnewlines %}
|------
|------
{% newline %}
| **{% t "Extra toelichting" %}**
| {% input custom.extra.bijlage as:file placeholder:'' %}
{% endstripnewlines %}
{% input custom.extra.toelichting as:text size:mini placeholder:'' %}
{% endifi %}