Report Weeks of a year

Discussion forum about Anuko Time Tracker
Post Reply
El Cattivo
Posts: 4
Joined: Mon Oct 16, 2017 9:35 am

Report Weeks of a year

Post by El Cattivo » Fri Mar 09, 2018 10:16 am

Hello everybody,
Is it possible to create a report that gives me the total weekly hours for each week in a a year?

admin
Posts: 547
Joined: Fri Oct 08, 2004 9:46 pm
Location: Vancouver, Canada
Contact:

Re: Report Weeks of a year

Post by admin » Fri Mar 09, 2018 5:27 pm

Currently it is not possible.

A logical way seems to customize the "Group by" option in reports to include the "by week" grouping option in addition to "by date". May be "by month" too.

Feel free to customize Time Tracker for this and send us a pull request / or your changed code for consideration.

El Cattivo
Posts: 4
Joined: Mon Oct 16, 2017 9:35 am

Re: Report Weeks of a year

Post by El Cattivo » Tue Mar 13, 2018 8:49 am

Ok, I'll see if I can do something together. Did you suggest some tips for me?

wrc
Posts: 259
Joined: Tue May 25, 2010 8:30 pm

Re: Report Weeks of a year

Post by wrc » Tue Mar 13, 2018 2:57 pm

El Cattivo wrote:Ok, I'll see if I can do something together. Did you suggest some tips for me?
Overall, it's not as easy as it may sound.

If just hacking around, then:

Report parameters are constructed on the reports.php page, and saved in session (as $bean). You'll need to modify this to include a new grouping option.

Then things are done in report.php, which calls various methods in ttReportHelper class, such as ttReportHelper::getItems, ttReportHelper::getSubtotals, and ttReportHelper::getTotals. You'll need to carefully review and modify ttReportHelper class.

If doing things properly, then any new customization strings may have to be reflected in translation files (about 30 of them).

Fav reports save / reuse needs (probably) to be modified to handle new grouping options.

Export and import needs to be checked and fixed if something gets broken by a mod, specifically fav reports imports with regards to new options.

Most challenging part is probably the mods in ttReportHelper, as things may not be very straightforward, and this change will only increase complexity. It may be best to hire a coder with some experience, especially if you want this change to be maintained in Time Tracker.

I may have forgotten something. But I hope it gets you something to start with.

El Cattivo
Posts: 4
Joined: Mon Oct 16, 2017 9:35 am

Re: Report Weeks of a year

Post by El Cattivo » Thu Mar 15, 2018 6:20 am

@wrc Thank you for your answer. I think that is to high for me :?

Post Reply