Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for a fiscal year #11805

Closed
wants to merge 12 commits into from

Conversation

mathieucharest
Copy link

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

  - FiscalYearComparedToPreviousYear
  - PeriodFiscalYear
  - PeriodFiscalYears
…config.ini file to be enabled :

[General]
enabled_periods_UI = "day,week,month,year,range,fisyear"
enabled_periods_API = "day,week,month,year,range,fisyear"
fiscal_year_start_month = 5

[Deletereports]
delete_reports_keep_fisyear_reports = 1
…n to prevent errors from the UI where it was not possible to check if fisyear was enabled.

Corrected a bug where it was not possible to correctly save delete_reports_keep_fisyear_reports to the database.
@mathieucharest
Copy link
Author

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.

@mathieucharest
Copy link
Author

Will adjust the DataPuringTest for the fiscal year and retry.

@Findus23
Copy link
Member

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.

@mathieucharest
Copy link
Author

Corrected the predictions for the DataPuringTest to take into account the new fiscal year.

@Findus23 Findus23 added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Jun 19, 2017
@mathieucharest
Copy link
Author

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

@mathieucharest
Copy link
Author

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.

@Findus23 Findus23 added Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels Jun 22, 2017
@Findus23
Copy link
Member

Findus23 commented Jun 22, 2017

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.

@mathieucharest
Copy link
Author

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.

@sgiehl
Copy link
Member

sgiehl commented Jul 19, 2017

Wondering if this would be do able in a new plugin after #11837 is ready

@mathieucharest
Copy link
Author

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 :)

@mattab mattab added this to the Priority Backlog (Help wanted) milestone Sep 14, 2017
@tsteur
Copy link
Member

tsteur commented Sep 3, 2020

@mathieucharest sorry for getting back to you so late. As @sgiehl mentioned back then we started adding support for custom periods in #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants