CASE: reference to repayment capital (BE standard template)

In report templates (or other templates even), you might want to refer to the so-called “repayment capital” an account had for the current year.

The data that holds this number, is unfortunately not accessible in the transactions-drop; while the debet-transactions of a certain asset-account would be good enough (and is accessible), that’s not always the case.
Also to take into consideration, is not always are transactions to be found for an account, as you can just upload the trial balance into Silverfin (so without transactions).

The account template to detail Loans and leasings (BE marketplace template) does have that info actually, and this case describes how we can refer to the total of all repayment capital (needed sometimes to calculate a more thorough cash-flow perhaps):

On account level:

This number will be taken into a result-tag:

    {% comment %}take value "afgelost kapitaal" current year in result tag{% endcomment %}
    {% if period.year_end_date-format_of_detail_date == 0 %}
      {% result 'repayment_capital' previous_saldo-d.eind_saldo %}
    {% endif %} 

Above is taken from the code of that account template.

On reconciliation level:
55

Well, actually nothing to see here, besides the fact we select the accounts we want to show. The most interesting part is in the background though:

{% for account in accounts_42.include_zeros_with_details %}

  {% comment %}get result tag from details account to have a total "Repayment capital", taken into register $23{% endcomment %}
  {% $23+ account.results.repayment_capital %}

{% endfor %}

We loop over the collection with all selected accounts in, and for each account we access the account-drop to get to the results, made possible in the details of the individual accounts.

In the reconciliation we’ll create another result-tag, that holds the total of all repayment capital done in the details of the selected accounts:

{% comment %}the value taken into $23 has the value of "repayment capital"{% endcomment %}
{% result 'total_repayment_capital' $23 %}

Yes, while this cannot be considered as 100%, as one can forget to detail an account perhaps so the result of that account is never made.
But this case might give you an idea for a workaround if you have custom templates that hold the information of repayment capital.

So, for users who use the Silverfin standard templates from the marketplace to detail loans and leases, you can now refer to this total amount:

in a reconciliation:

{{ period.reconciliations.leasingen_leningen.results.total_repayment_capital | currency }}

in a report template (as a formula tag):
33
reconciliations.leasingen_leningen.results.total_repayment_capital

You do have to use the Silverfin standard templates though; if you don’t use them, we hope this case can give you an idea on how to work around on that.