When no data available, possibility to fill in manually

Hi there,

We developped a template thin cap and we want to add a new feature.

When a company is added in Silverfin for the first time, the column ‘Begintoestand’ is 0,00 because that refers to the previous year. But that doesn’t mean there is no data for that year. Now in this case we uploaded manually an excel file so the data would be filled in.

Is it possible to fill in these column manually if there’s no data in the previous period?
The account numbers are also selected using a hashtag. So only the selected accounts need to be filled in manually.

Kind regards,
Cedric

Hello @cedric.devos,

You could go for a scenario to make all numbers of “begintoestand” as inputs, like this:

{% input custom.some.account as:currency default:some_var %}

where the local var some_var is actually the amount of selected accounts. This option will make it possible to overwrite the amount of the accounts.

However, if you really want the numbers to be fixed if the previous year does exists (so if there is data in the previous year), you’ll need to check if the previous year does exist, which you can do like this:

{% if period.minus_1y.exists %}
{{ some_var | currency }}
{% else %}
{% input custom.some.account as:currency default:some_var %}
{% endif %}

Hope this helps!

Hi @sven,

I don’t know how to apply this in our specific code, there are lot of variables and I don’t know to which one I need to refer. There are also totals at the bottom. We would go for the second option (if statement previous year) if you could you help us a little bit further? :grinning:

{::infotext}
{% t "Selecteer, indien nodig, nog bijkomende rekeningen met betrekking tot het " %} **{% t "gestort kapitaal" %}** {% t "om de correcte grens te bepalen." %} {% input custom.range.fisc_cap. as:account_collection range:"10,11" account_var:accounts %}
{:/infotext}
{% endic %}
{% assign fisc_cap_accounts = period.accounts.include_zeros | range:custom.range.fisc_cap %}
{% assign last_year = period.minus_1y.year_end %}
{% ic %}
{::infotext}
{% t "Selecteer, indien nodig, nog bijkomende rekeningen met betrekking tot de " %} **{% t "belastbare reserves" %}** {% t "om de correcte grens te bepalen." %} {% input custom.range.thin_cap as:account_collection range:"12,130,131,133,14" default:"" account_var:accounts %}
{:/infotext}
{% endic %}
{% comment %}create account collection with the selected ranges (including zero accounts!) which are stored in the database variable "custom.range.thin_cap" {% endcomment %}
{% assign thin_cap_accounts = period.accounts.include_zeros | range:custom.range.thin_cap %}
{% assign last_year = period.minus_1y.year_end %}
{% comment %}loop over those selected accounts, and display the previous value as well{% endcomment %}
{% stripnewlines %}
| {% t "Gegevens uit jaarrekening" %}
| {% t "Begintoestand" %}
| {% t "Eindtoestand" %}
| {% t "Basis" %}
| {% t "Max R/C" %}
| Max. Thin Cap  
{% newline %}
| ----25%----
| ----15%----:
| ----15%----:
| ----15%----:
| ------:+
| ------:+
{% ic %}#{% endic %}
{% nic %}+{% endnic %}
{% comment %}loop over accounts{% endcomment %}
{% comment %}loop over accounts{% endcomment %}
{% for fisc_cap in fisc_cap_accounts %}
  {% newline %}
  {% comment %}display account and number as linkto{% endcomment %}
  | {{ fisc_cap.link }}
  {% comment %}create variable which goes to the period.accounts-drop but in the last period of last book year, filtered on the account number{% endcomment %}
  {% assign value_end_year = last_year.accounts | range:fisc_cap.number %}
  {% comment %}display new created var "value_end_year"{% endcomment %}
  | {% =$2+ -value_end_year | currency %}
  {% comment %}display the value in current period, which is the db variable value of the account drop{% endcomment %}
  | {% =$3+ -fisc_cap.value | currency %}
  | {{ -fisc_cap.value | currency }}
  |
  |{% endfor %}
{% for account in thin_cap_accounts %}
  {% newline %}
  {% comment %}display account and number as linkto{% endcomment %}
  | {{ account.link }}
{% comment %}create variable which goes to the period.accounts-drop but in the last period of last book year, filtered on the account number{% endcomment %}
{% assign value_end_year = last_year.accounts | range:account.number %}
  {% comment %}display new created var "value_end_year"{% endcomment %}
  | {% =$20+ -value_end_year | currency %}
{% comment %}display the value in current period, which is the db variable value of the account drop{% endcomment %}
  | {% =$21+ -account.value | currency %}
  | {{ -value_end_year | currency }}
  | 
  |
{% endfor %}
{% comment %}Give totals of the selected ranges in correct columns{% endcomment %}
{% newline %}
  | {% t "Belastbare reserves in het kapitaal en belastbare uitgiftepremies (1001 PN)" %}
  | {% =$0+input custom.res_in_cap_last_year.begintoestand as currency %}
  | {% =$1+input custom.res_in_cap_this_year.eindtoestand as currency %}
  | {{ -$1 | currency }}
  |
  |
{% comment %}Give totals of the selected ranges in correct columns{% endcomment %}
{% newline %}
    ||||||
{% newline %}
    |**{% t "Fiscaal gestort kapitaal" %}**
{% assign cap_begin = $2-$0 %}
    |**{{ cap_begin | currency }}**
{% assign cap_einde = $3-$1 %}
    |**{{ cap_einde | currency }}**
{% assign Base_fisc_cap = $3-$1 %}
    |**{{ Base_fisc_cap | currency }}**
    |
    |
{% newline %}
    | **{% t "Totaal belastbare reserves" %}**
    {% assign res_begin = $20+$0  %}
    | **{{ res_begin | currency }}**
    {% assign res_einde = $21+$1 %}
    | **{{ res_einde | currency }}**
    | **{{ res_begin | currency }}**
    |
    |
{% newline %}
      |**{::font size="m"}{% t "Totaal belastbaar vermogen" %}{:/font}**
      |**{::font size="m"}{{ cap_begin+res_begin | currency }}{:/font}**
      |**{::font size="m"}{{ cap_einde+res_einde | currency }}{:/font}**
{% if res_begin < 0 %}
{% assign Base = Base_fisc_cap %}
{%else%}
{% assign Base = Base_fisc_cap+res_begin %}
{% endif %}
{% assign RC_base = Base %}
{% assign Thin_Cap_base = Base*5 %}
      |**{::font size="m"}{{ Base | currency }}{:/font}**
      |***{::font size="m"}{{ Base | currency }}{:/font}***
      |***{::font size="m"}{{ Thin_Cap_base | currency }}{:/font}***
{% endstripnewlines %}

