getTimephasedOvertimeWork can return TimephasedWork with NaN
Multi platform library to read and write schedule data
Brought to you by:
joniles
In some situations, calling getTimephasedOvertimeWork results in a set of TimephasedWork where the duration is NaN. Based on the calculations you are doing in that method, this must be because the remaining work value is 0 and also the remaining overtime work is 0.
I have uploaded a patch to filter out these situations from that method. I also added a condition which will skip the processing of timephased data altogether if there is no overtime work set for the assignment.
This may not be the best approach for dealing with it, but it works for me.
Patch to filter out conditions that could give a NaN.
Sets factors to 0 if they end up NaN, rather than filtering out conditions that would make them so.
Actual, upon further testing, if I use the patch below, it breaks other things, like getTimephasedCost, because that method is expecting getTimephasedOvertimeWork to always return a non-null list (in getTimephasedCostSingleRate, for example, it tries to iterate over the passed in list without checking if it's null).
So I've uploaded an alternative patch that just checks for whether the perDayFactor/totalFactor are NaN, and sets them to zero if they are.
The changes now in CVS fix this issue.