Menu

#189 getTimephasedOvertimeWork can return TimephasedWork with NaN

closed-fixed
Jon Iles
None
5
2012-03-03
2012-01-25
kpatmor
No

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.

Discussion

  • kpatmor

    kpatmor - 2012-01-25

    Patch to filter out conditions that could give a NaN.

     
  • kpatmor

    kpatmor - 2012-01-25

    Sets factors to 0 if they end up NaN, rather than filtering out conditions that would make them so.

     
  • kpatmor

    kpatmor - 2012-01-25

    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.

     
  • Jon Iles

    Jon Iles - 2012-03-03

    The changes now in CVS fix this issue.

     
  • Jon Iles

    Jon Iles - 2012-03-03
    • assigned_to: nobody --> joniles
    • status: open --> closed-fixed
     

Log in to post a comment.