Thanks in advance!

I’ve changed it a little bit:

{% ic %}
{::infotext}
{% t "Selecteer, indien nodig, nog bijkomende rekeningen met betrekking tot het " %} **{% t "gestort kapitaal" %}** {% t "om de correcte grens te bepalen." %} {% input custom.range.fisc_cap. as:account_collection range:"10,11" account_var:accounts %}
{:/infotext}
{% endic %}
{% assign fisc_cap_accounts = period.accounts.include_zeros | range:custom.range.fisc_cap %}
{% assign last_year = period.minus_1y.year_end %}

{% comment %}Silverfin community ==> check to see if previous year exists{% endcomment %}
{% if period.minus_1y.exists %}
  {% assign show_nbr_prev_y = true %}
{% endif %}

{% ic %}
{::infotext}
{% t "Selecteer, indien nodig, nog bijkomende rekeningen met betrekking tot de " %} **{% t "belastbare reserves" %}** {% t "om de correcte grens te bepalen." %} {% input custom.range.thin_cap as:account_collection range:"12,130,131,133,14" default:"" account_var:accounts %}
{:/infotext}
{% endic %}
{% comment %}create account collection with the selected ranges (including zero accounts!) which are stored in the database variable "custom.range.thin_cap" {% endcomment %}
{% assign thin_cap_accounts = period.accounts.include_zeros | range:custom.range.thin_cap %}
{% assign last_year = period.minus_1y.year_end %}
{% comment %}loop over those selected accounts, and display the previous value as well{% endcomment %}
{% stripnewlines %}
| {% t "Gegevens uit jaarrekening" %}
| {% t "Begintoestand" %}
| {% t "Eindtoestand" %}
| {% t "Basis" %}
| {% t "Max R/C" %}
| Max. Thin Cap  
{% newline %}
| ----25%----
| ----15%----:
| ----15%----:
| ----15%----:
| ------:+
| ------:+
{% ic %}#{% endic %}
{% nic %}+{% endnic %}
{% comment %}loop over accounts{% endcomment %}
{% comment %}loop over accounts{% endcomment %}
{% for fisc_cap in fisc_cap_accounts %}
  {% comment %}your comments{% endcomment %}

  {% newline %}
  {% comment %}display account and number as linkto{% endcomment %}
  | {{ fisc_cap.link }}
  {% comment %}create variable which goes to the period.accounts-drop but in the last period of last book year, filtered on the account number{% endcomment %}
  {% assign value_end_year = last_year.accounts | range:fisc_cap.number %}
  | {% =$2+ -value_end_year | currency %}
  {% comment %}display the value in current period, which is the db variable value of the account drop{% endcomment %}
  | {% =$3+ -fisc_cap.value | currency %}
  | {{ -fisc_cap.value | currency }}
  |
  |{% endfor %}
{% for account in thin_cap_accounts %}
  {% newline %}
  {% comment %}display account and number as linkto{% endcomment %}
  | {{ account.link }}
{% comment %}create variable which goes to the period.accounts-drop but in the last period of last book year, filtered on the account number{% endcomment %}
{% assign value_end_year = last_year.accounts | range:account.number %}
  {% comment %}display new created var "value_end_year"{% endcomment %}
  {% if show_nbr_prev_y %}
  | {% =$20+ -value_end_year | currency %}  
  {% else %}
  | {% $20+input account.custom.value.end_year as:currency default:-value_end_year %}
  {% endif %}

