public DailyBalance calculateDailyBalance(YearMonthDay day, WorkSchedule workSchedule, List<AssiduousnessRecord> clockingList, List<Leave> leaveList) { Timeline timeline = new Timeline(); workSchedule.getWorkScheduleType().plotInTimeline(timeline); Iterator<AttributeType> attributesIt = DomainConstants.WORKED_ATTRIBUTES.getAttributes().iterator(); Leave.plotListInTimeline(leaveList,attributesIt,timeline); AssiduousnessRecord.plotListInTimeline(clockingList, attributesIt, timeline); timeline.print(); DailyBalance dailyBalance = workSchedule.calculateWorkingPeriods(day, clockingList, timeline); return dailyBalance;
public DailyBalance calculateDailyBalance(YearMonthDay day) { WorkSchedule workSchedule = getSchedule(day).workScheduleWithDate(day); Timeline timeline = new Timeline(workSchedule.getWorkScheduleType()); Iterator<AttributeType> attributesIt = DomainConstants.WORKED_ATTRIBUTES.getAttributes() .iterator();  List<Leave> leaves = getLeaves(day, day); Collections.sort(leaves, new BeanComparator("date"));  Leave.plotListInTimeline(leaves, attributesIt, timeline); DateTime init = day.toDateTime(workSchedule.getWorkScheduleType().getWorkTime()); DateTime end = day.toDateTime(workSchedule.getWorkScheduleType().getWorkEndTime()); if (workSchedule.getWorkScheduleType().isNextDay()) { end = end.plusDays(1); } List<AssiduousnessRecord> clockings = getClockingsAndMissingClockings(init, end); Collections.sort(clockings, new BeanComparator("date"));      timeline.plotListInTimeline(clockings, attributesIt, day); timeline.print(); DateTime firstClockingDate = null; if (clockings.size() != 0) { firstClockingDate = (clockings.iterator().next()).getDate(); } DailyBalance dailyBalance = workSchedule.calculateWorkingPeriods(day, firstClockingDate, timeline); return dailyBalance;
    public DailyBalance calculateDailyBalance(YearMonthDay day, WorkSchedule workSchedule, List<AssiduousnessRecord> clockingList, List<Leave> leaveList) {    		Timeline timeline = new Timeline();    		workSchedule.getWorkScheduleType().plotInTimeline(timeline);    		Iterator<AttributeType> attributesIt = DomainConstants.WORKED_ATTRIBUTES.getAttributes().iterator();    		Leave.plotListInTimeline(leaveList,attributesIt,timeline);    		AssiduousnessRecord.plotListInTimeline(clockingList, attributesIt, timeline);    		timeline.print();    		DailyBalance dailyBalance = workSchedule.calculateWorkingPeriods(day, clockingList, timeline);    		return dailyBalance;    }