Hi
I’ve created my own account template. Everything is okay now but I still have 1 problem. Silverfin says the details are not explained while everything is filled in.
Do I have to include something in my liquid code?
Thanks!
Hi
I’ve created my own account template. Everything is okay now but I still have 1 problem. Silverfin says the details are not explained while everything is filled in.
Do I have to include something in my liquid code?
Thanks!
Hi @EwoutR,
Is the value for that particular account 4.776,17? The template will be trying to reconcile to that value and it looks like the account value might be zero?
Best,
Borja
Thanks for sharing that @EwoutR,
Could you please post the liquid code here so that I can take a look?
Best,
Borja
variables
{% capture totaal %}{% t “Totaal” %}{% endcapture %}
{% addnewinputs %}
{% assign details = current_account.custom.details | sort: ‘date’ %}
{% endaddnewinputs %}
{% assign period_end_date = period.end_date | date:‘%m/%Y’ %}
{% comment %}
calendar year is always 365, except for leap years, then it’s 366
we check whether in the last 12 months the month february of a leap year was included
{% endcomment %}
{% assign total_days_in_calendaryear = 365 %}
{% assign month_end_date = period.year_end_date | date:“%m” %}
{% assign year_end_date = period.year_end_date | date:“%Y” %}
{% if month_end_date == “12” %}
{% assign month_start_date = 1 %}
{% assign year_start_date = INT(year_end_date) %}
{% else %}
{% assign month_start_date = INT(month_end_date)+1 %}
{% assign year_start_date = INT(year_end_date)-1 %}
{% endif %}
{% assign month_end_date = INT(month_end_date) %}
{% assign year_end_date = INT(year_end_date) %}
{% for year in (year_start_date…year_end_date) %}
{% assign modulo_year_100 = year | modulo:100 %}
{% assign modulo_year_4 = year | modulo:4 %}
{% if modulo_year_4 == 0 and modulo_year_100 != 0 and month_start_date < 3 and forloop.first %}
{% assign total_days_in_calendaryear = total_days_in_calendaryear+1 %}
{% elsif modulo_year_4 == 0 and modulo_year_100 != 0 and month_end_date > 1 and forloop.last %}
{% assign total_days_in_calendaryear = total_days_in_calendaryear+1 %}
{% endif %}
{% endfor %}
{% assign total_days_in_bookyear = period.year_end_date-period.year_start_date+1 %}
{% assign space = ’ ’ %}
{% assign start_date_bookyear = period.year_start_date | date:“%Y-%m-%d” %}
{% assign bookyear_2022 = “2022/1/1” | date:“%Y-%m-%d” %}
{% if start_date_bookyear >= bookyear_2022 %}
{% assign bookyear_start_2022 = true %}
{% else %}
{% assign bookyear_start_2022 = false %}
{% endif %}
{% comment %}01/01/2020 == 1577836800 (Unix timestamp){% endcomment %}
{% for detail in details %}
{% assign detail_date = detail.date | date:“%s” %}
{% endfor %}
{% assign end_date_from = period.year_end_date | date:“%Y-%m-%d” %}
{% assign start_date_to = rollforward.period.year_start_date | date:“%Y-%m-%d” %}
{% comment %}------------ START: Investment deduction -----------{% endcomment %}
{% comment %}Check if fiscal year is equal to or above 2020{% endcomment %}
{% assign fiscal_year = period.fiscal_year %}
{% assign check_fiscal_year = false %}
{% if fiscal_year >= 2020 %}
{% assign check_fiscal_year = true %}
{% endif %}
{% comment %}01/01/2021 == 1609459200 (Unix timestamp){% endcomment %}
{% comment %}only as from 01/01/2021{% endcomment %}
{% if INT(start_by) >= 1609459200 %}
{% assign bookyear_start_2021 = true %}
{% endif %}
{% comment %}check whether it’s an intermediate period{% endcomment %}
{% if period_end_date < end_by %}
{% assign intermediate_period = true %}
{% endif %}
{% comment %}retrieve the value of the default deprec account
{% assign current_account_size = current_account.mapped_number.size %}
{% assign sliced_current_account_up_to_last_no = current_account.mapped_number | slice:0,current_account_size-1 %}
{% assign sliced_current_account_first_two_digits = current_account.mapped_number | slice:0,2 %}
{% assign depreciation_account = sliced_current_account_up_to_last_no | append:“9” %}
{% assign selected_depr_account = custom.depreciation.depr_account | default:depreciation_account %}
{% assign depr_account = period.accounts.include_zeros | range:selected_depr_account %}
{% assign previous_deprec_value = ABS(depr_account) %}
{% endcomment %}
table
{% stripnewlines %}
|–9%---- {% comment %}Date{% endcomment %}
|–10%---- {% comment %}Invoice{% endcomment %}
|–65%----
|–2%----
|–14%----:+ {% comment %}Inv value{% endcomment %}
{% newline %}
|_ {% t “Fact.” %} _
|_ {% t “Datum” %} _
|_ {% t “Omschrijving” %} _
|__
|_ {% t “Aanschafwaarde” %} _
{% endstripnewlines %}
{% assign $4 = 0 %}
{% assign $14 = 0 %}
{% fori detail in details %}{% if detail.date == blank %}{% assign new_year = “” %}{% else %}{% assign new_year = company.periods[detail.date].year_end_date | date:‘%Y’ %}{% endif %}
{% assign $4 = $4+detail.value %}
{% assign $14 = $14+detail.value %}
{% stripnewlines %}
|–9%---- {% comment %}Date{% endcomment %}
|–10%---- {% comment %}Invoice{% endcomment %}
|–65%----
|–2%---- {% comment %}Description{% endcomment %}
|–14%----:+ {% comment %}Inv value{% endcomment %}
{% newline %}
| {% input detail.custom.fact placeholder:“Fact.” %}
| {% input detail.date as:date placeholder:“DD/MM/YYYY” %}
| {% input detail.custom.title as:text placeholder:“Omschrijving” %}
|
| {% input detail.value as:currency placeholder:“Aanschafwaarde” %}
{% comment %}white space so sub-totals are more clear{% endcomment %}
{% assign current_year = new_year %}
{% endstripnewlines %}{% if current_year == blank %}{% assign current_year = new_year %}{% endif %}
{% stripnewlines %}
{% comment %}Set column labels for Excel import that diverge from placeholder{% endcomment %}
{% if forloop.last %}
{% capture input_labels %}
{% input detail.custom.fact as:text placeholder:“Fact.” %}
{% input detail.date as:date placeholder:“Datum” %}
{% input detail.custom.title as:text placeholder:“Omschrijving” %}
{% input detail.value as:currency placeholder:“Aanschafwaarde” %}
{% endcapture %}
{% endif %}
{% endstripnewlines %}{% if forloop.last %}{% nic %}
{% endnic %}{% endif %}{% endfori %}
{% comment %} Totals {% endcomment %}
{% stripnewlines %}
|–9%---- {% comment %}Date{% endcomment %}
|–10%---- {% comment %}Invoice{% endcomment %}
|–65%----
|–2%----
|–14%----:+ {% comment %}Inv value{% endcomment %}
{% newline %}
|
|
|
|
|^ {{$4 | currency}} ^
{% endstripnewlines %}
{% assign start_date_by = period.year_start_date | date:“%Y-%m-%d” %}
{% assign bookyear_2022 = “01/01/2022” | date:“%Y-%m-%d” %}
{% if start_date_by >= bookyear_2022 %}
{% include “parts/adjustment_button” %}
{% endif %}
{% unreconciled $20-current_account.value %}
{% result ‘tot_aw’ $4 %}
Thanks in advance for the effort!
Hi @EwoutR,
The issue is here:
{% unreconciled $20-current_account.value %}
The register/variable $20
is empty (i.e. it has not been previously declared so it does not have any value). What you need to do is accumulate the total values of your invoices inside the fori loop. So, before {% endfori %}
you can write this line:
{% assign total_value = total_value+detail.value %}
Then you have to modify the unreconciled tag:
{% unreconciled total_value-current_account.value %}
Hope that works,
Borja
Hi
Yes this works indeed, but when I add a new line the value of the account does not change. I’m also not sure if it works the way it’s supposed to, when I fill in the other fields it does not register as ‘explained’
Hi @EwoutR,
Just to clarify, the liquid code will not change the value of the account itself (that can only be done via adjustments).
Your template will reconcile the amounts you enter in the last column of your table to the value of the current account where the template is being rendered. So, entering data in the other fields will not change the value of the explained amount which is expected.
Hope that is clear.
Best,
Borja
Yes, I’m not an accountant so I didn’t really know how to process Thank you so much!