Template beroepskosten 2.0

Hi,

I’m using the standard template ‘beroepskosten 2.0’ to make it our own.

We’re using a few categories in this template to make a detail of the costs. Here, I want to add a background color in behind the title “Detail van de kosten”.

I saw it’s possible simply to add the RGB code behind the of the table, but it doesn’t seem to work.

Beside that, I would like to add standard accounts to the account collections, but because of the categories I couldn’t find where to insert the code, if it’s even possible like this. Could I link them to the assign string?

  {% assign cost_categories_string = "Lokaalkosten|Bureelkosten|Commissies en erelonen|Verzekeringen|Kosten rollend materieel|Uitbatingskosten|Representatie, onthaal en publciteit|Bijdragen - sociaal statuut|Personeelskost|Afschrijvingen|Andere bedrijfskosten|Financiele kosten" %}
  {% assign cost_keys_string = "Lokaalkosten|Bureelkosten|Commissiesenerelonen|Verzekeringen|Kostenrollendmaterieel|Uitbatingskosten|Representatie|Bijdragen - sociaal statuut|Personeelskost|Afschrijvingen|Anderebedrijfskosten|Financiele kosten" %}
{% endif %}

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

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

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

{% capture detailkosten %}

|-------#+
|**{% t "Detail van de kosten" %}** 

{% stripnewlines %}
{{ header }}
{% newline %}
|    
|**{{ period.year_end_date | date:'%Y' }}**
| **{% t "Beroeps-<br />beperking" %}**<br />**({% t "Niet aftrekbaar" %})**
| **{% t "Fiscale beperking" %}**<br />**({% t "Niet aftrekbaar" %})**
| **{% t "Totale beperking" %}**    
| **{% t "Aftrekbaar" %}**                      
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% for cost_category in cost_categories %}
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
  {% assign $14 = 0 %}
  {% assign $15 = 0 %}
  {% assign category_key = cost_keys[forloop.index0] %}  
  
    {% ifi custom[category_key].accounts != blank %}
{% newline %}
  | **{% t cost_category %}** {% input custom[category_key].accounts as:account_collection range:6,7 accounts_var:costs %} |
  {% newline %}
  {{ header }}
  {% newline %}
  {% for account in costs %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.name }}
    | {%=$11+ -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 %}
    | {% 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 %}
      {% $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 %}**
      {% result category_key $14 %}|
    {% newline %}
    {% endif %}
  {% endfor %}
  {% newline %}
    {% endifi %}
{% endfor %}
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

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

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

{% endcapture %}

Hi @Cedric,

It is indeed explained here how to add a background color to a table.

This code defines your table with “detail kosten” in it :

|-------#+
|**{% t "Detail van de kosten" %}** 

So if you change that to this for example :

|-------#+5f5f5f
|**{% t "Detail van de kosten" %}** 

you should be able to get the result you want.

BUT the background color will only be displayed in export (not in input-mode). So if you export it to a PDF, you’ll see what the code does (perhaps that’s why you couldn’t get it ? )

Can you give it a go?

If it works, then I’ll be gladly to explain your second question. Make sure to post the whole code then again, thanks!

@sven,

Thanks, the background color works perfectly. (I didn’t test the export at first)

Now the background is ok, but I would like to have the text in to be white, what also works perfectly but is displayed in both export as in input-mode. Which means that in input-mode I can’t see the text.

  {% assign cost_categories_string = "Lokaalkosten|Bureelkosten|Commissies en erelonen|Verzekeringen|Kosten rollend materieel|Uitbatingskosten|Representatie, onthaal en publciteit|Bijdragen - sociaal statuut|Personeelskost|Afschrijvingen|Andere bedrijfskosten|Financiele kosten" %}
  {% assign cost_keys_string = "Lokaalkosten|Bureelkosten|Commissiesenerelonen|Verzekeringen|Kostenrollendmaterieel|Uitbatingskosten|Representatie|Bijdragen - sociaal statuut|Personeelskost|Afschrijvingen|Anderebedrijfskosten|Financiele kosten" %}
{% endif %}

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


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

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

{% capture detailkosten %}

|-------#+385073
|**<font color="ffffff"> Detail van de kosten </font>**


{% stripnewlines %} 
{{ header }}
{% newline %}
|    
|**{{ period.year_end_date | date:'%Y' }}**
| **{% t "Beroeps-<br />beperking" %}**<br />**({% t "Niet aftrekbaar" %})**
| **{% t "Fiscale beperking" %}**<br />**({% t "Niet aftrekbaar" %})**
| **{% t "Totale beperking" %}**    
| **{% t "Aftrekbaar" %}**                      
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% for cost_category in cost_categories %}
  {% assign $11 = 0 %}
  {% assign $12 = 0 %}
  {% assign $13 = 0 %}
  {% assign $14 = 0 %}
  {% assign $15 = 0 %}
  {% assign category_key = cost_keys[forloop.index0] %}  
  
    {% ifi custom[category_key].accounts != blank %}
{% newline %}
  | **{% t cost_category %}** {% input custom[category_key].accounts as:account_collection range:6,7 accounts_var:costs %} |
  {% newline %}
  {{ header }}
  {% newline %}
  {% for account in costs %}
    {% assign toegewezen = toegewezen | append: account.number | append:";" %}
    | {{ account.name }}
    | {%=$11+ -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 %}
    | {% 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 %}
      {% $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 %}**
      {% result category_key $14 %}|
    {% newline %}
    {% endif %}
  {% endfor %}
  {% newline %}
    {% endifi %}
{% endfor %}
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %}                
{% newline %}
{% endstripnewlines %}

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

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