{% comment %}display the value in current period, which is the db variable value of the account drop{% endcomment %}
  | {% =$21+ -account.value | currency %}
  | {{ -value_end_year | currency }}
  | 
  |
{% endfor %}
{% comment %}Give totals of the selected ranges in correct columns{% endcomment %}
{% newline %}
  | {% t "Belastbare reserves in het kapitaal en belastbare uitgiftepremies (1001 PN)" %}
  | {% =$0+input custom.res_in_cap_last_year.begintoestand as currency %}
  | {% =$1+input custom.res_in_cap_this_year.eindtoestand as currency %}
  | {{ -$1 | currency }}
  |
  |
{% comment %}Give totals of the selected ranges in correct columns{% endcomment %}
{% newline %}
    ||||||
{% newline %}
    |**{% t "Fiscaal gestort kapitaal" %}**
{% assign cap_begin = $2-$0 %}
    |**{{ cap_begin | currency }}**
{% assign cap_einde = $3-$1 %}
    |**{{ cap_einde | currency }}**
{% assign Base_fisc_cap = $3-$1 %}
    |**{{ Base_fisc_cap | currency }}**
    |
    |
{% newline %}
    | **{% t "Totaal belastbare reserves" %}**
    {% assign res_begin = $20+$0  %}
    | **{{ res_begin | currency }}**
    {% assign res_einde = $21+$1 %}
    | **{{ res_einde | currency }}**
    | **{{ res_begin | currency }}**
    |
    |
{% newline %}
      |**{::font size="m"}{% t "Totaal belastbaar vermogen" %}{:/font}**
      |**{::font size="m"}{{ cap_begin+res_begin | currency }}{:/font}**
      |**{::font size="m"}{{ cap_einde+res_einde | currency }}{:/font}**
{% if res_begin < 0 %}
{% assign Base = Base_fisc_cap %}
{%else%}
{% assign Base = Base_fisc_cap+res_begin %}
{% endif %}
{% assign RC_base = Base %}
{% assign Thin_Cap_base = Base*5 %}
      |**{::font size="m"}{{ Base | currency }}{:/font}**
      |***{::font size="m"}{{ Base | currency }}{:/font}***
      |***{::font size="m"}{{ Thin_Cap_base | currency }}{:/font}***
{% endstripnewlines %} 

So actually, now inputs will be shown if the previous year does not exist, with a default (which actually is not needed at all as that default is calculated on the value of previous year - which does not exist- of those selected accounts).

So better would be:

  {% if show_nbr_prev_y %}
  | {% =$20+ -value_end_year | currency %}  
  {% else %}
  | {% $20+input account.custom.value.end_year as:currency default:0%}
  {% endif %}

Hope this helps @cedric.devos

1 Like

Thanks @sven !