Start period of fiscal year

We would like to have the possibility to access the first period of the fiscal year to which the current period belongs. This would be very similar to accessing the last period of the fiscal year by using the existing year_end functionality on a period:

year_end: The period at the end of the fiscal year this period is in.

(https://github.com/GetSilverfin/sf-templates/blob/master/drops/period.md)

However, year_start does not seem to exist.

Combining the functionalities of year_end with minus_1y might seem to offer a solution, but it does not guarantee to yield the actual first period of the fiscal year, since the fiscal years might be shortened or extended (‘verlengde/verkorte boekjaren’)

Is there another possibility to access the first period of the fiscal year a period is in?

Hi Robin

You could use the following:

{% assign year_start = period.year_start_date | date:“%Y” %}

I’ll ask internally why year_end exists and year_start doesn’t though. We might have it in the future but this will help you out in the mean while.

Kind regards

Hi @SamVanEenoo, thanks for the quick response.
When I use the code you provided, I just get ‘Y’ as a result.
Which makes sense, since Y is not a known time format element for strftime.
“%Y” is a known time format element, but yields the year of the date, not the period.

Am I missing something here? :thinking:

Forgot the “%” indeed. Edited the code. Should work now. :slight_smile:
Take period.start_date instead to get the year of the current period.

Hello @SamVanEenoo,
I was already able to get the integer representing the year of the first period of the fiscal year using a date format on period.year_start_date.
What I want to be able to do is get the actual Period drop, not the date.

Hey Robin

I understand your question now. This is however not possible at the moment. Can I ask why and/or how you would use this. Maybe we have an alternative.

Kind regards

Hi @SamVanEenoo,

I actually encountered the lack of this functionality while working around another issue in our custom template that corresponds to Silverfin’s Loans & Leasings (42).

TLDR: we need to access the opening value of an account for a period that does not yet have any bookings.

Long story:
We need to access the opening value of a period, in order to fill it in as the default value of an input field.
This period is determined by a date the user provides in another input field.
We can determine the end period of the fiscal year in which the user-provided date lies.
We then simply get the opening_value of that period for an account.

company.periods[custom.some.date].year_end.accounts[some_account_number].opening_value

However, if this end period does not yet have any bookings (in the accountancy software), the period does not yet exist in Silverfin yet, and Silverfin does not seem to be able to return the correct opening_value. Yet the opening value is known by Silverfin, just not on that (‘unexisting’) period…

So we thought we could circumvent this restriction by accessing the year_start date, which does exist, and get the opening_value from that period, but that seems to be a no-go as well…

Hey @robin.bailleul,

If you don’t have any data in period Q1 2019 for instance, you’ll never be able to even go to that period through the date picker of the working papers (so you won’t be able to reach the working papers of that period - it’s not an option even). That’s just standard Silverfin for now…

May I ask, from an accounting standpoint, why you want to be able to do such thing? Is it to make budgets f.i.?

Hi @sven,

We understand that one cannot navigate to a period that does not have any data, and therefore does not exist in Silverfin yet; that makes sense :slight_smile: That is not what we try to do either.

We tried to access a known opening value for an account, but on a period that does not yet have data.
Since Silverfin knows what fiscal year the period is in, it knows the first period of that fiscal year (which does have data), and knows the opening value.

Since this did not work, we tried to access the first period of a fiscal year with the unexisting .year_start on a period.

We would like to achieve this to populate the amortization tables for future years.
We fill in defaults for the starting balance based on the opening value from the accountancy data, if present.

Hi @robin.bailleul,

To get to the core of this, let me explain how Silverfin currently calculates opening_value on an AccountDrop:

  • we search for the last period of the previous year
  • if the last period of the previous year exists, we return the value of that account in that period

For example

  1. you are in period 05/2018
  2. you ask the next period period.plus_1y. It doesn’t matter if it exists or not.
  3. period.plus_1y.opening_value searches for 12/2017 (assuming a normal book year)
  4. if 12/2017 exists, that value will be returned, if it doesn’t exist, we’ll return 0

Does this match with your experiences?

Hi @Tim,

My experiences are that the period needs to exist in order to be able to call the opening value on it correctly, so I don’t think that matches with

I am also not sure with what is happening when calling ‘open_value’ on a period drop?

period.plus_1y.opening_value

I was under the impression that one needs to call the opening_value on an account for a period, not the period itself?
And my experience is that the accounts do not exist for unexisting periods, and therefore do not allow to get the opening value…

So when there is not yet data in the last period of the fiscal year to which the current period belongs, then the following code will result in 0.0 instead of the correct opening value:

period.year_end.accounts[some_account_number].opening_value

This is getting complicated to explain :sweat_smile:

Hi @robin.bailleul,

If the accounts don’t have any bookings, we normally filter them out. Could you try to add .include_zeros to your accounts range? So

period.year_end.accounts.include_zeros[some_account_number].opening_value

Hopefully this helps.

Hi @Tim,

I was actually already using .include_zeros_with_details but then I only got the name of the account, not the opening value.
Using .include_zeros does indeed yield the desired result when calling the opening value on an account for a not yet existing period :smiley:

Thanks for your help!
BR,
Robin

1 Like