{% endcapture %}



{% capture detailanderebo %}

|-------#+385073
|**{% t "Detail andere bedrijfsopbrengsten" %}** 

{% stripnewlines %}
{{ header }}
{% newline %}
|    
|**{{ period.year_end_date | date:'%Y' }}**
| **{% t "Beroeps-<br />beperking" %}**
| **{% t "Fiscale beperking"
| **{% t "Totale beperking" %}**    
| **{% t "Belast" %}**                      
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %} 
{% newline %}

  
| **Andere bedrijfsopbrengsten**{% input custom.some.accounts as:account_collection range:74 accounts_var:anderebo %}|

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

{{ header }}
| **{% t "Totaal" %}**                  | **{{ $31 | currency }}** |  |  | | **{{ $34 | currency }}**

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



{% endcapture %}





{% capture detailmeerminderwaarde %}

|-------#+385073
|**{% t "Detail van de meer- en minderwaarden" %}** 

{% stripnewlines %}
{{ header }}
{% newline %}
|    
|**{{ period.year_end_date | date:'%Y' }}**
| **{% t "Beroeps-<br />beperking" %}**
| **{% t "Fiscale beperking"
| **{% t "Totale beperking" %}**    
| **{% t "Belast" %}**                      
{% newline %}                
{% newline %}
-----------------------------------------------------------------------------------------------------------
{% newline %} 
{% newline %}

  
| **Meerwaarde**{% input custom.some.accounts as:account_collection range:76 accounts_var:meerwaarde %}|

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

{{ header }}
| **{% t "Totaal" %}**                  | **{{ $31 | currency }}** |  |  | | **{{ $34 | 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 %}
|---------------------|-------15%-------:|-------15%-------:|-------15%-------:+
{% newline %}
| {% t "Ontvangsten/Baten" %} {% input custom.detail.omzet as:account_collection range:7 default:'70' accounts_var:omzet %}| | | {%=$10+ -1*omzet.value | currency %}
  {% for account in omzet %}
  {% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $31+ account.value %}
  {% newline %}
  | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}
  {% endfor %}
{% ifi goederen.value != 0 %}
{% newline %}
| {% t "Handelsgoederen, grond en hulpstoffen" %} {% input custom.detail.goederen as:account_collection range:6 default:'60' %}| |{{ -1*goederen.value | currency }}
  {% for account in goederen %}
  {% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $32+ account.value %}
    {% newline %}
    | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ account.name }}|{{ -1*account.value | currency }}
  {% endfor %}
{% newline %}
| {% t "Beginvoorraad" %} {% input custom.detail.beginvoorraad as:account_collection range:6,7 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:6,7 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:";" %}{% $34+ account.value %}
  {% endfor %}
{% newline %}
| {% t "Verkochte goederen" %}|||_{%=$10+ -1*(beginvoorraad.value+goederen.value+eindvoorraad.value) | currency %}_
{% newline %}
| {% t "Brutowinst / Baten" %}        ||| **{{ $10 | currency }}**{% endifi %}{% ifi custom.detail.sociale_bijdrage != blank %}
{% newline %}
| {% t "Sociale bijdragen" %} {% input custom.detail.sociale_bijdrage as:account_collection range:6 accounts_var:sociale_bijdrage %} {% input custom.sociale_bijdrage.doc as:file %}| | | {%=$10+ -1*sociale_bijdrage.value | currency %}{% endifi %}{% result 'sociale_bijdrage' -1*sociale_bijdrage.value %}{% ifi custom.detail.echtgenote != blank %}
{% for account in sociale_bijdrage %}
{% assign toegewezen = toegewezen | append: account.number | append:";" %}{% $35+ account.value %}
    {% newline %}
    | {{ account.name }}|{{ account.value | currency }}
{% endfor %}
{% newline %}
  | {% t "Toekenning meewerkende echtgeno(o)t(e)" %} {% input custom.detail.echtgenote as:account_collection range:6 accounts_var:echtgenote %} {% input custom.echtgenoot.doc as:file %} | | | {%=$10+ -1*echtgenote.value | currency %}{% endifi %}{% 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 "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:6,7 %}{% input extra_account.doc as:file %} | | |{% assign accounts = period.accounts | range:extra_account.accounts %}{%=$20+ -1*accounts.value | currency %}
  {% endfori %}
  |
{% endstripnewlines %}

{% newpage %}

{{ detailanderebo }}
{{ detailkosten }}
{{ detailmeerminderwaarde }} ```

@Cedric

You could use the ic-tag and the nic-tag:

{% ic %}Tekst{% endic %}{% nic %}<font color="ffffff">Tekst</font>{% endnic %}

1 Like

That’s great @Thijs. FYI: You could write this in this way too:

{% nic %}<font color="ffffff">{% endnic %}Tekst{% nic %}</font>{% endnic %}

2 Likes

@Thijs, @SamVanEenoo

Thanks works perfectly! :slight_smile: