Negative hours

Discussion forum about Anuko Time Tracker
Post Reply
richard
Posts: 10
Joined: Sun May 29, 2016 9:55 am

Negative hours

Post by richard » Thu Feb 21, 2019 12:18 pm

I would like the users to submit negative hours.
When I now submit a negative hour I got the message: "invalid"

Can you help me with this?

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

Re: Negative hours

Post by wrc » Fri Feb 22, 2019 12:15 am

By design, current code does not support negative durations. For example, both ttTimeHelper::postedDurationToMinutes and ttTimeHelper::minutesToDuration return false on trying to use a negative value.

From the other hand, expenses can be negatively priced now, although not originally designed as so.

What exactly are you trying to accomplish? Is this related to hours on retainer post?

richard
Posts: 10
Joined: Sun May 29, 2016 9:55 am

Re: Negative hours

Post by richard » Wed Feb 27, 2019 10:22 am

I want to accomplish that a when a worker has to work (let's say) 36 hours a week, that his/her week total is always 36 hours.
So when he/she works 2 hours overtime, the total is 38 hours. I want them submit -2 hours on a project (overtime) to come to 36 hours.

Can I edit ttTimeHelper somewhere to make negative hours possible?

richard
Posts: 10
Joined: Sun May 29, 2016 9:55 am

Re: Negative hours

Post by richard » Wed Mar 06, 2019 9:05 am

Can this be a feature in the new version of Time Tracker?

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

Re: Negative hours

Post by admin » Fri Mar 08, 2019 2:49 am

richard wrote:
Wed Mar 06, 2019 9:05 am
Can this be a feature in the new version of Time Tracker?
It can be, if we manage to find a resource to do it. It looks like a reasonably small modification, still someone with enough skill must go through affected areas and make sure nothing gets broken by this mod.

Do you want us to open a fundraiser for this feature?

There also could be design questions, like what to do with negative entries, understanding the business requirement better, etc.

richard
Posts: 10
Joined: Sun May 29, 2016 9:55 am

Re: Negative hours

Post by richard » Fri Mar 22, 2019 1:35 pm

Great idea!

Nik
Posts: 484
Joined: Wed May 26, 2010 5:55 pm

Re: Negative hours

Post by Nik » Fri Apr 19, 2019 8:20 pm

I did some initial work to support negative durations in Time Tracker 1.19.1.4962.
Attachments
negative_hours_in_time_tracker.png
An example of negative durations for time records.
negative_hours_in_time_tracker.png (60.51 KiB) Viewed 1174 times

Post Reply