Page 1 of 1

Negative hours

Posted: Thu Feb 21, 2019 12:18 pm
by richard
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?

Re: Negative hours

Posted: Fri Feb 22, 2019 12:15 am
by wrc
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?

Re: Negative hours

Posted: Wed Feb 27, 2019 10:22 am
by richard
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?

Re: Negative hours

Posted: Wed Mar 06, 2019 9:05 am
by richard
Can this be a feature in the new version of Time Tracker?

Re: Negative hours

Posted: Fri Mar 08, 2019 2:49 am
by admin
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.

Re: Negative hours

Posted: Fri Mar 22, 2019 1:35 pm
by richard
Great idea!

Re: Negative hours

Posted: Fri Apr 19, 2019 8:20 pm
by Nik
I did some initial work to support negative durations in Time Tracker 1.19.1.4962.