private Duration getAssignmentWork ( ProjectCalendar calendar , TimephasedWork assignment ) { Date assignmentStart = assignment . getStart ( ) ; Date splitStart = assignmentStart ; Date splitFinishTime = calendar . getFinishTime ( splitStart ) ; Date splitFinish = DateHelper . setTime ( splitStart , splitFinishTime ) ; Duration calendarSplitWork = calendar . getWork ( splitStart , splitFinish , TimeUnit . MINUTES ) ; Duration assignmentWorkPerDay = assignment . getAmountPerDay ( ) ; Duration splitWork ; double splitMinutes = assignmentWorkPerDay . getDuration ( ) ; splitMinutes *= calendarSplitWork . getDuration ( ) ; splitMinutes /= ( 8 * 60 ) ; // this appears to be a fixed value splitWork = Duration . getInstance ( splitMinutes , TimeUnit . MINUTES ) ; return splitWork ; }
Retrieves the pro - rata work carried out on a given day .