This will add support for a fiscal year in the UI and the API. It will now be possible to have pre-archived fiscal year (ex : from april 2016 to march 2017). To enable the fiscal year, the user has to add the following lines in the config.ini.php file :
[General]
enabled_periods_UI = "day,week,month,year,range,fisyear"
enabled_periods_API = "day,week,month,year,range,fisyear"
fiscal_year_start_month = 4
I need to work and understand the error in the second tests in the DataPurgingTest.php file. As for the tests 7, 8 and 9, I don't really have a clue as to what causes the problems. Any help would be appreciated.
Will adjust the DataPuringTest for the fiscal year and retry.
BTW: You don't have to close this pull request and open a new one. You can just add commits to this pull request until you are finished.
Corrected the predictions for the DataPuringTest to take into account the new fiscal year.
I think I went as far as I can go with this one. I'd need some help on the remaining errors. Also, I would need to rework and put another test for the fiscal year in the Privacy settings test, but I don't understand it well enough.
Any help would be appreciated. Thanks
Other then the test for the fiscal year, there is an error with the screenshots being differents. It seems every pull requests have these errors. I think it's ready for a review.
there is an error with the screenshots being differents
You are right. The first error is because of a plugin update. You don't need to do anything.
The other one is because of the new config options. You'll need to replace tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png
with the correct version (e.g. from http://builds-artifacts.piwik.org
). But I'd wait until everything else is finished.
Check failed on two screenshot files unrelated to the pull request :
ActionsDataTable_pageview_percentages.png (0.03% difference)
ActionsDataTable_unique_pageview_percentages.png (0.03% difference)
Ready for review.
Wondering if this would be do able in a new plugin after #11837 is ready
It might be. From what I'm reading, it would render obsolete my pull request. I needed to add support for a fiscal year fast because our organization's 100Gb per year of data is hard to read on a fiscal year basis in the actual state of Piwik. So, as long as I am able to pre-archive the data for a custom period (In my case, the fiscal year april through march), I really don't care which pull request makes it first :)
@mathieucharest sorry for getting back to you so late. As @sgiehl mentioned back then we started adding support for custom periods in https://github.com/matomo-org/matomo/pull/11837 by creating a class eg plugins/MyPlugin/PeriodFactory/FiscalYear.php
and this class should extend for example the Year class in your case maybe to use it as a basis. Could you check if that works? I'd close this PR for now as we likely don't really want to have FiscalYear
as a period in Matomo core but we would love to see this as a plugin if you're still interested in this feature.